void OnCalendar(wxCalendarEvent& event);
void OnCalendarWeekDayClick(wxCalendarEvent& event);
+ void OnCalendarWeekClick(wxCalendarEvent& event);
void OnCalendarChange(wxCalendarEvent& event);
void OnCalMonthChange(wxCalendarEvent& event);
EVT_CALENDAR_PAGE_CHANGED(Calendar_CalCtrl, MyPanel::OnCalMonthChange)
EVT_CALENDAR_SEL_CHANGED(Calendar_CalCtrl, MyPanel::OnCalendarChange)
EVT_CALENDAR_WEEKDAY_CLICKED(Calendar_CalCtrl, MyPanel::OnCalendarWeekDayClick)
+ EVT_CALENDAR_WEEK_CLICKED(Calendar_CalCtrl, MyPanel::OnCalendarWeekClick)
END_EVENT_TABLE()
#if wxUSE_DATEPICKCTRL
#ifndef __WXWINCE__
,wxPoint(50, 50), wxSize(450, 340)
#endif
- );
+ );
frame->Show(true);
wxDateTime::GetWeekDayName(event.GetWeekDay()).c_str());
}
+void MyPanel::OnCalendarWeekClick(wxCalendarEvent& event)
+{
+ wxLogMessage(wxT("Clicked on week %d"), event.GetDate().GetWeekOfYear());
+}
+
wxCalendarCtrlBase *MyPanel::DoCreateCalendar(const wxDateTime& dt, long style)
{
wxCalendarCtrlBase *calendar;
calendar->Connect(wxEVT_RIGHT_DOWN,
wxMouseEventHandler(MyFrame::OnCalRClick),
NULL,
- wxGetTopLevelParent(this));
+ ( MyFrame * )wxGetTopLevelParent(this));
return calendar;
}
else
style &= ~flag;
- if ( flag == wxCAL_SEQUENTIAL_MONTH_SELECTION
+ if ( flag == wxCAL_SEQUENTIAL_MONTH_SELECTION
|| flag == wxCAL_SHOW_WEEK_NUMBERS)
{
// changing this style requires recreating the control