1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCalendarCtrl sample
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx/wx.h".
21 #include "wx/wxprec.h"
27 // for all others, include the necessary headers
33 #include "wx/stattext.h"
35 #include "wx/layout.h"
36 #include "wx/msgdlg.h"
38 #include "wx/button.h"
40 #include "wx/textctrl.h"
41 #include "wx/settings.h"
44 #include "wx/calctrl.h"
46 #if wxUSE_DATEPICKCTRL
47 #include "wx/datectrl.h"
48 #if wxUSE_DATEPICKCTRL_GENERIC
49 #include "wx/generic/datectrl.h"
50 #endif // wxUSE_DATEPICKCTRL_GENERIC
51 #endif // wxUSE_DATEPICKCTRL
53 #include "../sample.xpm"
55 // ----------------------------------------------------------------------------
57 // ----------------------------------------------------------------------------
59 // Define a new application type, each program should derive a class from wxApp
60 class MyApp
: public wxApp
63 // override base class virtuals
64 // ----------------------------
66 // this one is called on application startup and is a good place for the app
67 // initialization (doing it here and not in the ctor allows to have an error
68 // return: if OnInit() returns false, the application terminates)
69 virtual bool OnInit();
72 class MyPanel
: public wxPanel
75 MyPanel(wxFrame
*frame
);
77 void OnCalendar(wxCalendarEvent
& event
);
78 void OnCalendarWeekDayClick(wxCalendarEvent
& event
);
79 void OnCalendarChange(wxCalendarEvent
& event
);
80 void OnCalMonthChange(wxCalendarEvent
& event
);
81 void OnCalYearChange(wxCalendarEvent
& event
);
83 wxCalendarCtrl
*GetCal() const { return m_calendar
; }
85 // turn on/off the specified style bit on the calendar control
86 void ToggleCalStyle(bool on
, int style
);
88 void HighlightSpecial(bool on
);
94 wxCalendarCtrl
*m_calendar
;
101 // Define a new frame type: this is going to be our main frame
102 class MyFrame
: public wxFrame
106 MyFrame(const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
);
108 // event handlers (these functions should _not_ be virtual)
109 void OnQuit(wxCommandEvent
& event
);
110 void OnAbout(wxCommandEvent
& event
);
112 #if wxUSE_DATEPICKCTRL
113 void OnAskDate(wxCommandEvent
& event
);
115 void OnUpdateUIStartWithNone(wxUpdateUIEvent
& event
);
116 #endif // wxUSE_DATEPICKCTRL
118 void OnCalMonday(wxCommandEvent
& event
);
119 void OnCalHolidays(wxCommandEvent
& event
);
120 void OnCalSpecial(wxCommandEvent
& event
);
122 void OnCalAllowMonth(wxCommandEvent
& event
);
123 void OnCalAllowYear(wxCommandEvent
& event
);
125 void OnCalSeqMonth(wxCommandEvent
& event
);
126 void OnCalShowSurroundingWeeks(wxCommandEvent
& event
);
128 void OnSetDate(wxCommandEvent
& event
);
129 void OnToday(wxCommandEvent
& event
);
131 void OnCalToggleResizable(wxCommandEvent
& event
);
133 void OnAllowYearUpdate(wxUpdateUIEvent
& event
);
138 // any class wishing to process wxWidgets events must use this macro
139 DECLARE_EVENT_TABLE()
142 #if wxUSE_DATEPICKCTRL
144 // Define a simple modal dialog which asks the user for a date
145 class MyDialog
: public wxDialog
148 MyDialog(wxWindow
*parent
, const wxDateTime
& dt
, int dtpStyle
);
150 wxDateTime
GetDate() const { return m_datePicker
->GetValue(); }
153 void OnDateChange(wxDateEvent
& event
);
156 wxDatePickerCtrlBase
*m_datePicker
;
160 DECLARE_EVENT_TABLE()
163 #endif // wxUSE_DATEPICKCTRL
165 // ----------------------------------------------------------------------------
167 // ----------------------------------------------------------------------------
169 // IDs for the controls and the menu commands
173 Calendar_File_About
= wxID_ABOUT
,
174 Calendar_File_Quit
= wxID_EXIT
,
175 Calendar_Cal_Monday
= 200,
176 Calendar_Cal_Holidays
,
177 Calendar_Cal_Special
,
180 Calendar_Cal_SeqMonth
,
181 Calendar_Cal_SurroundWeeks
,
182 Calendar_Cal_SetDate
,
184 Calendar_Cal_Resizable
,
185 #if wxUSE_DATEPICKCTRL
186 Calendar_DatePicker_AskDate
= 300,
187 Calendar_DatePicker_ShowCentury
,
188 Calendar_DatePicker_DropDown
,
189 Calendar_DatePicker_AllowNone
,
190 Calendar_DatePicker_StartWithNone
,
191 #if wxUSE_DATEPICKCTRL_GENERIC
192 Calendar_DatePicker_Generic
,
193 #endif // wxUSE_DATEPICKCTRL_GENERIC
194 #endif // wxUSE_DATEPICKCTRL
195 Calendar_CalCtrl
= 1000
198 // ----------------------------------------------------------------------------
199 // event tables and other macros for wxWidgets
200 // ----------------------------------------------------------------------------
202 // the event tables connect the wxWidgets events with the functions (event
203 // handlers) which process them. It can be also done at run-time, but for the
204 // simple menu events like this the static method is much simpler.
205 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
206 EVT_MENU(Calendar_File_Quit
, MyFrame::OnQuit
)
207 EVT_MENU(Calendar_File_About
, MyFrame::OnAbout
)
209 #if wxUSE_DATEPICKCTRL
210 EVT_MENU(Calendar_DatePicker_AskDate
, MyFrame::OnAskDate
)
212 EVT_UPDATE_UI(Calendar_DatePicker_StartWithNone
,
213 MyFrame::OnUpdateUIStartWithNone
)
214 #endif // wxUSE_DATEPICKCTRL
216 EVT_MENU(Calendar_Cal_Monday
, MyFrame::OnCalMonday
)
217 EVT_MENU(Calendar_Cal_Holidays
, MyFrame::OnCalHolidays
)
218 EVT_MENU(Calendar_Cal_Special
, MyFrame::OnCalSpecial
)
220 EVT_MENU(Calendar_Cal_Month
, MyFrame::OnCalAllowMonth
)
221 EVT_MENU(Calendar_Cal_Year
, MyFrame::OnCalAllowYear
)
223 EVT_MENU(Calendar_Cal_SeqMonth
, MyFrame::OnCalSeqMonth
)
224 EVT_MENU(Calendar_Cal_SurroundWeeks
, MyFrame::OnCalShowSurroundingWeeks
)
226 EVT_MENU(Calendar_Cal_SetDate
, MyFrame::OnSetDate
)
227 EVT_MENU(Calendar_Cal_Today
, MyFrame::OnToday
)
229 EVT_MENU(Calendar_Cal_Resizable
, MyFrame::OnCalToggleResizable
)
232 EVT_UPDATE_UI(Calendar_Cal_Year
, MyFrame::OnAllowYearUpdate
)
235 BEGIN_EVENT_TABLE(MyPanel
, wxPanel
)
236 EVT_CALENDAR (Calendar_CalCtrl
, MyPanel::OnCalendar
)
237 EVT_CALENDAR_MONTH (Calendar_CalCtrl
, MyPanel::OnCalMonthChange
)
238 EVT_CALENDAR_YEAR (Calendar_CalCtrl
, MyPanel::OnCalYearChange
)
239 EVT_CALENDAR_SEL_CHANGED(Calendar_CalCtrl
, MyPanel::OnCalendarChange
)
240 EVT_CALENDAR_WEEKDAY_CLICKED(Calendar_CalCtrl
, MyPanel::OnCalendarWeekDayClick
)
243 #if wxUSE_DATEPICKCTRL
245 BEGIN_EVENT_TABLE(MyDialog
, wxDialog
)
246 EVT_DATE_CHANGED(wxID_ANY
, MyDialog::OnDateChange
)
249 #endif // wxUSE_DATEPICKCTRL
251 // Create a new application object: this macro will allow wxWidgets to create
252 // the application object during program execution (it's better than using a
253 // static object for many reasons) and also declares the accessor function
254 // wxGetApp() which will return the reference of the right type (i.e. MyApp and
258 // ============================================================================
260 // ============================================================================
262 // ----------------------------------------------------------------------------
263 // the application class
264 // ----------------------------------------------------------------------------
266 // `Main program' equivalent: the program execution "starts" here
269 if ( !wxApp::OnInit() )
272 // Create the main application window
273 MyFrame
*frame
= new MyFrame(_T("Calendar wxWidgets sample")
275 ,wxPoint(50, 50), wxSize(450, 340)
281 // success: wxApp::OnRun() will be called which will enter the main message
282 // loop and the application will run. If we returned false here, the
283 // application would exit immediately.
287 // ----------------------------------------------------------------------------
289 // ----------------------------------------------------------------------------
292 MyFrame::MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
)
293 : wxFrame((wxFrame
*)NULL
, wxID_ANY
, title
, pos
, size
)
295 // set the frame icon
296 SetIcon(wxIcon(sample_xpm
));
299 wxMenu
*menuFile
= new wxMenu
;
300 menuFile
->Append(Calendar_File_About
, _T("&About...\tCtrl-A"), _T("Show about dialog"));
301 menuFile
->AppendSeparator();
302 menuFile
->Append(Calendar_File_Quit
, _T("E&xit\tAlt-X"), _T("Quit this program"));
304 wxMenu
*menuCal
= new wxMenu
;
305 menuCal
->Append(Calendar_Cal_Monday
,
306 _T("Monday &first weekday\tCtrl-F"),
307 _T("Toggle between Mon and Sun as the first week day"),
309 menuCal
->Append(Calendar_Cal_Holidays
, _T("Show &holidays\tCtrl-H"),
310 _T("Toggle highlighting the holidays"),
312 menuCal
->Append(Calendar_Cal_Special
, _T("Highlight &special dates\tCtrl-S"),
313 _T("Test custom highlighting"),
315 menuCal
->Append(Calendar_Cal_SurroundWeeks
,
316 _T("Show s&urrounding weeks\tCtrl-W"),
317 _T("Show the neighbouring weeks in the prev/next month"),
319 menuCal
->AppendSeparator();
320 menuCal
->Append(Calendar_Cal_SeqMonth
,
321 _T("To&ggle month selector style\tCtrl-G"),
322 _T("Use another style for the calendar controls"),
324 menuCal
->Append(Calendar_Cal_Month
, _T("&Month can be changed\tCtrl-M"),
325 _T("Allow changing the month in the calendar"),
327 menuCal
->Append(Calendar_Cal_Year
, _T("&Year can be changed\tCtrl-Y"),
328 _T("Allow changing the year in the calendar"),
330 menuCal
->AppendSeparator();
331 menuCal
->Append(Calendar_Cal_SetDate
, _T("Call &SetDate(2005-12-24)"), _T("Set date to 2005-12-24."));
332 menuCal
->Append(Calendar_Cal_Today
, _T("Call &Today()"), _T("Set the current date."));
333 menuCal
->AppendSeparator();
334 menuCal
->AppendCheckItem(Calendar_Cal_Resizable
, _T("Make &resizable\tCtrl-R"));
336 #if wxUSE_DATEPICKCTRL
337 wxMenu
*menuDate
= new wxMenu
;
338 menuDate
->AppendCheckItem(Calendar_DatePicker_ShowCentury
,
339 _T("Al&ways show century"));
340 menuDate
->AppendCheckItem(Calendar_DatePicker_DropDown
,
341 _T("Use &drop down control"));
342 menuDate
->AppendCheckItem(Calendar_DatePicker_AllowNone
,
343 _T("Allow &no date"));
344 menuDate
->AppendCheckItem(Calendar_DatePicker_StartWithNone
,
345 _T("Start &with no date"));
346 #if wxUSE_DATEPICKCTRL_GENERIC
347 menuDate
->AppendCheckItem(Calendar_DatePicker_Generic
,
348 _T("Use &generic version of the control"));
349 #endif // wxUSE_DATEPICKCTRL_GENERIC
350 menuDate
->AppendSeparator();
351 menuDate
->Append(Calendar_DatePicker_AskDate
, _T("&Choose date...\tCtrl-D"), _T("Show dialog with wxDatePickerCtrl"));
352 #endif // wxUSE_DATEPICKCTRL
354 // now append the freshly created menu to the menu bar...
355 wxMenuBar
*menuBar
= new wxMenuBar
;
356 menuBar
->Append(menuFile
, _T("&File"));
357 menuBar
->Append(menuCal
, _T("&Calendar"));
358 #if wxUSE_DATEPICKCTRL
359 menuBar
->Append(menuDate
, _T("&Date picker"));
360 #endif // wxUSE_DATEPICKCTRL
362 menuBar
->Check(Calendar_Cal_Monday
, true);
363 menuBar
->Check(Calendar_Cal_Holidays
, true);
364 menuBar
->Check(Calendar_Cal_Month
, true);
365 menuBar
->Check(Calendar_Cal_Year
, true);
367 #if wxUSE_DATEPICKCTRL
368 menuBar
->Check(Calendar_DatePicker_ShowCentury
, true);
369 #endif // wxUSE_DATEPICKCTRL
371 // ... and attach this menu bar to the frame
374 m_panel
= new MyPanel(this);
377 // create a status bar just for fun (by default with 1 pane only)
379 SetStatusText(_T("Welcome to wxWidgets!"));
380 #endif // wxUSE_STATUSBAR
383 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
385 // true is to force the frame to close
389 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
391 wxMessageBox(_T("wxCalendarCtrl sample\n(c) 2000 Vadim Zeitlin"),
392 _T("About Calendar"), wxOK
| wxICON_INFORMATION
, this);
395 void MyFrame::OnCalMonday(wxCommandEvent
& event
)
397 bool enable
= GetMenuBar()->IsChecked(event
.GetId());
399 m_panel
->ToggleCalStyle(enable
, wxCAL_MONDAY_FIRST
);
402 void MyFrame::OnCalHolidays(wxCommandEvent
& event
)
404 bool enable
= GetMenuBar()->IsChecked(event
.GetId());
406 m_panel
->GetCal()->EnableHolidayDisplay(enable
);
409 void MyFrame::OnCalSpecial(wxCommandEvent
& event
)
411 m_panel
->HighlightSpecial(GetMenuBar()->IsChecked(event
.GetId()));
414 void MyFrame::OnCalAllowMonth(wxCommandEvent
& event
)
416 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
418 m_panel
->GetCal()->EnableMonthChange(allow
);
421 void MyFrame::OnCalAllowYear(wxCommandEvent
& event
)
423 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
425 m_panel
->GetCal()->EnableYearChange(allow
);
428 void MyFrame::OnCalSeqMonth(wxCommandEvent
& event
)
430 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
432 m_panel
->ToggleCalStyle(allow
, wxCAL_SEQUENTIAL_MONTH_SELECTION
);
435 void MyFrame::OnCalShowSurroundingWeeks(wxCommandEvent
& event
)
437 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
439 m_panel
->ToggleCalStyle(allow
, wxCAL_SHOW_SURROUNDING_WEEKS
);
442 void MyFrame::OnAllowYearUpdate(wxUpdateUIEvent
& event
)
444 event
.Enable( GetMenuBar()->IsChecked(Calendar_Cal_Month
));
447 void MyFrame::OnSetDate(wxCommandEvent
&WXUNUSED(event
))
452 void MyFrame::OnToday(wxCommandEvent
&WXUNUSED(event
))
457 void MyFrame::OnCalToggleResizable(wxCommandEvent
& event
)
459 wxSizer
* const sizer
= m_panel
->GetSizer();
460 wxSizerItem
* const item
= sizer
->GetItem(m_panel
->GetCal());
461 if ( event
.IsChecked() )
463 item
->SetProportion(1);
464 item
->SetFlag(wxEXPAND
);
466 else // not resizable
468 item
->SetProportion(0);
469 item
->SetFlag(wxALIGN_CENTER
);
475 #if wxUSE_DATEPICKCTRL
477 void MyFrame::OnUpdateUIStartWithNone(wxUpdateUIEvent
& event
)
479 // it only makes sense to start with invalid date if we can have no date
480 event
.Enable( GetMenuBar()->IsChecked(Calendar_DatePicker_AllowNone
) );
483 void MyFrame::OnAskDate(wxCommandEvent
& WXUNUSED(event
))
485 wxDateTime dt
= m_panel
->GetCal()->GetDate();
487 int style
= wxDP_DEFAULT
;
488 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_ShowCentury
) )
489 style
|= wxDP_SHOWCENTURY
;
490 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_DropDown
) )
491 style
|= wxDP_DROPDOWN
;
492 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_AllowNone
) )
494 style
|= wxDP_ALLOWNONE
;
496 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_StartWithNone
) )
497 dt
= wxDefaultDateTime
;
500 MyDialog
dlg(this, dt
, style
);
501 if ( dlg
.ShowModal() == wxID_OK
)
506 const wxDateTime today
= wxDateTime::Today();
508 if ( dt
.GetDay() == today
.GetDay() &&
509 dt
.GetMonth() == today
.GetMonth() )
511 wxMessageBox(_T("Happy birthday!"), _T("Calendar Sample"));
514 m_panel
->GetCal()->SetDate(dt
);
516 wxLogStatus(_T("Changed the date to your input"));
520 wxLogStatus(_T("No date entered"));
525 #endif // wxUSE_DATEPICKCTRL
527 // ----------------------------------------------------------------------------
529 // ----------------------------------------------------------------------------
531 MyPanel::MyPanel(wxFrame
*frame
)
532 : wxPanel(frame
, wxID_ANY
)
535 date
.Printf(wxT("Selected date: %s"),
536 wxDateTime::Today().FormatISODate().c_str());
537 m_date
= new wxStaticText(this, wxID_ANY
, date
);
538 m_calendar
= new wxCalendarCtrl(this, Calendar_CalCtrl
,
543 wxCAL_SHOW_HOLIDAYS
|
546 // adjust to vertical/horizontal display, check mostly dedicated to WinCE
547 bool horizontal
= ( wxSystemSettings::GetMetric(wxSYS_SCREEN_X
) > wxSystemSettings::GetMetric(wxSYS_SCREEN_Y
) );
548 m_sizer
= new wxBoxSizer( horizontal
? wxHORIZONTAL
: wxVERTICAL
);
550 m_sizer
->Add(m_date
, 0, wxALIGN_CENTER
| wxALL
, 10 );
551 m_sizer
->Add(m_calendar
, 0, wxALIGN_CENTER
| wxALIGN_LEFT
);
554 m_sizer
->SetSizeHints( this );
557 void MyPanel::OnCalendar(wxCalendarEvent
& event
)
559 wxLogMessage(wxT("Selected %s from calendar"),
560 event
.GetDate().FormatISODate().c_str());
563 void MyPanel::OnCalendarChange(wxCalendarEvent
& event
)
566 s
.Printf(wxT("Selected date: %s"), event
.GetDate().FormatISODate().c_str());
571 void MyPanel::OnCalMonthChange(wxCalendarEvent
& WXUNUSED(event
))
573 wxLogStatus(wxT("Calendar month changed"));
576 void MyPanel::OnCalYearChange(wxCalendarEvent
& WXUNUSED(event
))
578 wxLogStatus(wxT("Calendar year changed"));
581 void MyPanel::OnCalendarWeekDayClick(wxCalendarEvent
& event
)
583 wxLogMessage(wxT("Clicked on %s"),
584 wxDateTime::GetWeekDayName(event
.GetWeekDay()).c_str());
587 void MyPanel::ToggleCalStyle(bool on
, int flag
)
589 long style
= m_calendar
->GetWindowStyle();
595 if ( flag
== wxCAL_SEQUENTIAL_MONTH_SELECTION
)
597 // changing this style requires recreating the control
598 wxCalendarCtrl
*calendar
= new wxCalendarCtrl(this, Calendar_CalCtrl
,
599 m_calendar
->GetDate(),
603 m_sizer
->Replace(m_calendar
, calendar
);
605 m_calendar
= calendar
;
609 else // just changing the style is enough
611 m_calendar
->SetWindowStyle(style
);
613 m_calendar
->Refresh();
617 void MyPanel::HighlightSpecial(bool on
)
622 *attrRedCircle
= new wxCalendarDateAttr(wxCAL_BORDER_ROUND
, *wxRED
),
623 *attrGreenSquare
= new wxCalendarDateAttr(wxCAL_BORDER_SQUARE
, *wxGREEN
),
624 *attrHeaderLike
= new wxCalendarDateAttr(*wxBLUE
, *wxLIGHT_GREY
);
626 m_calendar
->SetAttr(17, attrRedCircle
);
627 m_calendar
->SetAttr(29, attrGreenSquare
);
628 m_calendar
->SetAttr(13, attrHeaderLike
);
632 m_calendar
->ResetAttr(17);
633 m_calendar
->ResetAttr(29);
634 m_calendar
->ResetAttr(13);
637 m_calendar
->Refresh();
640 void MyPanel::SetDate()
642 wxDateTime
date(24, wxDateTime::Dec
, 2005, 23, 59, 59);
643 m_calendar
->SetDate(date
);
646 void MyPanel::Today()
648 m_calendar
->SetDate(wxDateTime::Today());
651 // ----------------------------------------------------------------------------
653 // ----------------------------------------------------------------------------
655 #if wxUSE_DATEPICKCTRL
657 MyDialog::MyDialog(wxWindow
*parent
, const wxDateTime
& dt
, int dtpStyle
)
658 : wxDialog(parent
, wxID_ANY
, wxString(_T("Calendar: Choose a date")))
660 wxStdDialogButtonSizer
*sizerBtns
= new wxStdDialogButtonSizer
;
661 sizerBtns
->AddButton(new wxButton(this, wxID_OK
));
662 sizerBtns
->AddButton(new wxButton(this, wxID_CANCEL
));
663 sizerBtns
->Realize();
665 wxSizer
*sizerText
= new wxBoxSizer(wxHORIZONTAL
);
666 sizerText
->Add(new wxStaticText(this, wxID_ANY
, _T("Date in ISO format: ")),
667 wxSizerFlags().Border().Align(wxALIGN_CENTRE_VERTICAL
));
668 m_text
= new wxTextCtrl(this, wxID_ANY
);
669 sizerText
->Add(m_text
, wxSizerFlags().
670 Expand().Border().Align(wxALIGN_CENTRE_VERTICAL
));
672 wxSizer
*sizerTop
= new wxBoxSizer(wxVERTICAL
);
673 sizerTop
->Add(new wxStaticText
676 _T("Enter your birthday date (not before 20th century):")
678 wxSizerFlags().Border());
680 #if wxUSE_DATEPICKCTRL_GENERIC
681 wxFrame
*frame
= (wxFrame
*)wxGetTopLevelParent(parent
);
682 if ( frame
&& frame
->GetMenuBar()->IsChecked(Calendar_DatePicker_Generic
) )
683 m_datePicker
= new wxDatePickerCtrlGeneric(this, wxID_ANY
, dt
,
688 #endif // wxUSE_DATEPICKCTRL_GENERIC
689 m_datePicker
= new wxDatePickerCtrl(this, wxID_ANY
, dt
,
690 wxDefaultPosition
, wxDefaultSize
,
692 m_datePicker
->SetRange(wxDateTime(1, wxDateTime::Jan
, 1900),
694 sizerTop
->Add(m_datePicker
, wxSizerFlags().Expand().Border());
696 sizerTop
->AddStretchSpacer(1);
697 sizerTop
->Add(sizerText
);
699 sizerTop
->Add(sizerBtns
, wxSizerFlags().Centre().Border());
701 SetSizerAndFit(sizerTop
);
705 void MyDialog::OnDateChange(wxDateEvent
& event
)
707 const wxDateTime dt
= event
.GetDate();
709 m_text
->SetValue(dt
.FormatISODate());
711 m_text
->SetValue(wxEmptyString
);
714 #endif // wxUSE_DATEPICKCTRL