2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: calctrl.h
|
2008-04-04 06:20:48 +00:00
|
|
|
// Purpose: interface of wxCalendarCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxCalendarEvent
|
|
|
|
@wxheader{calctrl.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-04 06:20:48 +00:00
|
|
|
The wxCalendarEvent class is used together with wxCalendarCtrl.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxadv}
|
|
|
|
@category{events}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxCalendarCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxCalendarEvent : public wxDateEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-03-08 14:43:31 +00:00
|
|
|
Returns the week day on which the user clicked in
|
2008-03-08 13:52:38 +00:00
|
|
|
@c EVT_CALENDAR_WEEKDAY_CLICKED handler. It doesn't make sense to call
|
|
|
|
this function in other handlers.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxDateTime::WeekDay GetWeekDay() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Sets the week day carried by the event, normally only used by the
|
|
|
|
library internally.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetWeekDay(wxDateTime::WeekDay day);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-04-04 06:20:48 +00: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 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxCalendarDateAttr
|
|
|
|
@wxheader{calctrl.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-04 06:20:48 +00:00
|
|
|
wxCalendarDateAttr is a custom attributes for a calendar date. The objects
|
|
|
|
of this class are used with wxCalendarCtrl.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxadv}
|
|
|
|
@category{misc}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxCalendarCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
class wxCalendarDateAttr
|
2008-03-08 13:52:38 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Default constructor.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxCalendarDateAttr();
|
2008-04-04 06:20:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Constructor for specifying all wxCalendarDateAttr properties.
|
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
wxCalendarDateAttr(const wxColour& colText,
|
|
|
|
const wxColour& colBack = wxNullColour,
|
|
|
|
const wxColour& colBorder = wxNullColour,
|
|
|
|
const wxFont& font = wxNullFont,
|
|
|
|
wxCalendarDateBorder border = wxCAL_BORDER_NONE);
|
2008-04-04 06:20:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Constructor using default properties except the given border.
|
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
wxCalendarDateAttr(wxCalendarDateBorder border,
|
|
|
|
const wxColour& colBorder = wxNullColour);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns the background colour set for the calendar date.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetBackgroundColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns the border set for the calendar date.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxCalendarDateBorder GetBorder() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns the border colour set for the calendar date.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetBorderColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns the font set for the calendar date.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxFont GetFont() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns the text colour set for the calendar date.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetTextColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns @true if a non-default text background colour is set.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool HasBackgroundColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns @true if a non-default (i.e. any) border is set.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool HasBorder() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns @true if a non-default border colour is set.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool HasBorderColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns @true if a non-default font is set.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool HasFont() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns @true if a non-default text foreground colour is set.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool HasTextColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Returns @true if this calendar day is displayed as a holiday.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool IsHoliday() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the text background colour to use.
|
|
|
|
*/
|
|
|
|
void SetBackgroundColour(const wxColour& colBack);
|
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Sets the border to use.
|
2008-03-08 13:52:38 +00: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 06:20:48 +00:00
|
|
|
If @a holiday is @true, this calendar day will be displayed as a
|
|
|
|
holiday.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetHoliday(bool holiday);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the text (foreground) colour to use.
|
|
|
|
*/
|
|
|
|
void SetTextColour(const wxColour& colText);
|
2008-03-28 02:47:12 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Used (internally) by the generic wxCalendarCtrl::Mark().
|
2008-03-28 02:47:12 +00:00
|
|
|
*/
|
|
|
|
static const wxCalendarDateAttr& GetMark();
|
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Set the attributes that will be used to Mark() days on the generic
|
|
|
|
wxCalendarCtrl.
|
2008-03-28 02:47:12 +00:00
|
|
|
*/
|
|
|
|
static void SetMark(wxCalendarDateAttr const& m);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-04-04 06:20:48 +00:00
|
|
|
/**
|
|
|
|
Possible return values from wxCalendarCtrl::HitTest().
|
|
|
|
*/
|
|
|
|
enum wxCalendarHitTestResult
|
|
|
|
{
|
|
|
|
wxCAL_HITTEST_NOWHERE, ///< Hit outside of anything.
|
|
|
|
wxCAL_HITTEST_HEADER, ///< Hit on the header (weekdays).
|
|
|
|
wxCAL_HITTEST_DAY ///< Hit on a day in the calendar.
|
|
|
|
};
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxCalendarCtrl
|
|
|
|
@wxheader{calctrl.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-28 02:47:12 +00:00
|
|
|
The calendar control allows the user to pick a date. The user can move the
|
2008-03-08 14:43:31 +00:00
|
|
|
current selection using the keyboard and select the date (generating
|
2008-04-04 06:20:48 +00:00
|
|
|
@c EVT_CALENDAR event) by pressing @c @<Return@> or double clicking it.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-28 02:47:12 +00:00
|
|
|
Generic calendar has advanced possibilities for the customization of its
|
2008-04-04 06:20:48 +00:00
|
|
|
display, described below. If you want to use these possibilities on every
|
|
|
|
platform, use wxGenericCalendarCtrl instead of wxCalendarCtrl.
|
2008-03-28 02:47:12 +00:00
|
|
|
|
2008-04-04 06:20:48 +00: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 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
An item without custom attributes is drawn with the default colours and
|
2008-04-04 06:20:48 +00: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-28 02:47:12 +00:00
|
|
|
A day may be marked as being a holiday, even if it is not recognized as
|
2008-04-04 06:20:48 +00:00
|
|
|
one by wxDateTime using the wxCalendarDateAttr::SetHoliday() method.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-04 06:20:48 +00: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-28 02:47:12 +00:00
|
|
|
@c EVT_CALENDAR_PAGE_CHANGED event handler.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAL_SUNDAY_FIRST}
|
2008-04-04 16:35:43 +00:00
|
|
|
Show Sunday as the first day in the week (not in wxGTK)
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAL_MONDAY_FIRST}
|
2008-04-04 16:35:43 +00:00
|
|
|
Show Monday as the first day in the week (not in wxGTK)
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAL_SHOW_HOLIDAYS}
|
2008-03-28 02:47:12 +00:00
|
|
|
Highlight holidays in the calendar (only generic)
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAL_NO_YEAR_CHANGE}
|
2008-03-28 02:47:12 +00:00
|
|
|
Disable the year changing (deprecated, only generic)
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAL_NO_MONTH_CHANGE}
|
2008-03-08 13:52:38 +00:00
|
|
|
Disable the month (and, implicitly, the year) changing
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAL_SHOW_SURROUNDING_WEEKS}
|
2008-03-08 13:52:38 +00:00
|
|
|
Show the neighbouring weeks in the previous and next months
|
2008-04-04 16:35:43 +00:00
|
|
|
(only generic, always on for the native controls)
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAL_SEQUENTIAL_MONTH_SELECTION}
|
2008-03-08 13:52:38 +00:00
|
|
|
Use alternative, more compact, style for the month and year
|
2008-03-28 02:47:12 +00:00
|
|
|
selection controls. (only generic)
|
2008-03-08 13:52:38 +00:00
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-28 16:19:12 +00:00
|
|
|
@beginEventTable{wxCalendarEvent}
|
2008-04-06 14:43:04 +00:00
|
|
|
@event{EVT_CALENDAR(id, func)}
|
2008-03-28 02:47:12 +00:00
|
|
|
A day was double clicked in the calendar.
|
2008-04-06 14:43:04 +00:00
|
|
|
@event{EVT_CALENDAR_SEL_CHANGED(id, func)}
|
2008-03-28 02:47:12 +00:00
|
|
|
The selected date changed.
|
2008-04-06 14:43:04 +00:00
|
|
|
@event{EVT_CALENDAR_PAGE_CHANGED(id, func)}
|
2008-03-28 02:47:12 +00:00
|
|
|
The selected month (and/or year) changed.
|
2008-04-06 14:43:04 +00:00
|
|
|
@event{EVT_CALENDAR_WEEKDAY_CLICKED(id, func)}
|
2008-03-28 02:47:12 +00:00
|
|
|
User clicked on the week day header (only generic).
|
|
|
|
@endEventTable
|
|
|
|
|
2008-04-04 06:20:48 +00: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 13:52:38 +00:00
|
|
|
@library{wxadv}
|
|
|
|
@category{ctrl}
|
2008-04-04 06:20:48 +00:00
|
|
|
<!-- @appearance{calendarctrl.png} -->
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-28 02:47:12 +00:00
|
|
|
@nativeimpl{wxgtk}
|
|
|
|
|
2008-03-28 16:19:12 +00:00
|
|
|
@see @ref page_samples_calendar, wxCalendarDateAttr, wxCalendarEvent,
|
|
|
|
wxDatePickerCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxCalendarCtrl : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Default constructor.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxCalendarCtrl();
|
2008-04-04 06:20:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Does the same as Create() method.
|
|
|
|
*/
|
2008-03-08 14:43:31 +00: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 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destroys the control.
|
|
|
|
*/
|
|
|
|
~wxCalendarCtrl();
|
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Creates the control. See wxWindow::wxWindow() for the meaning of the
|
|
|
|
parameters and the control overview for the possible styles.
|
2008-03-08 13:52:38 +00: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 06:20:48 +00:00
|
|
|
style bit directly. It enables or disables the special highlighting of
|
|
|
|
the holidays.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void EnableHolidayDisplay(bool display = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-08 14:43:31 +00:00
|
|
|
This function should be used instead of changing
|
2008-03-08 13:52:38 +00:00
|
|
|
@c wxCAL_NO_MONTH_CHANGE style bit. It allows or disallows the user to
|
2008-04-04 06:20:48 +00:00
|
|
|
change the month interactively. Note that if the month can not be
|
|
|
|
changed, the year can not be changed neither.
|
2008-03-28 02:47:12 +00:00
|
|
|
|
2008-04-04 06:20:48 +00: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 13:52:38 +00:00
|
|
|
*/
|
2008-03-28 02:47:12 +00:00
|
|
|
bool EnableMonthChange(bool enable = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-28 02:47:12 +00:00
|
|
|
@deprecated
|
|
|
|
|
2008-04-04 06:20:48 +00: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 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void EnableYearChange(bool enable = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00: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 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxCalendarDateAttr* GetAttr(size_t day) const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the currently selected date.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxDateTime GetDate() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the background colour of the header part of the calendar window.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-04-01 23:43:34 +00:00
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetHeaderColours()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetHeaderColourBg() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the foreground colour of the header part of the calendar window.
|
2008-04-01 23:43:34 +00:00
|
|
|
|
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetHeaderColours()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetHeaderColourFg() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-28 02:47:12 +00:00
|
|
|
Gets the background highlight colour. Only in generic wxCalendarCtrl.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-04-01 23:43:34 +00:00
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetHighlightColours()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetHighlightColourBg() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-28 02:47:12 +00:00
|
|
|
Gets the foreground highlight colour. Only in generic wxCalendarCtrl.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-04-01 23:43:34 +00:00
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
always returns @c wxNullColour in the native versions.
|
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetHighlightColours()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetHighlightColourFg() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return the background colour currently used for holiday highlighting.
|
2008-04-01 23:43:34 +00:00
|
|
|
|
|
|
|
Only useful with generic wxCalendarCtrl as native versions currently
|
2008-04-04 06:20:48 +00:00
|
|
|
don't support holidays display at all and always return
|
|
|
|
@c wxNullColour.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetHolidayColours()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetHolidayColourBg() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return the foreground colour currently used for holiday highlighting.
|
2008-04-01 23:43:34 +00:00
|
|
|
|
|
|
|
Only useful with generic wxCalendarCtrl as native versions currently
|
2008-04-04 06:20:48 +00:00
|
|
|
don't support holidays display at all and always return
|
|
|
|
@c wxNullColour.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetHolidayColours()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
const wxColour GetHolidayColourFg() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00: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 16:35:43 +00:00
|
|
|
hit test code.
|
|
|
|
|
|
|
|
Not implemented in wxGTK currently.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxCalendarHitTestResult HitTest(const wxPoint& pos,
|
2008-03-09 12:33:59 +00:00
|
|
|
wxDateTime* date = NULL,
|
|
|
|
wxDateTime::WeekDay* wd = NULL);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Clears any attributes associated with the given day (in the range
|
2008-04-04 06:20:48 +00:00
|
|
|
1...31). Only in generic wxCalendarCtrl.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void ResetAttr(size_t day);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Associates the attribute with the specified date (in the range 1...31).
|
2008-04-04 06:20:48 +00:00
|
|
|
If the pointer is @NULL, the items attribute is cleared. Only in
|
|
|
|
generic wxCalendarCtrl.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetAttr(size_t day, wxCalendarDateAttr* attr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the current date.
|
2008-04-04 16:35:43 +00:00
|
|
|
|
|
|
|
The @a date parameter must be valid.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetDate(const wxDateTime& date);
|
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Set the colours used for painting the weekdays at the top of the
|
|
|
|
control.
|
2008-04-01 23:43:34 +00:00
|
|
|
|
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
does nothing in the native versions.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetHeaderColours(const wxColour& colFg,
|
|
|
|
const wxColour& colBg);
|
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Set the colours to be used for highlighting the currently selected
|
|
|
|
date.
|
2008-04-01 23:43:34 +00:00
|
|
|
|
|
|
|
This method is currently only implemented in generic wxCalendarCtrl and
|
|
|
|
does nothing in the native versions.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetHighlightColours(const wxColour& colFg,
|
|
|
|
const wxColour& colBg);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Marks the specified day as being a holiday in the current month.
|
2008-04-01 23:43:34 +00:00
|
|
|
|
|
|
|
This method is only implemented in the generic version of the control
|
|
|
|
and does nothing in the native ones.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetHoliday(size_t day);
|
|
|
|
|
|
|
|
/**
|
2008-04-01 23:43:34 +00:00
|
|
|
Sets the colours to be used for the holidays highlighting.
|
|
|
|
|
|
|
|
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 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetHolidayColours(const wxColour& colFg,
|
|
|
|
const wxColour& colBg);
|
2008-03-28 02:47:12 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
Mark or unmark the day. This day of month will be marked in every
|
|
|
|
month. In generic wxCalendarCtrl,
|
2008-03-28 02:47:12 +00:00
|
|
|
*/
|
|
|
|
void Mark(size_t day, bool mark);
|
2008-04-04 04:17:03 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-04 06:20:48 +00:00
|
|
|
@name Date Range Functions
|
2008-04-04 04:17:03 +00:00
|
|
|
|
|
|
|
The functions in this section are currently implemented in the generic
|
|
|
|
and MSW versions and do nothing in the native GTK implementation.
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
|
|
|
|
/**
|
|
|
|
Restrict the dates shown by the control to the specified range.
|
|
|
|
|
|
|
|
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 06:20:48 +00:00
|
|
|
@see GetDateRange()
|
|
|
|
|
2008-04-04 04:17:03 +00:00
|
|
|
@param lowerdate
|
2008-04-04 06:20:48 +00:00
|
|
|
The low limit for the dates shown by the control or
|
|
|
|
@c wxDefaultDateTime.
|
2008-04-04 04:17:03 +00:00
|
|
|
@param highlighting
|
2008-04-04 06:20:48 +00:00
|
|
|
The high limit for the dates shown by the control or
|
|
|
|
@c wxDefaultDateTime.
|
2008-04-04 04:17:03 +00:00
|
|
|
@return
|
|
|
|
@true if either limit is valid, @false otherwise
|
|
|
|
*/
|
|
|
|
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
|
2008-04-04 06:20:48 +00:00
|
|
|
const wxDateTime& upperdate = wxDefaultDateTime);
|
2008-04-04 04:17:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the limits currently being used.
|
|
|
|
|
|
|
|
@see SetDateRange()
|
|
|
|
|
|
|
|
@param lowerdate
|
2008-04-04 06:20:48 +00:00
|
|
|
If non-@NULL, the value of the low limit for the dates shown by the
|
2008-04-04 04:17:03 +00:00
|
|
|
control is returned (which may be @c wxDefaultDateTime if no limit
|
2008-04-04 06:20:48 +00:00
|
|
|
is set).
|
2008-04-04 04:17:03 +00:00
|
|
|
@param upperdate
|
2008-04-04 06:20:48 +00:00
|
|
|
If non-@NULL, the value of the upper limit for the dates shown by
|
|
|
|
the control is returned (which may be @c wxDefaultDateTime if no
|
|
|
|
limit is set).
|
2008-04-04 04:17:03 +00:00
|
|
|
@return
|
|
|
|
@true if either limit is set, @false otherwise
|
|
|
|
*/
|
2008-04-04 06:20:48 +00:00
|
|
|
virtual bool GetDateRange(wxDateTime *lowerdate,
|
|
|
|
wxDateTime *upperdate) const;
|
2008-04-04 04:17:03 +00:00
|
|
|
|
|
|
|
//@}
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|