]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/calctrl.cpp
Added wxTB_NODIVIDER and wxTB_NOALIGN so native Windows toolbar can
[wxWidgets.git] / src / generic / calctrl.cpp
index 8813954b6424d110978672e64bad7b68491b3044..9c70985528f3f19382140d55207d802e869ef042 100644 (file)
@@ -121,7 +121,7 @@ wxMonthComboBox::wxMonthComboBox(wxCalendarCtrl *cal)
                             wxDefaultPosition,
                             wxDefaultSize,
                             0, NULL,
-                            wxCB_READONLY)
+                            wxCB_READONLY | wxCLIP_SIBLINGS)
 {
     m_cal = cal;
 
@@ -140,7 +140,7 @@ wxYearSpinCtrl::wxYearSpinCtrl(wxCalendarCtrl *cal)
                            cal->GetDate().Format(_T("%Y")),
                            wxDefaultPosition,
                            wxDefaultSize,
-                           wxSP_ARROW_KEYS,
+                           wxSP_ARROW_KEYS | wxCLIP_SIBLINGS,
                            -4300, 10000, cal->GetDate().GetYear())
 {
     m_cal = cal;
@@ -169,9 +169,8 @@ void wxCalendarCtrl::Init()
         m_attrs[n] = NULL;
     }
 
-    wxSystemSettings ss;
-    m_colHighlightFg = ss.GetSystemColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
-    m_colHighlightBg = ss.GetSystemColour(wxSYS_COLOUR_HIGHLIGHT);
+    m_colHighlightFg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+    m_colHighlightBg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
 
     m_colHolidayFg = *wxRED;
     // don't set m_colHolidayBg - by default, same as our bg colour
@@ -189,7 +188,8 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
                             const wxString& name)
 {
     if ( !wxControl::Create(parent, id, pos, size,
-                            style | wxWANTS_CHARS, wxDefaultValidator, name) )
+                            style | wxCLIP_CHILDREN | wxWANTS_CHARS,
+                            wxDefaultValidator, name) )
     {
         return FALSE;
     }
@@ -253,6 +253,18 @@ wxCalendarCtrl::~wxCalendarCtrl()
 // forward wxWin functions to subcontrols
 // ----------------------------------------------------------------------------
 
+bool wxCalendarCtrl::Destroy()
+{
+    if( m_staticYear ) m_staticYear->Destroy();
+    if( m_spinYear ) m_spinYear->Destroy();
+    if( m_comboMonth ) m_comboMonth->Destroy();
+    if( m_staticMonth ) m_staticMonth->Destroy();
+
+    m_staticYear = 0; m_spinYear = 0; m_comboMonth = 0; m_staticMonth = 0;
+
+    return wxControl::Destroy();
+}
+
 bool wxCalendarCtrl::Show(bool show)
 {
     if ( !wxControl::Show(show) )