]> git.saurik.com Git - wxWidgets.git/commitdiff
assert if wxCAL_SEQUENTIAL_MONTH_SELECTION style is changed after creation as this...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Nov 2006 15:01:48 +0000 (15:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Nov 2006 15:01:48 +0000 (15:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/calctrl.cpp

index 7648d8917e66406d708cfa6a3c0cc4218023520c..f10b5015ca6b8adb38648b18d4fd987a06e927d8 100644 (file)
@@ -255,6 +255,17 @@ wxCalendarCtrl::~wxCalendarCtrl()
     }
 }
 
+void wxCalendarCtrl::SetWindowStyleFlag(long style)
+{
+    // changing this style doesn't work because the controls are not
+    // created/shown/hidden accordingly
+    wxASSERT_MSG( (style & wxCAL_SEQUENTIAL_MONTH_SELECTION) ==
+                    (m_windowStyle & wxCAL_SEQUENTIAL_MONTH_SELECTION),
+                  _T("wxCAL_SEQUENTIAL_MONTH_SELECTION can't be changed after creation") );
+
+    wxControl::SetWindowStyleFlag(style);
+}
+
 // ----------------------------------------------------------------------------
 // Create the wxComboBox and wxSpinCtrl
 // ----------------------------------------------------------------------------
@@ -394,6 +405,7 @@ void wxCalendarCtrl::ShowCurrentControls()
         m_spinYear->Hide();
         m_staticYear->Show();
     }
+    //else: these controls are not even created, don't show/hide them
 }
 
 wxControl *wxCalendarCtrl::GetMonthControl() const