AlpDateSelector
[UI Widgets]


Detailed Description

AlpDateSelector is a widget that lets a user select a date.


Data Structures

struct  _AlpDateSelector
struct  _AlpDateSelectorClass

Defines

#define ALP_DATE_SELECTOR(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), ALP_TYPE_DATE_SELECTOR, AlpDateSelector))
#define ALP_DATE_SELECTOR_CALENDAR_NROWS   6
#define ALP_DATE_SELECTOR_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), ALP_TYPE_DATE_SELECTOR, AlpDateSelectorClass))
#define ALP_DATE_SELECTOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), ALP_TYPE_DATE_SELECTOR, AlpDateSelectorClass))
#define ALP_IS_DATE_SELECTOR(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj), ALP_TYPE_DATE_SELECTOR))
#define ALP_IS_DATE_SELECTOR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), ALP_TYPE_DATE_SELECTOR))
#define ALP_TYPE_DATE_SELECTOR   (alp_date_selector_get_type())

Typedefs

typedef _AlpDateSelector AlpDateSelector
typedef _AlpDateSelectorClass AlpDateSelectorClass
typedef _AlpDateSelectorPrivate AlpDateSelectorPrivate

Enumerations

enum  AlpDateSelectorFlags {
  ALP_DATE_SELECTOR_BEGINS_SUN = 0, ALP_DATE_SELECTOR_BEGINS_MON = 1, ALP_DATE_SELECTOR_BEGINS_TUE = 2, ALP_DATE_SELECTOR_BEGINS_WED = 3,
  ALP_DATE_SELECTOR_BEGINS_THU = 4, ALP_DATE_SELECTOR_BEGINS_FRI = 5, ALP_DATE_SELECTOR_BEGINS_SAT = 6, ALP_DATE_SELECTOR_BEGINS_MASK = 0x07,
  ALP_DATE_SELECTOR_SPECIFY_WEEK_START = (1 << 3), ALP_DATE_SELECTOR_NEED_TODAY = (1 << 16), ALP_DATE_SELECTOR_TIME_T_RANGE = (1 << 17)
}
 Flags to specify behavior of AlpDateSelector For the day the week starts, the default behavior is to use the ALP locale's value (via alp_loc_get_locale_setting()). To specify another day to start the week with, use one of the ALP_DATE_SELECTOR_BEGINS values, combined with ALP_DATE_SELECTOR_SPECIFY_WEEK_START. For example, to start the week on Thursday, use: ALP_DATE_SELECTOR_BEGINS_THU | ALP_DATE_SELECTOR_SPECIFY_WEEK_START. More...

Functions

gint alp_date_selector_get_day (AlpDateSelector *selector)
 get the day of a month
gint alp_date_selector_get_month (AlpDateSelector *selector)
 get the month
void alp_date_selector_get_range (AlpDateSelector *selector, gint *min, gint *max)
 get the allowable range of year
GType alp_date_selector_get_type (void) G_GNUC_CONST
 Get the AlpDateSelector object type.
gint alp_date_selector_get_year (AlpDateSelector *selector)
 get the year
GtkWidget * alp_date_selector_new (gint flags)
 Creates a new AlpDateSelector.
void alp_date_selector_register_today_button (AlpDateSelector *selector, GtkButton *today)
 Register a "Today" button. The button is disabled when current date is selected, and enabled when current date not selected. Registration does not set a "clicked" handler - the button is responsible for calling alp_date_selector_set_month / alp_date_selector_set_day / alp_date_selector_set_year.
gint alp_date_selector_select (GtkWidget *parent, const gchar *title, gint *year, gint *month, gint *day, gint flags)
 shows the dialog containing the date selector and ask user to select one date.
void alp_date_selector_set_day (AlpDateSelector *selector, gint day)
void alp_date_selector_set_month (AlpDateSelector *selector, gint month)
 set the month If the selector has been visible, calender changed immidately.
void alp_date_selector_set_range (AlpDateSelector *selector, gint min, gint max)
 set the allowable range of years The maximum (and default) range is 1-9999.
void alp_date_selector_set_time_t_range (AlpDateSelector *selector)
 limit the allowable years to be those a time_t can handle If the results from the date selector will be stored into a time_t, the routine alp_date_selector_set_time_t_range() will limit the selector to the years that can be fully represented in the time_t data type, which on 32-bit Linux is typically 1970-2037. This routine is useful for changing the range of a date selector that has already been created and initialized, including date selectors created via glade. The same limits can also be set when the date selector is created by passing the ALP_DATE_SELECTOR_TIME_T_RANGE flag to either alp_date_selector_new() or alp_date_selector_select().
void alp_date_selector_set_year (AlpDateSelector *selector, gint year)
 set the year If the selector is visible, calender changed immidately.


Define Documentation

#define ALP_DATE_SELECTOR obj   )     (G_TYPE_CHECK_INSTANCE_CAST((obj), ALP_TYPE_DATE_SELECTOR, AlpDateSelector))
 

#define ALP_DATE_SELECTOR_CALENDAR_NROWS   6
 

#define ALP_DATE_SELECTOR_CLASS klass   )     (G_TYPE_CHECK_CLASS_CAST((klass), ALP_TYPE_DATE_SELECTOR, AlpDateSelectorClass))
 

#define ALP_DATE_SELECTOR_GET_CLASS obj   )     (G_TYPE_INSTANCE_GET_CLASS((obj), ALP_TYPE_DATE_SELECTOR, AlpDateSelectorClass))
 

#define ALP_IS_DATE_SELECTOR obj   )     (G_TYPE_CHECK_INSTANCE_TYPE((obj), ALP_TYPE_DATE_SELECTOR))
 

#define ALP_IS_DATE_SELECTOR_CLASS klass   )     (G_TYPE_CHECK_CLASS_TYPE((klass), ALP_TYPE_DATE_SELECTOR))
 

#define ALP_TYPE_DATE_SELECTOR   (alp_date_selector_get_type())
 


Typedef Documentation

typedef struct _AlpDateSelector AlpDateSelector
 

typedef struct _AlpDateSelectorClass AlpDateSelectorClass
 

typedef struct _AlpDateSelectorPrivate AlpDateSelectorPrivate
 


Enumeration Type Documentation

enum AlpDateSelectorFlags
 

Flags to specify behavior of AlpDateSelector For the day the week starts, the default behavior is to use the ALP locale's value (via alp_loc_get_locale_setting()). To specify another day to start the week with, use one of the ALP_DATE_SELECTOR_BEGINS values, combined with ALP_DATE_SELECTOR_SPECIFY_WEEK_START. For example, to start the week on Thursday, use: ALP_DATE_SELECTOR_BEGINS_THU | ALP_DATE_SELECTOR_SPECIFY_WEEK_START.

Enumerator:
ALP_DATE_SELECTOR_BEGINS_SUN  The day the week begins - matches Gtk values
ALP_DATE_SELECTOR_BEGINS_MON 
ALP_DATE_SELECTOR_BEGINS_TUE 
ALP_DATE_SELECTOR_BEGINS_WED 
ALP_DATE_SELECTOR_BEGINS_THU 
ALP_DATE_SELECTOR_BEGINS_FRI 
ALP_DATE_SELECTOR_BEGINS_SAT 
ALP_DATE_SELECTOR_BEGINS_MASK  Bit mask to get the day the week begins
ALP_DATE_SELECTOR_SPECIFY_WEEK_START  Override locale's week start day
ALP_DATE_SELECTOR_NEED_TODAY  Today button is needed (only for alp_date_selector_select)
ALP_DATE_SELECTOR_TIME_T_RANGE  Limit the range to the years representable with time_t


Function Documentation

gint alp_date_selector_get_day AlpDateSelector selector  ) 
 

get the day of a month

Parameters:
[in] selector an AlpDateSelector
Returns:
a day of a month (from 1 to 31)

gint alp_date_selector_get_month AlpDateSelector selector  ) 
 

get the month

Parameters:
[in] selector an AlpDateSelector
Returns:
a month

void alp_date_selector_get_range AlpDateSelector selector,
gint *  min,
gint *  max
 

get the allowable range of year

Parameters:
[in] selector an AlpDateSelector.
[out] min placeholder of allowable minmum year.
[out] max placeholder of allowable maximum year.

GType alp_date_selector_get_type void   ) 
 

Get the AlpDateSelector object type.

Parameters:
[in] none. 
Returns:
The AlpDateSelector type identifier

gint alp_date_selector_get_year AlpDateSelector selector  ) 
 

get the year

Parameters:
[in] selector an AlpDateSelector
Returns:
a year

GtkWidget* alp_date_selector_new gint  flags  ) 
 

Creates a new AlpDateSelector.

Parameters:
flags bitwise-or of AlpDateSelectorFlags.
Returns:
a new AlpDateSelector

void alp_date_selector_register_today_button AlpDateSelector selector,
GtkButton *  today
 

Register a "Today" button. The button is disabled when current date is selected, and enabled when current date not selected. Registration does not set a "clicked" handler - the button is responsible for calling alp_date_selector_set_month / alp_date_selector_set_day / alp_date_selector_set_year.

Parameters:
[in] selector an AlpDateSelector.
[in] today a GtkButton whose sensititivity the selector will manage

gint alp_date_selector_select GtkWidget *  parent,
const gchar *  title,
gint *  year,
gint *  month,
gint *  day,
gint  flags
 

shows the dialog containing the date selector and ask user to select one date.

Parameters:
[in] parent a GtkWidget. The dialog is transient for toplevel window of this widget. You can specify NULL, then Window manager will decide.
[in] title specifies the title of selector.
[in,out] year the placeholder of the year showed at first and selected by user,
[in,out] month the placeholder of the month showed at first and selected by user.
[in,out] day the placeholder of the day showed at first and selected by user.
[in] flags bitwise-or of AlpDateSelectorFlags.
Returns:
GTK_RESPONSE_ACCEPT if user specified some time.

GTK_RESPONSE_CANCEL if user canceled.

void alp_date_selector_set_day AlpDateSelector selector,
gint  day
 

set the day of a month

Parameters:
[in] selector an AlpDateSelector
[in] day a day of a month (from 1 to 31)

void alp_date_selector_set_month AlpDateSelector selector,
gint  month
 

set the month If the selector has been visible, calender changed immidately.

Parameters:
[in] selector an AlpDateSelector
[in] month a month (from 1 to 12; 1 = Jan, 2 = Feb, etc.)

void alp_date_selector_set_range AlpDateSelector selector,
gint  min,
gint  max
 

set the allowable range of years The maximum (and default) range is 1-9999.

Parameters:
[in] selector an AlpDateSelector
[in] min allowable minmum year. -1 means not to change current value.
[in] max allowable maximum year. -1 means not to change current value.

void alp_date_selector_set_time_t_range AlpDateSelector selector  ) 
 

limit the allowable years to be those a time_t can handle If the results from the date selector will be stored into a time_t, the routine alp_date_selector_set_time_t_range() will limit the selector to the years that can be fully represented in the time_t data type, which on 32-bit Linux is typically 1970-2037. This routine is useful for changing the range of a date selector that has already been created and initialized, including date selectors created via glade. The same limits can also be set when the date selector is created by passing the ALP_DATE_SELECTOR_TIME_T_RANGE flag to either alp_date_selector_new() or alp_date_selector_select().

Parameters:
[in] selector an AlpDateSelector

void alp_date_selector_set_year AlpDateSelector selector,
gint  year
 

set the year If the selector is visible, calender changed immidately.

Parameters:
[in] selector an AlpDateSelector
[in] year a year


Generated on Wed Jul 30 07:06:42 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.