]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/spinbtn.cpp
Added demo of using a sizer in a wxScrolledWindow
[wxWidgets.git] / samples / widgets / spinbtn.cpp
index 62b68b09169d4df0235d4a22f8fadcba10e64ada..609870b89a3905b4ef8db2acadab6dadc10eafb9 100644 (file)
@@ -165,6 +165,13 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
                                        wxImageList *imaglist)
                   : WidgetsPage(notebook)
 {
+    m_chkVert = NULL;
+    m_chkWrap = NULL;
+    m_spinbtn = NULL;
+    m_spinctrl = NULL;
+    m_textValue = NULL;
+    m_textMin = NULL;
+    m_textMax = NULL;
     imaglist->Add(wxBitmap(spinbtn_xpm));
 
     // init everything
@@ -410,6 +417,8 @@ void SpinBtnWidgetsPage::OnSpinBtnDown(wxCommandEvent& event)
 
 void SpinBtnWidgetsPage::OnSpinCtrl(wxCommandEvent& event)
 {
+    if (!m_spinctrl)
+        return;
     int value = event.GetInt();
 
     wxASSERT_MSG( value == m_spinctrl->GetValue(),
@@ -417,4 +426,4 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxCommandEvent& event)
 
     wxLogMessage(_T("Spin control value changed, now %d"), value);
 }
-#endif
\ No newline at end of file
+#endif