Wrote the finishing touches on the dptwidget.c needed for the final date-time picker.

This commit is contained in:
Pietro Gagliardi 2016-05-04 23:28:46 -04:00
parent 0942888b4a
commit a11e939b34
2 changed files with 39 additions and 12 deletions

View File

@ -1,5 +1,5 @@
// 4 september 2015
#include "dtp.h"
#include "uipriv_unix.h"
// TODO imitate gnome-calendar's day/month/year entries?
// TODO 24-hour time
@ -501,7 +501,7 @@ static void dateTimePickerWidget_class_init(dateTimePickerWidgetClass *class)
G_OBJECT_CLASS(class)->finalize = dateTimePickerWidget_finalize;
}
GtkWidget *newDTP(void)
static GtkWidget *newDTP(void)
{
GtkWidget *w;
@ -510,7 +510,7 @@ GtkWidget *newDTP(void)
return w;
}
GtkWidget *newDP(void)
static GtkWidget *newDP(void)
{
GtkWidget *w;
@ -520,7 +520,7 @@ GtkWidget *newDP(void)
return w;
}
GtkWidget *newTP(void)
static GtkWidget *newTP(void)
{
GtkWidget *w;
@ -529,3 +529,38 @@ GtkWidget *newTP(void)
setLabel(dateTimePickerWidget(w));
return w;
}
struct uiDateTimePicker {
uiUnixControl c;
GtkWidget *widget;
dateTimePickerWidget *d;
};
uiUnixControlAllDefaults(uiDateTimePicker)
uiDateTimePicker *finishNewDateTimePicker(GtkWidget (*fn)(void))
{
uiDateTimePicker *d;
uiUnixNewControl(uiDateTimePicker, d);
d->widget = (*fn)();
d->d = dateTimePickerWidget(d->widget);
return d;
}
uiDateTimePicker *uiNewDateTimePicker(void)
{
return finishNewDateTimePicker(newDTP);
}
uiDateTimePicker *uiNewDatePicker(void)
{
return finishNewDateTimePicker(newDP);
}
uiDateTimePicker *uiNewTimePicker(void)
{
return finishNewDateTimePicker(newTP);
}

View File

@ -8,14 +8,6 @@ struct uiDateTimePicker {
uiUnixControlAllDefaults(uiDateTimePicker)
// TODO
typedef int OSTHING;
enum {
OSARGDATETIME,
OSARGDATEONLY,
OSARGTIMEONLY,
};
uiDateTimePicker *finishNewDateTimePicker(OSTHING OSARG)
{
uiDateTimePicker *d;