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:
Vadim Zeitlin
2008-04-04 16:26:39 +00:00
parent b3ed70208b
commit 82c6027b47
3 changed files with 83 additions and 20 deletions

View File

@@ -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)