+// ----------------------------------------------------------------------------
+// Create the wxComboBox and wxSpinCtrl
+// ----------------------------------------------------------------------------
+
+void wxCalendarCtrl::CreateMonthComboBox()
+{
+ m_comboMonth = new wxComboBox(GetParent(), wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxDefaultSize,
+ 0, NULL,
+ wxCB_READONLY | wxCLIP_SIBLINGS);
+
+ wxDateTime::Month m;
+ for ( m = wxDateTime::Jan; m < wxDateTime::Inv_Month; wxNextMonth(m) )
+ {
+ m_comboMonth->Append(wxDateTime::GetMonthName(m));
+ }
+
+ m_comboMonth->SetSelection(GetDate().GetMonth());
+ m_comboMonth->SetSize(wxDefaultCoord,
+ wxDefaultCoord,
+ wxDefaultCoord,
+ wxDefaultCoord,
+ wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT);
+
+ m_comboMonth->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED,
+ wxCommandEventHandler(wxCalendarCtrl::OnMonthChange),
+ NULL, this);
+}
+
+void wxCalendarCtrl::CreateYearSpinCtrl()
+{
+ m_spinYear = new wxSpinCtrl(GetParent(), wxID_ANY,
+ GetDate().Format(_T("%Y")),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxSP_ARROW_KEYS | wxCLIP_SIBLINGS,
+ -4300, 10000, GetDate().GetYear());
+
+ m_spinYear->Connect(wxEVT_COMMAND_TEXT_UPDATED,
+ wxCommandEventHandler(wxCalendarCtrl::OnYearTextChange),
+ NULL, this);
+
+ m_spinYear->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED,
+ wxCommandEventHandler(wxCalendarCtrl::OnYearChange),
+ NULL, this);
+}
+