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 // Create the main application window
270 MyFrame
*frame
= new MyFrame(_T("Calendar wxWidgets sample")
272 ,wxPoint(50, 50), wxSize(450, 340)
278 // success: wxApp::OnRun() will be called which will enter the main message
279 // loop and the application will run. If we returned false here, the
280 // application would exit immediately.
284 // ----------------------------------------------------------------------------
286 // ----------------------------------------------------------------------------
289 MyFrame::MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
)
290 : wxFrame((wxFrame
*)NULL
, wxID_ANY
, title
, pos
, size
)
292 // set the frame icon
293 SetIcon(wxIcon(sample_xpm
));
296 wxMenu
*menuFile
= new wxMenu
;
297 menuFile
->Append(Calendar_File_About
, _T("&About...\tCtrl-A"), _T("Show about dialog"));
298 menuFile
->AppendSeparator();
299 menuFile
->Append(Calendar_File_Quit
, _T("E&xit\tAlt-X"), _T("Quit this program"));
301 wxMenu
*menuCal
= new wxMenu
;
302 menuCal
->Append(Calendar_Cal_Monday
,
303 _T("Monday &first weekday\tCtrl-F"),
304 _T("Toggle between Mon and Sun as the first week day"),
306 menuCal
->Append(Calendar_Cal_Holidays
, _T("Show &holidays\tCtrl-H"),
307 _T("Toggle highlighting the holidays"),
309 menuCal
->Append(Calendar_Cal_Special
, _T("Highlight &special dates\tCtrl-S"),
310 _T("Test custom highlighting"),
312 menuCal
->Append(Calendar_Cal_SurroundWeeks
,
313 _T("Show s&urrounding weeks\tCtrl-W"),
314 _T("Show the neighbouring weeks in the prev/next month"),
316 menuCal
->AppendSeparator();
317 menuCal
->Append(Calendar_Cal_SeqMonth
,
318 _T("To&ggle month selector style\tCtrl-G"),
319 _T("Use another style for the calendar controls"),
321 menuCal
->Append(Calendar_Cal_Month
, _T("&Month can be changed\tCtrl-M"),
322 _T("Allow changing the month in the calendar"),
324 menuCal
->Append(Calendar_Cal_Year
, _T("&Year can be changed\tCtrl-Y"),
325 _T("Allow changing the year in the calendar"),
327 menuCal
->AppendSeparator();
328 menuCal
->Append(Calendar_Cal_SetDate
, _T("Call &SetDate(2005-12-24)"), _T("Set date to 2005-12-24."));
329 menuCal
->Append(Calendar_Cal_Today
, _T("Call &Today()"), _T("Set the current date."));
330 menuCal
->AppendSeparator();
331 menuCal
->AppendCheckItem(Calendar_Cal_Resizable
, _T("Make &resizable\tCtrl-R"));
333 #if wxUSE_DATEPICKCTRL
334 wxMenu
*menuDate
= new wxMenu
;
335 menuDate
->AppendCheckItem(Calendar_DatePicker_ShowCentury
,
336 _T("Al&ways show century"));
337 menuDate
->AppendCheckItem(Calendar_DatePicker_DropDown
,
338 _T("Use &drop down control"));
339 menuDate
->AppendCheckItem(Calendar_DatePicker_AllowNone
,
340 _T("Allow &no date"));
341 menuDate
->AppendCheckItem(Calendar_DatePicker_StartWithNone
,
342 _T("Start &with no date"));
343 #if wxUSE_DATEPICKCTRL_GENERIC
344 menuDate
->AppendCheckItem(Calendar_DatePicker_Generic
,
345 _T("Use &generic version of the control"));
346 #endif // wxUSE_DATEPICKCTRL_GENERIC
347 menuDate
->AppendSeparator();
348 menuDate
->Append(Calendar_DatePicker_AskDate
, _T("&Choose date...\tCtrl-D"), _T("Show dialog with wxDatePickerCtrl"));
349 #endif // wxUSE_DATEPICKCTRL
351 // now append the freshly created menu to the menu bar...
352 wxMenuBar
*menuBar
= new wxMenuBar
;
353 menuBar
->Append(menuFile
, _T("&File"));
354 menuBar
->Append(menuCal
, _T("&Calendar"));
355 #if wxUSE_DATEPICKCTRL
356 menuBar
->Append(menuDate
, _T("&Date picker"));
357 #endif // wxUSE_DATEPICKCTRL
359 menuBar
->Check(Calendar_Cal_Monday
, true);
360 menuBar
->Check(Calendar_Cal_Holidays
, true);
361 menuBar
->Check(Calendar_Cal_Month
, true);
362 menuBar
->Check(Calendar_Cal_Year
, true);
364 #if wxUSE_DATEPICKCTRL
365 menuBar
->Check(Calendar_DatePicker_ShowCentury
, true);
366 #endif // wxUSE_DATEPICKCTRL
368 // ... and attach this menu bar to the frame
371 m_panel
= new MyPanel(this);
374 // create a status bar just for fun (by default with 1 pane only)
376 SetStatusText(_T("Welcome to wxWidgets!"));
377 #endif // wxUSE_STATUSBAR
380 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
382 // true is to force the frame to close
386 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
388 wxMessageBox(_T("wxCalendarCtrl sample\n(c) 2000 Vadim Zeitlin"),
389 _T("About Calendar"), wxOK
| wxICON_INFORMATION
, this);
392 void MyFrame::OnCalMonday(wxCommandEvent
& event
)
394 bool enable
= GetMenuBar()->IsChecked(event
.GetId());
396 m_panel
->ToggleCalStyle(enable
, wxCAL_MONDAY_FIRST
);
399 void MyFrame::OnCalHolidays(wxCommandEvent
& event
)
401 bool enable
= GetMenuBar()->IsChecked(event
.GetId());
403 m_panel
->GetCal()->EnableHolidayDisplay(enable
);
406 void MyFrame::OnCalSpecial(wxCommandEvent
& event
)
408 m_panel
->HighlightSpecial(GetMenuBar()->IsChecked(event
.GetId()));
411 void MyFrame::OnCalAllowMonth(wxCommandEvent
& event
)
413 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
415 m_panel
->GetCal()->EnableMonthChange(allow
);
418 void MyFrame::OnCalAllowYear(wxCommandEvent
& event
)
420 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
422 m_panel
->GetCal()->EnableYearChange(allow
);
425 void MyFrame::OnCalSeqMonth(wxCommandEvent
& event
)
427 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
429 m_panel
->ToggleCalStyle(allow
, wxCAL_SEQUENTIAL_MONTH_SELECTION
);
432 void MyFrame::OnCalShowSurroundingWeeks(wxCommandEvent
& event
)
434 bool allow
= GetMenuBar()->IsChecked(event
.GetId());
436 m_panel
->ToggleCalStyle(allow
, wxCAL_SHOW_SURROUNDING_WEEKS
);
439 void MyFrame::OnAllowYearUpdate(wxUpdateUIEvent
& event
)
441 event
.Enable( GetMenuBar()->IsChecked(Calendar_Cal_Month
));
444 void MyFrame::OnSetDate(wxCommandEvent
&WXUNUSED(event
))
449 void MyFrame::OnToday(wxCommandEvent
&WXUNUSED(event
))
454 void MyFrame::OnCalToggleResizable(wxCommandEvent
& event
)
456 wxSizer
* const sizer
= m_panel
->GetSizer();
457 wxSizerItem
* const item
= sizer
->GetItem(m_panel
->GetCal());
458 if ( event
.IsChecked() )
460 item
->SetProportion(1);
461 item
->SetFlag(wxEXPAND
);
463 else // not resizable
465 item
->SetProportion(0);
466 item
->SetFlag(wxALIGN_CENTER
);
472 #if wxUSE_DATEPICKCTRL
474 void MyFrame::OnUpdateUIStartWithNone(wxUpdateUIEvent
& event
)
476 // it only makes sense to start with invalid date if we can have no date
477 event
.Enable( GetMenuBar()->IsChecked(Calendar_DatePicker_AllowNone
) );
480 void MyFrame::OnAskDate(wxCommandEvent
& WXUNUSED(event
))
482 wxDateTime dt
= m_panel
->GetCal()->GetDate();
484 int style
= wxDP_DEFAULT
;
485 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_ShowCentury
) )
486 style
|= wxDP_SHOWCENTURY
;
487 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_DropDown
) )
488 style
|= wxDP_DROPDOWN
;
489 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_AllowNone
) )
491 style
|= wxDP_ALLOWNONE
;
493 if ( GetMenuBar()->IsChecked(Calendar_DatePicker_StartWithNone
) )
494 dt
= wxDefaultDateTime
;
497 MyDialog
dlg(this, dt
, style
);
498 if ( dlg
.ShowModal() == wxID_OK
)
503 const wxDateTime today
= wxDateTime::Today();
505 if ( dt
.GetDay() == today
.GetDay() &&
506 dt
.GetMonth() == today
.GetMonth() )
508 wxMessageBox(_T("Happy birthday!"), _T("Calendar Sample"));
511 m_panel
->GetCal()->SetDate(dt
);
513 wxLogStatus(_T("Changed the date to your input"));
517 wxLogStatus(_T("No date entered"));
522 #endif // wxUSE_DATEPICKCTRL
524 // ----------------------------------------------------------------------------
526 // ----------------------------------------------------------------------------
528 MyPanel::MyPanel(wxFrame
*frame
)
529 : wxPanel(frame
, wxID_ANY
)
532 date
.Printf(wxT("Selected date: %s"),
533 wxDateTime::Today().FormatISODate().c_str());
534 m_date
= new wxStaticText(this, wxID_ANY
, date
);
535 m_calendar
= new wxCalendarCtrl(this, Calendar_CalCtrl
,
540 wxCAL_SHOW_HOLIDAYS
|
543 // adjust to vertical/horizontal display, check mostly dedicated to WinCE
544 bool horizontal
= ( wxSystemSettings::GetMetric(wxSYS_SCREEN_X
) > wxSystemSettings::GetMetric(wxSYS_SCREEN_Y
) );
545 m_sizer
= new wxBoxSizer( horizontal
? wxHORIZONTAL
: wxVERTICAL
);
547 m_sizer
->Add(m_date
, 0, wxALIGN_CENTER
| wxALL
, 10 );
548 m_sizer
->Add(m_calendar
, 0, wxALIGN_CENTER
| wxALIGN_LEFT
);
551 m_sizer
->SetSizeHints( this );
554 void MyPanel::OnCalendar(wxCalendarEvent
& event
)
556 wxLogMessage(wxT("Selected %s from calendar"),
557 event
.GetDate().FormatISODate().c_str());
560 void MyPanel::OnCalendarChange(wxCalendarEvent
& event
)
563 s
.Printf(wxT("Selected date: %s"), event
.GetDate().FormatISODate().c_str());
568 void MyPanel::OnCalMonthChange(wxCalendarEvent
& WXUNUSED(event
))
570 wxLogStatus(wxT("Calendar month changed"));
573 void MyPanel::OnCalYearChange(wxCalendarEvent
& WXUNUSED(event
))
575 wxLogStatus(wxT("Calendar year changed"));
578 void MyPanel::OnCalendarWeekDayClick(wxCalendarEvent
& event
)
580 wxLogMessage(wxT("Clicked on %s"),
581 wxDateTime::GetWeekDayName(event
.GetWeekDay()).c_str());
584 void MyPanel::ToggleCalStyle(bool on
, int flag
)
586 long style
= m_calendar
->GetWindowStyle();
592 if ( flag
== wxCAL_SEQUENTIAL_MONTH_SELECTION
)
594 // changing this style requires recreating the control
595 wxCalendarCtrl
*calendar
= new wxCalendarCtrl(this, Calendar_CalCtrl
,
596 m_calendar
->GetDate(),
600 m_sizer
->Replace(m_calendar
, calendar
);
602 m_calendar
= calendar
;
606 else // just changing the style is enough
608 m_calendar
->SetWindowStyle(style
);
610 m_calendar
->Refresh();
614 void MyPanel::HighlightSpecial(bool on
)
619 *attrRedCircle
= new wxCalendarDateAttr(wxCAL_BORDER_ROUND
, *wxRED
),
620 *attrGreenSquare
= new wxCalendarDateAttr(wxCAL_BORDER_SQUARE
, *wxGREEN
),
621 *attrHeaderLike
= new wxCalendarDateAttr(*wxBLUE
, *wxLIGHT_GREY
);
623 m_calendar
->SetAttr(17, attrRedCircle
);
624 m_calendar
->SetAttr(29, attrGreenSquare
);
625 m_calendar
->SetAttr(13, attrHeaderLike
);
629 m_calendar
->ResetAttr(17);
630 m_calendar
->ResetAttr(29);
631 m_calendar
->ResetAttr(13);
634 m_calendar
->Refresh();
637 void MyPanel::SetDate()
639 wxDateTime
date(24, wxDateTime::Dec
, 2005, 23, 59, 59);
640 m_calendar
->SetDate(date
);
643 void MyPanel::Today()
645 m_calendar
->SetDate(wxDateTime::Today());
648 // ----------------------------------------------------------------------------
650 // ----------------------------------------------------------------------------
652 #if wxUSE_DATEPICKCTRL
654 MyDialog::MyDialog(wxWindow
*parent
, const wxDateTime
& dt
, int dtpStyle
)
655 : wxDialog(parent
, wxID_ANY
, wxString(_T("Calendar: Choose a date")))
657 wxStdDialogButtonSizer
*sizerBtns
= new wxStdDialogButtonSizer
;
658 sizerBtns
->AddButton(new wxButton(this, wxID_OK
));
659 sizerBtns
->AddButton(new wxButton(this, wxID_CANCEL
));
660 sizerBtns
->Realize();
662 wxSizer
*sizerText
= new wxBoxSizer(wxHORIZONTAL
);
663 sizerText
->Add(new wxStaticText(this, wxID_ANY
, _T("Date in ISO format: ")),
664 wxSizerFlags().Border().Align(wxALIGN_CENTRE_VERTICAL
));
665 m_text
= new wxTextCtrl(this, wxID_ANY
);
666 sizerText
->Add(m_text
, wxSizerFlags().
667 Expand().Border().Align(wxALIGN_CENTRE_VERTICAL
));
669 wxSizer
*sizerTop
= new wxBoxSizer(wxVERTICAL
);
670 sizerTop
->Add(new wxStaticText
673 _T("Enter your birthday date (not before 20th century):")
675 wxSizerFlags().Border());
677 #if wxUSE_DATEPICKCTRL_GENERIC
678 wxFrame
*frame
= (wxFrame
*)wxGetTopLevelParent(parent
);
679 if ( frame
&& frame
->GetMenuBar()->IsChecked(Calendar_DatePicker_Generic
) )
680 m_datePicker
= new wxDatePickerCtrlGeneric(this, wxID_ANY
, dt
,
685 #endif // wxUSE_DATEPICKCTRL_GENERIC
686 m_datePicker
= new wxDatePickerCtrl(this, wxID_ANY
, dt
,
687 wxDefaultPosition
, wxDefaultSize
,
689 m_datePicker
->SetRange(wxDateTime(1, wxDateTime::Jan
, 1900),
691 sizerTop
->Add(m_datePicker
, wxSizerFlags().Expand().Border());
693 sizerTop
->AddStretchSpacer(1);
694 sizerTop
->Add(sizerText
);
696 sizerTop
->Add(sizerBtns
, wxSizerFlags().Centre().Border());
698 SetSizerAndFit(sizerTop
);
702 void MyDialog::OnDateChange(wxDateEvent
& event
)
704 const wxDateTime dt
= event
.GetDate();
706 m_text
->SetValue(dt
.FormatISODate());
708 m_text
->SetValue(wxEmptyString
);
711 #endif // wxUSE_DATEPICKCTRL