gtkmm 3.3.16
|
Display a calendar and/or allow the user to select a date. More...
Public Types | |
typedef sigc::slot < Glib::ustring, guint, guint, guint > | SlotDetails |
Detail markup handler. | |
Public Member Functions | |
virtual | ~Calendar () |
GtkCalendar* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkCalendar* | gobj () const |
Provides access to the underlying C GtkObject. | |
Calendar () | |
void | select_month (guint month, guint year) |
Shifts the calendar to a different month. | |
void | select_day (guint day) |
Selects a day from the current month. | |
void | mark_day (guint day) |
Places a visual marker on a particular day. | |
void | unmark_day (guint day) |
Removes the visual marker from a particular day. | |
void | clear_marks () |
Remove all visual markers. | |
void | set_display_options (CalendarDisplayOptions flags) |
Sets display options (whether to display the heading and the month headings). | |
CalendarDisplayOptions | get_display_options () const |
Returns the current display options of calendar. | |
void | get_date (guint& year, guint& month, guint& day) const |
Obtains the selected date from a Gtk::Calendar. | |
void | get_date (Glib::Date& date) const |
Get the date as Glib::Date. | |
void | set_detail_func (const SlotDetails& slot) |
Installs a function which provides Pango markup with detail information for each day. | |
void | set_detail_width_chars (int chars) |
Updates the width of detail cells. | |
void | set_detail_height_rows (int rows) |
Updates the height of detail cells. | |
int | get_detail_width_chars () const |
Queries the width of detail cells, in characters. | |
int | get_detail_height_rows () const |
Queries the height of detail cells, in rows. | |
bool | get_day_is_marked (guint day) const |
Returns if the day of the calendar is already marked. | |
Glib::SignalProxy0< void > | signal_month_changed () |
Glib::SignalProxy0< void > | signal_day_selected () |
Glib::SignalProxy0< void > | signal_day_selected_double_click () |
Glib::SignalProxy0< void > | signal_prev_month () |
Glib::SignalProxy0< void > | signal_next_month () |
Glib::SignalProxy0< void > | signal_prev_year () |
Glib::SignalProxy0< void > | signal_next_year () |
Glib::PropertyProxy< int > | property_year () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< int > | property_year () const |
The selected year. | |
Glib::PropertyProxy< int > | property_month () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< int > | property_month () const |
The selected month (as a number between 0 and 11). | |
Glib::PropertyProxy< int > | property_day () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< int > | property_day () const |
The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day). | |
Glib::PropertyProxy< bool > | property_show_heading () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < bool > | property_show_heading () const |
If TRUE, a heading is displayed. | |
Glib::PropertyProxy< bool > | property_show_day_names () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < bool > | property_show_day_names () const |
If TRUE, day names are displayed. | |
Glib::PropertyProxy< bool > | property_no_month_change () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < bool > | property_no_month_change () const |
If TRUE, the selected month cannot be changed. | |
Glib::PropertyProxy< bool > | property_show_week_numbers () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < bool > | property_show_week_numbers () const |
If TRUE, week numbers are displayed. | |
Glib::PropertyProxy< bool > | property_show_details () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < bool > | property_show_details () const |
If TRUE, details are shown. | |
Glib::PropertyProxy< int > | property_detail_width_chars () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< int > | property_detail_width_chars () const |
Details width in characters. | |
Glib::PropertyProxy< int > | property_detail_height_rows () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< int > | property_detail_height_rows () const |
Details height in rows. | |
Protected Member Functions | |
virtual void | on_month_changed () |
This is a default handler for the signal signal_month_changed(). | |
virtual void | on_day_selected () |
This is a default handler for the signal signal_day_selected(). | |
virtual void | on_day_selected_double_click () |
This is a default handler for the signal signal_day_selected_double_click(). | |
virtual void | on_prev_month () |
This is a default handler for the signal signal_prev_month(). | |
virtual void | on_next_month () |
This is a default handler for the signal signal_next_month(). | |
virtual void | on_prev_year () |
This is a default handler for the signal signal_prev_year(). | |
virtual void | on_next_year () |
This is a default handler for the signal signal_next_year(). | |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Calendar* | wrap (GtkCalendar* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
Display a calendar and/or allow the user to select a date.
This is a widget that displays a calendar, one month at a time.
The month and year currently displayed can be altered with select_month(). The exact day can be selected from the displayed month using select_day().
The way in which the calendar itself is displayed can be altered using set_display_options().
The selected date can be retrieved from a GtkCalendar using get_date().
If performing many 'mark' operations, the calendar can be frozen to prevent flicker, using freeze(), and 'thawed' again using thaw().
The Calendar widget looks like this:
typedef sigc::slot<Glib::ustring, guint, guint, guint> Gtk::Calendar::SlotDetails |
Detail markup handler.
For instance,
Glib::ustring on_calendar_details(guint year, guint month, guint day);
year | The year for which details are needed. |
month | The month for which details are needed. |
day | The day of for which details are needed. |
This callback function provides Pango markup with detail information for the specified day. Examples for such details are holidays or appointments. The function should return an empty string when no information is available.
virtual Gtk::Calendar::~Calendar | ( | ) | [virtual] |
Gtk::Calendar::Calendar | ( | ) |
void Gtk::Calendar::clear_marks | ( | ) |
Remove all visual markers.
void Gtk::Calendar::get_date | ( | guint & | year, |
guint & | month, | ||
guint & | day | ||
) | const |
Obtains the selected date from a Gtk::Calendar.
year | Location to store the year as a decimal number (e.g. 2011), or 0 . |
month | Location to store the month number (between 0 and 11), or 0 . |
day | Location to store the day number (between 1 and 31), or 0 . |
void Gtk::Calendar::get_date | ( | Glib::Date & | date | ) | const |
Get the date as Glib::Date.
date | Referenz to set the date |
bool Gtk::Calendar::get_day_is_marked | ( | guint | day | ) | const |
Returns if the day of the calendar is already marked.
day | The day number between 1 and 31. |
int Gtk::Calendar::get_detail_height_rows | ( | ) | const |
Queries the height of detail cells, in rows.
See Gtk::Calendar::property_detail_width_chars().
int Gtk::Calendar::get_detail_width_chars | ( | ) | const |
Queries the width of detail cells, in characters.
See Gtk::Calendar::property_detail_width_chars().
CalendarDisplayOptions Gtk::Calendar::get_display_options | ( | ) | const |
const GtkCalendar* Gtk::Calendar::gobj | ( | ) | const [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Widget.
GtkCalendar* Gtk::Calendar::gobj | ( | ) | [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Widget.
void Gtk::Calendar::mark_day | ( | guint | day | ) |
Places a visual marker on a particular day.
day | The day number to mark between 1 and 31. |
virtual void Gtk::Calendar::on_day_selected | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_day_selected().
virtual void Gtk::Calendar::on_day_selected_double_click | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_day_selected_double_click().
virtual void Gtk::Calendar::on_month_changed | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_month_changed().
virtual void Gtk::Calendar::on_next_month | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_next_month().
virtual void Gtk::Calendar::on_next_year | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_next_year().
virtual void Gtk::Calendar::on_prev_month | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_prev_month().
virtual void Gtk::Calendar::on_prev_year | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_prev_year().
Glib::PropertyProxy< int > Gtk::Calendar::property_day | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< int > Gtk::Calendar::property_day | ( | ) | const |
The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< int > Gtk::Calendar::property_detail_height_rows | ( | ) | const |
Details height in rows.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< int > Gtk::Calendar::property_detail_height_rows | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< int > Gtk::Calendar::property_detail_width_chars | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< int > Gtk::Calendar::property_detail_width_chars | ( | ) | const |
Details width in characters.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< int > Gtk::Calendar::property_month | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< int > Gtk::Calendar::property_month | ( | ) | const |
The selected month (as a number between 0 and 11).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::Calendar::property_no_month_change | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::Calendar::property_no_month_change | ( | ) | const |
If TRUE, the selected month cannot be changed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::Calendar::property_show_day_names | ( | ) | const |
If TRUE, day names are displayed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::Calendar::property_show_day_names | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::Calendar::property_show_details | ( | ) | const |
If TRUE, details are shown.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::Calendar::property_show_details | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::Calendar::property_show_heading | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::Calendar::property_show_heading | ( | ) | const |
If TRUE, a heading is displayed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::Calendar::property_show_week_numbers | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::Calendar::property_show_week_numbers | ( | ) | const |
If TRUE, week numbers are displayed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< int > Gtk::Calendar::property_year | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< int > Gtk::Calendar::property_year | ( | ) | const |
The selected year.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void Gtk::Calendar::select_day | ( | guint | day | ) |
Selects a day from the current month.
day | The day number between 1 and 31, or 0 to unselect the currently selected day. |
void Gtk::Calendar::select_month | ( | guint | month, |
guint | year | ||
) |
Shifts the calendar to a different month.
month | A month number between 0 and 11. |
year | The year the month is in. |
void Gtk::Calendar::set_detail_func | ( | const SlotDetails & | slot | ) |
Installs a function which provides Pango markup with detail information for each day.
Examples for such details are holidays or appointments. That information is shown below each day when show-details is set. A tooltip containing full detail information is provided if the entire text could not fit into the details area, or if the show-details property is not set.
The size of the details area can be restricted by setting the detail-width-chars and detail-height-rows properties.
slot | A callback function providing details for each day. |
void Gtk::Calendar::set_detail_height_rows | ( | int | rows | ) |
Updates the height of detail cells.
See Gtk::Calendar::property_detail_height_rows().
rows | Detail height in rows. |
void Gtk::Calendar::set_detail_width_chars | ( | int | chars | ) |
Updates the width of detail cells.
See Gtk::Calendar::property_detail_width_chars().
chars | Detail width in characters. |
void Gtk::Calendar::set_display_options | ( | CalendarDisplayOptions | flags | ) |
Sets display options (whether to display the heading and the month headings).
flags | The display options to set. |
Glib::SignalProxy0< void > Gtk::Calendar::signal_day_selected | ( | ) |
void on_my_day_selected()
Emitted when the user selects a day.
Glib::SignalProxy0< void > Gtk::Calendar::signal_day_selected_double_click | ( | ) |
void on_my_day_selected_double_click()
Emitted when the user double-clicks a day.
Glib::SignalProxy0< void > Gtk::Calendar::signal_month_changed | ( | ) |
void on_my_month_changed()
Emitted when the user clicks a button to change the selected month on a calendar.
Glib::SignalProxy0< void > Gtk::Calendar::signal_next_month | ( | ) |
void on_my_next_month()
Emitted when the user switched to the next month.
Glib::SignalProxy0< void > Gtk::Calendar::signal_next_year | ( | ) |
void on_my_next_year()
Emitted when user switched to the next year.
Glib::SignalProxy0< void > Gtk::Calendar::signal_prev_month | ( | ) |
void on_my_prev_month()
Emitted when the user switched to the previous month.
Glib::SignalProxy0< void > Gtk::Calendar::signal_prev_year | ( | ) |
void on_my_prev_year()
Emitted when user switched to the previous year.
void Gtk::Calendar::unmark_day | ( | guint | day | ) |
Removes the visual marker from a particular day.
day | The day number to unmark between 1 and 31. |
Gtk::Calendar* wrap | ( | GtkCalendar * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |