X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a5cf7942c9265e71bea3e40f9d9d6420d073fbba..c29c95fe24973b94fd724db767193171ca7c513d:/samples/calendar/calendar.cpp diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 493f42850d..73cf2adf12 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -280,7 +280,6 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) #ifdef __WXGTK20__ EVT_UPDATE_UI(Calendar_Cal_Monday, MyFrame::OnUpdateUIGenericOnly) EVT_UPDATE_UI(Calendar_Cal_Holidays, MyFrame::OnUpdateUIGenericOnly) - EVT_UPDATE_UI(Calendar_Cal_LimitDates, MyFrame::OnUpdateUIGenericOnly) #endif EVT_UPDATE_UI(Calendar_Cal_Special, MyFrame::OnUpdateUIGenericOnly) EVT_UPDATE_UI(Calendar_Cal_SurroundWeeks, MyFrame::OnUpdateUIGenericOnly) @@ -347,7 +346,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size) { // set the frame icon - SetIcon(wxIcon(sample_xpm)); + SetIcon(wxICON(sample)); // create a menu bar wxMenu *menuFile = new wxMenu; @@ -799,6 +798,18 @@ void MyPanel::LimitDateRange(bool on) if ( m_calendar->SetDateRange(today - diff, today + diff) ) { wxLogStatus("Date range limited to 3 months around today."); + wxDateTime firstValidDate; + wxDateTime lastValidDate; + if ( m_calendar->GetDateRange(&firstValidDate, &lastValidDate) ) + { + wxLogMessage("First valid date: %s, last valid date: %s", + firstValidDate.FormatISODate(), + lastValidDate.FormatISODate()); + } + else + { + wxLogWarning("Failed to get back the valid dates range."); + } } else {