]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/calendar/calendar.cpp
Change version to 3.0.0.
[wxWidgets.git] / samples / calendar / calendar.cpp
index 822e097994adce7d5c7d5bf9e0aaf80e6868f706..9a5466b90b59119be2d3174a707b8994e3886373 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     02.01.00
-// RCS-ID:      $Id$
 // Copyright:   (c) Vadim Zeitlin
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -386,7 +385,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     wxMenuBar *menuBar = new wxMenuBar;
 
     wxMenu *menuFile = new wxMenu;
-    menuFile->Append(Calendar_File_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
+    menuFile->Append(Calendar_File_About, wxT("&About\tCtrl-A"), wxT("Show about dialog"));
     menuFile->AppendSeparator();
     menuFile->Append(Calendar_File_ClearLog, wxT("&Clear log\tCtrl-L"));
     menuFile->AppendSeparator();
@@ -914,7 +913,9 @@ MyDateDialog::MyDateDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle)
                                         dtpStyle);
     m_datePicker->SetRange(wxDateTime(1, wxDateTime::Jan, 1900),
                             wxDefaultDateTime);
-    m_dateText = new wxStaticText(this, wxID_ANY, wxString());
+    m_dateText = new wxStaticText(this, wxID_ANY,
+                                  dt.IsValid() ? dt.FormatISODate()
+                                               : wxString());
 
     const wxSizerFlags flags = wxSizerFlags().Centre().Border();
     wxFlexGridSizer* const sizerMain = new wxFlexGridSizer(2);
@@ -925,14 +926,9 @@ MyDateDialog::MyDateDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle)
                    flags);
     sizerMain->Add(m_dateText, flags);
 
-    wxStdDialogButtonSizer *sizerBtns = new wxStdDialogButtonSizer;
-    sizerBtns->AddButton(new wxButton(this, wxID_OK));
-    sizerBtns->AddButton(new wxButton(this, wxID_CANCEL));
-    sizerBtns->Realize();
-
     wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
     sizerTop->Add(sizerMain, flags);
-    sizerTop->Add(sizerBtns, flags);
+    sizerTop->Add(CreateStdDialogButtonSizer(wxOK | wxCANCEL), flags);
 
     SetSizerAndFit(sizerTop);
 }
@@ -968,7 +964,8 @@ MyTimeDialog::MyTimeDialog(wxWindow *parent)
     else
 #endif // wxUSE_TIMEPICKCTRL_GENERIC
     m_timePicker = new wxTimePickerCtrl(this, wxID_ANY);
-    m_timeText = new wxStaticText(this, wxID_ANY, wxString());
+    m_timeText = new wxStaticText(this, wxID_ANY,
+                                  m_timePicker->GetValue().FormatISOTime());
 
     const wxSizerFlags flags = wxSizerFlags().Centre().Border();
     wxFlexGridSizer* const sizerMain = new wxFlexGridSizer(2);
@@ -979,14 +976,9 @@ MyTimeDialog::MyTimeDialog(wxWindow *parent)
                    flags);
     sizerMain->Add(m_timeText, flags);
 
-    wxStdDialogButtonSizer* sizerBtns = new wxStdDialogButtonSizer;
-    sizerBtns->AddButton(new wxButton(this, wxID_OK));
-    sizerBtns->AddButton(new wxButton(this, wxID_CANCEL));
-    sizerBtns->Realize();
-
     wxSizer* sizerTop = new wxBoxSizer(wxVERTICAL);
     sizerTop->Add(sizerMain, flags);
-    sizerTop->Add(sizerBtns, flags);
+    sizerTop->Add(CreateStdDialogButtonSizer(wxOK | wxCANCEL), flags);
 
     SetSizerAndFit(sizerTop);
 }