UpdateMarks();
+ Connect(wxEVT_LEFT_DOWN,
+ wxMouseEventHandler(wxCalendarCtrl::MSWOnClick));
Connect(wxEVT_LEFT_DCLICK,
wxMouseEventHandler(wxCalendarCtrl::MSWOnDoubleClick));
{
MONTHDAYSTATE states[3];
const int nMonths = MonthCal_GetMonthRange(GetHwnd(), GMR_DAYSTATE, NULL);
- wxCHECK_RET( nMonths <= WXSIZEOF(states), "unexpected months range" );
+ wxCHECK_RET( nMonths <= (int)WXSIZEOF(states), "unexpected months range" );
for ( int i = 0; i < nMonths; i++ )
states[i] = m_marks;
event.Skip();
}
+void wxCalendarCtrl::MSWOnClick(wxMouseEvent& event)
+{
+ // for some reason, the control doesn't get focus on its own when the user
+ // clicks in it
+ SetFocus();
+
+ event.Skip();
+}
+
#endif // wxUSE_CALENDARCTRL