implemented Mark() in the native MSW version of wxCalendarCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -637,9 +637,15 @@ MyPanel::MyPanel(wxWindow *parent)
|
||||
|
||||
void MyPanel::OnCalendar(wxCalendarEvent& event)
|
||||
{
|
||||
m_calendar->Mark(event.GetDate().GetDay(), true);
|
||||
wxLogMessage(wxT("Selected (and marked) %s from calendar."),
|
||||
event.GetDate().FormatISODate().c_str());
|
||||
// clicking the same date twice unmarks it (convenient for testing)
|
||||
static wxDateTime s_dateLast;
|
||||
const bool mark = !s_dateLast.IsValid() || event.GetDate() != s_dateLast;
|
||||
|
||||
s_dateLast = event.GetDate();
|
||||
|
||||
m_calendar->Mark(event.GetDate().GetDay(), mark);
|
||||
wxLogMessage(wxT("Selected (and %smarked) %s from calendar."),
|
||||
mark ? "" : "un", s_dateLast.FormatISODate().c_str());
|
||||
}
|
||||
|
||||
void MyPanel::OnCalendarChange(wxCalendarEvent& event)
|
||||
|
Reference in New Issue
Block a user