Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::Calendar Class Reference

A GtkCalendar C++ wrapper class. More...

`#include <inti/gtk/calendar.h>`

Inheritance diagram for Inti::Gtk::Calendar:

List of all members.

## Public Member Functions

Constructors

- Calendar ()
    Construct a new calendar, with the current date being selected.
- Calendar (CalendarDisplayOptionsField flags)
    Construct a new calendar, with the specified display options and current date selected.
- virtual ~Calendar ()
    Destructor.

Accessors

- GtkCalendar * gtk_calendar () const
    Get a pointer to the GtkCalendar structure.
- GtkCalendarClass * gtk_calendar_class () const
    Get a pointer to the GtkCalendarClass structure.
- operator GtkCalendar * () const
    Conversion operator; safely converts a Calendar to a GtkCalendar pointer.
- int year () const
    Returns the currently visible year.
- int month () const
    Returns the currently visible month as a zero-based integer.
- int day () const
    Returns the currently selected day as a one-based integer (allowed values are 1-31).
- CalendarDisplayOptionsField display_flags () const
    Returns the current CalendarDisplayOptions OR'd together.
- int num_marked_dates () const
    Returns the number of days that have a mark over them.
- std::vector< bool > marked_date () const
    Returns a vector containing the day numbers that currently have a mark over them.
- void get_date (int *year, int *month, int *day) const
    Obtains the selected date from a Calendar.

Methods

- bool select_month (int month, int year)
    Shifts the calendar to a different month.
- void select_day (int day)
    Selects a day from the current month.
- bool mark_day (int day)
    Places a visual marker on a particular day.
- bool unmark_day (int day)
    Removes the visual marker from a particular day.
- void clear_marks ()
    Remove all visual markers.
- void display_options (CalendarDisplayOptionsField flags)
    Sets the display options (whether to display the year and month headings).
- void freeze ()
    Locks the display of the calendar until it is thawed with thaw().
- void thaw ()
    Defrosts a calendar; all the changes made since the last freeze() are displayed.

Signal Proxies

- const MonthChangedSignalProxy sig_month_changed ()
    Connect to the month_changed_signal; emitted when the user clicks a button to change the selected month.
- const DaySelectedSignalProxy sig_day_selected ()
    Connect to the day_selected_signal; emitted when the user selects a day.
- const DaySelectedDoubleClickSignalProxy sig_day_selected_double_click ()
    Connect to the day_selected_double_click_signal; emitted when the user selects a day with a double click.
- const PrevMonthSignalProxy sig_prev_month ()
    Connect to the prev_month_signal; emitted when the user selects the previous month.
- const NextMonthSignalProxy sig_next_month ()
    Connect to the next_month_signal; emitted when the user selects the next month.
- const PrevYearSignalProxy sig_prev_year ()
    Connect to the prev_year_signal; emitted when the user selects the previous year.
- const NextYearSignalProxy sig_next_year ()
    Connect to the next_year_signal; emitted when the user selects the next year.

## Protected Member Functions

Constructors

- Calendar (GtkCalendar *calendar, bool reference=false)
    Construct a new Calendar from an existing GtkCalendar.

Signal Handlers

- virtual void on_month_changed ()
    Called when the user clicks a button to change the selected month on a calendar.
- virtual void on_day_selected ()
    Called when the user selects a day.
- virtual void on_day_selected_double_click ()
    Called when the user double clicks a button to select a day.
- virtual void on_prev_month ()
    Called when the user selects the previous month.
- virtual void on_next_month ()
    Called when the user selects the next month.
- virtual void on_prev_year ()
    Called when the user selects the previous year.
- virtual void on_next_year ()
    Called when the user selects the next year.

## Detailed Description

A GtkCalendar C++ wrapper class.

Calendar 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(). To place a visual marker on a particular day, use mark_day() and to remove the marker, unmark_day(). Alternative, all marks can be cleared with clear_marks(). The way in which the calendar itself is displayed can be altered using display_options(). The selected date can be retrieved from a Calendar using get_date(). If performing many 'mark' operations, the calendar can be frozen to prevent flicker, with freeze(), and 'thawed' again using thaw().

## Constructor & Destructor Documentation

Inti::Gtk::Calendar::Calendar | ( | GtkCalendar * | calendar,
|  | bool | reference = false
| ) | `[explicit, protected]`

Construct a new Calendar from an existing GtkCalendar.

Parameters:

  calendar | A pointer to a GtkCalendar.
  reference | Set false if the initial reference count is floating, set true if it's not.

The calendar can be a newly created GtkCalendar or an existing GtkCalendar. (see G::Object::Object).

Inti::Gtk::Calendar::Calendar | ( | CalendarDisplayOptionsField | flags | ) | `[explicit]`

Construct a new calendar, with the specified display options and current date selected.

Parameters:

  flags | One or more values from the CalendarDisplayOptions enum OR'd together.

This is a convenience constructor that lets you specifiy the display options.

## Member Function Documentation

void Inti::Gtk::Calendar::display_options | ( | CalendarDisplayOptionsField | flags | ) |

Sets the display options (whether to display the year and month headings).

Parameters:

  flags | One or more values from the CalendarDisplayOptions enum OR'd together.

void Inti::Gtk::Calendar::get_date | ( | int * | year,
|  | int * | month,
|  | int * | day
| ) | const

Obtains the selected date from a Calendar.

Parameters:

  year | Location to store the year number.
  month | Location to store the month number.
  day | Location to store the day number.

bool Inti::Gtk::Calendar::mark_day | ( | int | day | ) |

Places a visual marker on a particular day.

Parameters:

  day | The day number to mark between 1 and 31.

Returns:
  Always true.

void Inti::Gtk::Calendar::select_day | ( | int | day | ) |

Selects a day from the current month.

Parameters:

  day | The day number between 1 and 31, or 0 to unselect the currently selected day.

bool Inti::Gtk::Calendar::select_month | ( | int | month,
|  | int | year
| ) |

Shifts the calendar to a different month.

Parameters:

  month | A month number between 0 and 11.
  year | The year the month is in.

Returns:
  Always true.

bool Inti::Gtk::Calendar::unmark_day | ( | int | day | ) |

Removes the visual marker from a particular day.

Parameters:

  day | The day number to unmark between 1 and 31.

Returns:
  true.

The documentation for this class was generated from the following file:

- calendar.h

Main Page - Footer