X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/feb72429e84a705de867331397ff7b6cbaeec48a..700d08c1092bd08150d47b952c1e0d817a64d75f:/include/wx/calctrl.h diff --git a/include/wx/calctrl.h b/include/wx/calctrl.h index 393311c39f..5e6dd98436 100644 --- a/include/wx/calctrl.h +++ b/include/wx/calctrl.h @@ -159,14 +159,14 @@ private: // wxCalendarCtrl events // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_ADV wxCalendarCtrl; +class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl; class WXDLLIMPEXP_ADV wxCalendarEvent : public wxDateEvent { friend class wxCalendarCtrl; public: wxCalendarEvent() { Init(); } - wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type); + inline wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type); void SetWeekDay(const wxDateTime::WeekDay wd) { m_wday = wd; } wxDateTime::WeekDay GetWeekDay() const { return m_wday; } @@ -213,12 +213,18 @@ END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&); -#define EVT_CALENDAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DOUBLECLICKED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_SEL_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_DAY(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DAY_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_MONTH(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_MONTH_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_YEAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_YEAR_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_WEEKDAY_CLICKED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), +#define wxCalendarEventHandler(func) \ + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func) + +#define wx__DECLARE_CALEVT(evt, id, fn) \ + wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn)) + +#define EVT_CALENDAR(id, fn) wx__DECLARE_CALEVT(DOUBLECLICKED, id, fn) +#define EVT_CALENDAR_SEL_CHANGED(id, fn) wx__DECLARE_CALEVT(SEL_CHANGED, id, fn) +#define EVT_CALENDAR_DAY(id, fn) wx__DECLARE_CALEVT(DAY_CHANGED, id, fn) +#define EVT_CALENDAR_MONTH(id, fn) wx__DECLARE_CALEVT(MONTH_CHANGED, id, fn) +#define EVT_CALENDAR_YEAR(id, fn) wx__DECLARE_CALEVT(YEAR_CHANGED, id, fn) +#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) wx__DECLARE_CALEVT(WEEKDAY_CLICKED, id, fn) #endif // wxUSE_CALENDARCTRL