2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: calctrl.h
|
2008-04-04 02:20:48 -04:00
|
|
|
// Purpose: interface of wxCalendarCtrl
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-09 23:27:50 -04:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
// show Sunday as the first day of the week (default)
|
|
|
|
wxCAL_SUNDAY_FIRST = 0x0000,
|
|
|
|
|
|
|
|
// show Monday as the first day of the week
|
|
|
|
wxCAL_MONDAY_FIRST = 0x0001,
|
|
|
|
|
|
|
|
// highlight holidays
|
|
|
|
wxCAL_SHOW_HOLIDAYS = 0x0002,
|
|
|
|
|
|
|
|
// disable the year change control, show only the month change one
|
|
|
|
// deprecated
|
|
|
|
wxCAL_NO_YEAR_CHANGE = 0x0004,
|
|
|
|
|
|
|
|
// don't allow changing neither month nor year (implies
|
|
|
|
// wxCAL_NO_YEAR_CHANGE)
|
|
|
|
wxCAL_NO_MONTH_CHANGE = 0x000c,
|
|
|
|
|
|
|
|
// use MS-style month-selection instead of combo-spin combination
|
|
|
|
wxCAL_SEQUENTIAL_MONTH_SELECTION = 0x0010,
|
|
|
|
|
|
|
|
// show the neighbouring weeks in the previous and next month
|
|
|
|
wxCAL_SHOW_SURROUNDING_WEEKS = 0x0020,
|
|
|
|
|
|
|
|
// show week numbers on the left side of the calendar.
|
|
|
|
wxCAL_SHOW_WEEK_NUMBERS = 0x0040
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxCalendarEvent
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
The wxCalendarEvent class is used together with wxCalendarCtrl.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{events}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxCalendarCtrl
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxCalendarEvent : public wxDateEvent
|
|
|
|
{
|
|
|
|
public:
|
2012-04-09 23:27:50 -04:00
|
|
|
wxCalendarEvent();
|
|
|
|
wxCalendarEvent(wxWindow *win, const wxDateTime& dt, wxEventType type);
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Returns the week day on which the user clicked in
|
2008-03-08 08:52:38 -05:00
|
|
|
@c EVT_CALENDAR_WEEKDAY_CLICKED handler. It doesn't make sense to call
|
|
|
|
this function in other handlers.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxDateTime::WeekDay GetWeekDay() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Sets the week day carried by the event, normally only used by the
|
|
|
|
library internally.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:48:04 -04:00
|
|
|
void SetWeekDay(const wxDateTime::WeekDay day);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
2012-04-09 23:27:50 -04:00
|
|
|
wxEventType wxEVT_CALENDAR_SEL_CHANGED;
|
|
|
|
wxEventType wxEVT_CALENDAR_PAGE_CHANGED;
|
|
|
|
wxEventType wxEVT_CALENDAR_DOUBLECLICKED;
|
|
|
|
wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED;
|
|
|
|
wxEventType wxEVT_CALENDAR_WEEK_CLICKED;
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
/**
|
|
|
|
Possible kinds of borders which may be used to decorate a date using
|
|
|
|
wxCalendarDateAttr.
|
|
|
|
*/
|
|
|
|
enum wxCalendarDateBorder
|
|
|
|
{
|
|
|
|
wxCAL_BORDER_NONE, ///< No Border (Default)
|
|
|
|
wxCAL_BORDER_SQUARE, ///< Rectangular Border
|
|
|
|
wxCAL_BORDER_ROUND ///< Round Border
|
|
|
|
};
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxCalendarDateAttr
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
wxCalendarDateAttr is a custom attributes for a calendar date. The objects
|
|
|
|
of this class are used with wxCalendarCtrl.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
2009-02-20 06:34:52 -05:00
|
|
|
@category{data}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxCalendarCtrl
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxCalendarDateAttr
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
2008-04-04 02:20:48 -04:00
|
|
|
/**
|
|
|
|
Constructor for specifying all wxCalendarDateAttr properties.
|
|
|
|
*/
|
2008-09-21 19:48:04 -04:00
|
|
|
wxCalendarDateAttr(const wxColour& colText = wxNullColour,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxColour& colBack = wxNullColour,
|
|
|
|
const wxColour& colBorder = wxNullColour,
|
|
|
|
const wxFont& font = wxNullFont,
|
|
|
|
wxCalendarDateBorder border = wxCAL_BORDER_NONE);
|
2008-04-04 02:20:48 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Constructor using default properties except the given border.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxCalendarDateAttr(wxCalendarDateBorder border,
|
|
|
|
const wxColour& colBorder = wxNullColour);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns the background colour set for the calendar date.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:48:04 -04:00
|
|
|
const wxColour& GetBackgroundColour() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns the border set for the calendar date.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxCalendarDateBorder GetBorder() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns the border colour set for the calendar date.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:48:04 -04:00
|
|
|
const wxColour& GetBorderColour() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns the font set for the calendar date.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:48:04 -04:00
|
|
|
const wxFont& GetFont() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns the text colour set for the calendar date.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:48:04 -04:00
|
|
|
const wxColour& GetTextColour() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns @true if a non-default text background colour is set.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool HasBackgroundColour() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns @true if a non-default (i.e. any) border is set.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool HasBorder() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns @true if a non-default border colour is set.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool HasBorderColour() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns @true if a non-default font is set.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool HasFont() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns @true if a non-default text foreground colour is set.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool HasTextColour() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns @true if this calendar day is displayed as a holiday.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsHoliday() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the text background colour to use.
|
|
|
|
*/
|
|
|
|
void SetBackgroundColour(const wxColour& colBack);
|
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Sets the border to use.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetBorder(wxCalendarDateBorder border);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the border colour to use.
|
|
|
|
*/
|
|
|
|
void SetBorderColour(const wxColour& col);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the font to use.
|
|
|
|
*/
|
|
|
|
void SetFont(const wxFont& font);
|
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
If @a holiday is @true, this calendar day will be displayed as a
|
|
|
|
holiday.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetHoliday(bool holiday);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the text (foreground) colour to use.
|
|
|
|
*/
|
|
|
|
void SetTextColour(const wxColour& colText);
|
2008-03-27 22:47:12 -04:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Used (internally) by the generic wxCalendarCtrl::Mark().
|
2008-03-27 22:47:12 -04:00
|
|
|
*/
|
|
|
|
static const wxCalendarDateAttr& GetMark();
|
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Set the attributes that will be used to Mark() days on the generic
|
|
|
|
wxCalendarCtrl.
|
2008-03-27 22:47:12 -04:00
|
|
|
*/
|
2012-04-09 23:27:50 -04:00
|
|
|
static void SetMark(const wxCalendarDateAttr& m);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
/**
|
|
|
|
Possible return values from wxCalendarCtrl::HitTest().
|
|
|
|
*/
|
|
|
|
enum wxCalendarHitTestResult
|
|
|
|
{
|
|
|
|
wxCAL_HITTEST_NOWHERE, ///< Hit outside of anything.
|
|
|
|
wxCAL_HITTEST_HEADER, ///< Hit on the header (weekdays).
|
2009-01-25 08:47:20 -05:00
|
|
|
wxCAL_HITTEST_DAY, ///< Hit on a day in the calendar.
|
|
|
|
wxCAL_HITTEST_INCMONTH, ///< Hit on next month arrow (in alternate month selector mode).
|
|
|
|
wxCAL_HITTEST_DECMONTH, ///< Hit on previous month arrow (in alternate month selector mode).
|
|
|
|
wxCAL_HITTEST_SURROUNDING_WEEK, ///< Hit on surrounding week of previous/next month (if shown).
|
|
|
|
wxCAL_HITTEST_WEEK ///< Hit on week of the year number (if shown).
|
2008-04-04 02:20:48 -04:00
|
|
|
};
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxCalendarCtrl
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-27 22:47:12 -04:00
|
|
|
The calendar control allows the user to pick a date. The user can move the
|
2008-03-08 09:43:31 -05:00
|
|
|
current selection using the keyboard and select the date (generating
|
2008-04-04 02:20:48 -04:00
|
|
|
@c EVT_CALENDAR event) by pressing @c @<Return@> or double clicking it.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-27 22:47:12 -04:00
|
|
|
Generic calendar has advanced possibilities for the customization of its
|
2008-04-04 02:20:48 -04:00
|
|
|
display, described below. If you want to use these possibilities on every
|
|
|
|
platform, use wxGenericCalendarCtrl instead of wxCalendarCtrl.
|
2008-03-27 22:47:12 -04:00
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
All global settings (such as colours and fonts used) can, of course, be
|
|
|
|
changed. But also, the display style for each day in the month can be set
|
|
|
|
independently using wxCalendarDateAttr class.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
An item without custom attributes is drawn with the default colours and
|
2008-04-04 02:20:48 -04:00
|
|
|
font and without border, but setting custom attributes with SetAttr()
|
|
|
|
allows to modify its appearance. Just create a custom attribute object and
|
|
|
|
set it for the day you want to be displayed specially (note that the
|
|
|
|
control will take ownership of the pointer, i.e. it will delete it itself).
|
2008-03-27 22:47:12 -04:00
|
|
|
A day may be marked as being a holiday, even if it is not recognized as
|
2008-04-04 02:20:48 -04:00
|
|
|
one by wxDateTime using the wxCalendarDateAttr::SetHoliday() method.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
As the attributes are specified for each day, they may change when the
|
|
|
|
month is changed, so you will often want to update them in
|
2008-03-27 22:47:12 -04:00
|
|
|
@c EVT_CALENDAR_PAGE_CHANGED event handler.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAL_SUNDAY_FIRST}
|
2008-04-04 12:35:43 -04:00
|
|
|
Show Sunday as the first day in the week (not in wxGTK)
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAL_MONDAY_FIRST}
|
2008-04-04 12:35:43 -04:00
|
|
|
Show Monday as the first day in the week (not in wxGTK)
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAL_SHOW_HOLIDAYS}
|
2008-03-27 22:47:12 -04:00
|
|
|
Highlight holidays in the calendar (only generic)
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAL_NO_YEAR_CHANGE}
|
2008-03-27 22:47:12 -04:00
|
|
|
Disable the year changing (deprecated, only generic)
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAL_NO_MONTH_CHANGE}
|
2008-03-08 08:52:38 -05:00
|
|
|
Disable the month (and, implicitly, the year) changing
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAL_SHOW_SURROUNDING_WEEKS}
|
2008-03-08 08:52:38 -05:00
|
|
|
Show the neighbouring weeks in the previous and next months
|
2008-04-04 12:35:43 -04:00
|
|
|
(only generic, always on for the native controls)
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAL_SEQUENTIAL_MONTH_SELECTION}
|
2008-03-08 08:52:38 -05:00
|
|
|
Use alternative, more compact, style for the month and year
|
2008-03-27 22:47:12 -04:00
|
|
|
selection controls. (only generic)
|
2008-04-17 11:31:50 -04:00
|
|
|
@style{wxCAL_SHOW_WEEK_NUMBERS}
|
|
|
|
Show week numbers on the left side of the calendar. (not in generic)
|
2008-03-08 08:52:38 -05:00
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxCalendarEvent}
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_CALENDAR(id, func)}
|
2008-03-27 22:47:12 -04:00
|
|
|
A day was double clicked in the calendar.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_CALENDAR_SEL_CHANGED(id, func)}
|
2008-03-27 22:47:12 -04:00
|
|
|
The selected date changed.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_CALENDAR_PAGE_CHANGED(id, func)}
|
2008-03-27 22:47:12 -04:00
|
|
|
The selected month (and/or year) changed.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_CALENDAR_WEEKDAY_CLICKED(id, func)}
|
2008-03-27 22:47:12 -04:00
|
|
|
User clicked on the week day header (only generic).
|
2009-01-25 08:47:20 -05:00
|
|
|
@event{EVT_CALENDAR_WEEK_CLICKED(id, func)}
|
|
|
|
User clicked on the week of the year number (only generic).
|
2008-03-27 22:47:12 -04:00
|
|
|
@endEventTable
|
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
@note Changing the selected date will trigger an EVT_CALENDAR_DAY, MONTH or
|
|
|
|
YEAR event as well as an EVT_CALENDAR_SEL_CHANGED event.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{ctrl}
|
2012-11-03 14:32:50 -04:00
|
|
|
@appearance{calendarctrl}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-17 11:31:50 -04:00
|
|
|
@nativeimpl{wxgtk,wxmsw}
|
2008-03-27 22:47:12 -04:00
|
|
|
|
2008-03-28 12:19:12 -04:00
|
|
|
@see @ref page_samples_calendar, wxCalendarDateAttr, wxCalendarEvent,
|
|
|
|
wxDatePickerCtrl
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxCalendarCtrl : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Default constructor.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxCalendarCtrl();
|
2008-04-04 02:20:48 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Does the same as Create() method.
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxCalendarCtrl(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxDateTime& date = wxDefaultDateTime,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxCAL_SHOW_HOLIDAYS,
|
|
|
|
const wxString& name = wxCalendarNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destroys the control.
|
|
|
|
*/
|
|
|
|
~wxCalendarCtrl();
|
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Creates the control. See wxWindow::wxWindow() for the meaning of the
|
|
|
|
parameters and the control overview for the possible styles.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxDateTime& date = wxDefaultDateTime,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxCAL_SHOW_HOLIDAYS,
|
|
|
|
const wxString& name = wxCalendarNameStr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
This function should be used instead of changing @c wxCAL_SHOW_HOLIDAYS
|
2008-04-04 02:20:48 -04:00
|
|
|
style bit directly. It enables or disables the special highlighting of
|
|
|
|
the holidays.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void EnableHolidayDisplay(bool display = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
This function should be used instead of changing
|
2008-03-08 08:52:38 -05:00
|
|
|
@c wxCAL_NO_MONTH_CHANGE style bit. It allows or disallows the user to
|
2011-03-22 10:17:38 -04:00
|
|
|
change the month interactively. Note that if the month cannot be
|
|
|
|
changed, the year cannot be changed neither.
|
2008-03-27 22:47:12 -04:00
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
@return @true if the value of this option really changed or @false if
|
|
|
|
it was already set to the requested value.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual bool EnableMonthChange(bool enable = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-27 22:47:12 -04:00
|
|
|
@deprecated
|
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
This function should be used instead of changing
|
|
|
|
@c wxCAL_NO_YEAR_CHANGE style bit directly. It allows or disallows the
|
|
|
|
user to change the year interactively. Only in generic wxCalendarCtrl.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void EnableYearChange(bool enable = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns the attribute for the given date (should be in the range
|
|
|
|
1...31). The returned pointer may be @NULL. Only in generic
|
|
|
|
wxCalendarCtrl.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual wxCalendarDateAttr* GetAttr(size_t day) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the currently selected date.
|
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual wxDateTime GetDate() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the background colour of the header part of the calendar window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-01 19:43:34 -04:00
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetHeaderColours()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual const wxColour& GetHeaderColourBg() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the foreground colour of the header part of the calendar window.
|
2008-04-01 19:43:34 -04:00
|
|
|
|
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetHeaderColours()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual const wxColour& GetHeaderColourFg() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-27 22:47:12 -04:00
|
|
|
Gets the background highlight colour. Only in generic wxCalendarCtrl.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-01 19:43:34 -04:00
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetHighlightColours()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual const wxColour& GetHighlightColourBg() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-27 22:47:12 -04:00
|
|
|
Gets the foreground highlight colour. Only in generic wxCalendarCtrl.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-04-01 19:43:34 -04:00
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetHighlightColours()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual const wxColour& GetHighlightColourFg() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return the background colour currently used for holiday highlighting.
|
2008-04-01 19:43:34 -04:00
|
|
|
|
|
|
|
Only useful with generic wxCalendarCtrl as native versions currently
|
2008-04-04 02:20:48 -04:00
|
|
|
don't support holidays display at all and always return
|
|
|
|
@c wxNullColour.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetHolidayColours()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual const wxColour& GetHolidayColourBg() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return the foreground colour currently used for holiday highlighting.
|
2008-04-01 19:43:34 -04:00
|
|
|
|
|
|
|
Only useful with generic wxCalendarCtrl as native versions currently
|
2008-04-04 02:20:48 -04:00
|
|
|
don't support holidays display at all and always return
|
|
|
|
@c wxNullColour.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetHolidayColours()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual const wxColour& GetHolidayColourFg() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Returns one of wxCalendarHitTestResult constants and fills either
|
|
|
|
@a date or @a wd pointer with the corresponding value depending on the
|
2008-04-04 12:35:43 -04:00
|
|
|
hit test code.
|
2008-09-21 19:13:49 -04:00
|
|
|
|
2008-04-04 12:35:43 -04:00
|
|
|
Not implemented in wxGTK currently.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual wxCalendarHitTestResult HitTest(const wxPoint& pos,
|
|
|
|
wxDateTime* date = NULL,
|
|
|
|
wxDateTime::WeekDay* wd = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Clears any attributes associated with the given day (in the range
|
2008-04-04 02:20:48 -04:00
|
|
|
1...31). Only in generic wxCalendarCtrl.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void ResetAttr(size_t day);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Associates the attribute with the specified date (in the range 1...31).
|
2008-04-04 02:20:48 -04:00
|
|
|
If the pointer is @NULL, the items attribute is cleared. Only in
|
|
|
|
generic wxCalendarCtrl.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void SetAttr(size_t day, wxCalendarDateAttr* attr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the current date.
|
2008-04-04 12:35:43 -04:00
|
|
|
|
2011-06-19 18:46:36 -04:00
|
|
|
The @a date parameter must be valid and in the currently valid range as
|
|
|
|
set by SetDateRange(), otherwise the current date is not changed and
|
|
|
|
the function returns @false.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:48:04 -04:00
|
|
|
virtual bool SetDate(const wxDateTime& date);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Set the colours used for painting the weekdays at the top of the
|
|
|
|
control.
|
2008-04-01 19:43:34 -04:00
|
|
|
|
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
does nothing in the native versions.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void SetHeaderColours(const wxColour& colFg,
|
|
|
|
const wxColour& colBg);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Set the colours to be used for highlighting the currently selected
|
|
|
|
date.
|
2008-04-01 19:43:34 -04:00
|
|
|
|
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
does nothing in the native versions.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void SetHighlightColours(const wxColour& colFg,
|
|
|
|
const wxColour& colBg);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Marks the specified day as being a holiday in the current month.
|
2008-04-01 19:43:34 -04:00
|
|
|
|
|
|
|
This method is only implemented in the generic version of the control
|
|
|
|
and does nothing in the native ones.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void SetHoliday(size_t day);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-01 19:43:34 -04:00
|
|
|
Sets the colours to be used for the holidays highlighting.
|
2008-09-21 19:13:49 -04:00
|
|
|
|
2008-04-01 19:43:34 -04:00
|
|
|
This method is only implemented in the generic version of the control
|
|
|
|
and does nothing in the native ones. It should also only be called if
|
|
|
|
the window style includes @c wxCAL_SHOW_HOLIDAYS flag or
|
|
|
|
EnableHolidayDisplay() had been called.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void SetHolidayColours(const wxColour& colFg,
|
|
|
|
const wxColour& colBg);
|
2008-03-27 22:47:12 -04:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
Mark or unmark the day. This day of month will be marked in every
|
|
|
|
month. In generic wxCalendarCtrl,
|
2008-03-27 22:47:12 -04:00
|
|
|
*/
|
2008-09-21 19:13:49 -04:00
|
|
|
virtual void Mark(size_t day, bool mark);
|
2008-04-04 00:17:03 -04:00
|
|
|
|
|
|
|
/**
|
2008-04-04 02:20:48 -04:00
|
|
|
@name Date Range Functions
|
2008-04-04 00:17:03 -04:00
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
|
|
|
|
/**
|
2011-06-19 18:46:36 -04:00
|
|
|
Restrict the dates that can be selected in the control to the specified
|
|
|
|
range.
|
2008-04-04 00:17:03 -04:00
|
|
|
|
|
|
|
If either date is set, the corresponding limit will be enforced and
|
|
|
|
@true returned. If none are set, the existing restrictions are removed
|
|
|
|
and @false is returned.
|
|
|
|
|
2008-04-04 02:20:48 -04:00
|
|
|
@see GetDateRange()
|
|
|
|
|
2008-04-04 00:17:03 -04:00
|
|
|
@param lowerdate
|
2008-04-04 02:20:48 -04:00
|
|
|
The low limit for the dates shown by the control or
|
2009-03-13 20:49:24 -04:00
|
|
|
::wxDefaultDateTime.
|
2008-08-30 08:44:43 -04:00
|
|
|
@param upperdate
|
2008-04-04 02:20:48 -04:00
|
|
|
The high limit for the dates shown by the control or
|
2009-03-13 20:49:24 -04:00
|
|
|
::wxDefaultDateTime.
|
2008-04-04 00:17:03 -04:00
|
|
|
@return
|
|
|
|
@true if either limit is valid, @false otherwise
|
|
|
|
*/
|
|
|
|
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
|
2008-04-04 02:20:48 -04:00
|
|
|
const wxDateTime& upperdate = wxDefaultDateTime);
|
2008-04-04 00:17:03 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the limits currently being used.
|
|
|
|
|
|
|
|
@see SetDateRange()
|
|
|
|
|
|
|
|
@param lowerdate
|
2008-04-04 02:20:48 -04:00
|
|
|
If non-@NULL, the value of the low limit for the dates shown by the
|
2009-03-13 20:49:24 -04:00
|
|
|
control is returned (which may be ::wxDefaultDateTime if no limit
|
2008-04-04 02:20:48 -04:00
|
|
|
is set).
|
2008-04-04 00:17:03 -04:00
|
|
|
@param upperdate
|
2008-04-04 02:20:48 -04:00
|
|
|
If non-@NULL, the value of the upper limit for the dates shown by
|
2009-03-13 20:49:24 -04:00
|
|
|
the control is returned (which may be ::wxDefaultDateTime if no
|
2008-04-04 02:20:48 -04:00
|
|
|
limit is set).
|
2008-04-04 00:17:03 -04:00
|
|
|
@return
|
|
|
|
@true if either limit is set, @false otherwise
|
|
|
|
*/
|
2008-04-04 02:20:48 -04:00
|
|
|
virtual bool GetDateRange(wxDateTime *lowerdate,
|
|
|
|
wxDateTime *upperdate) const;
|
2008-04-04 00:17:03 -04:00
|
|
|
|
|
|
|
//@}
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|