]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/spinbtn.cpp
disable use of #pragma interface under Mac OS X
[wxWidgets.git] / samples / widgets / spinbtn.cpp
index 62b68b09169d4df0235d4a22f8fadcba10e64ada..fa798dd2876e858a67deabf75da6dd11b7666694 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
@@ -217,8 +224,8 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
     m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, _T(""));
     sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
 
-    m_textMin->SetValue(wxString::Format(_T("%lu"), m_min));
-    m_textMax->SetValue(wxString::Format(_T("%lu"), m_max));
+    m_textMin->SetValue( wxString::Format(_T("%d"), m_min) );
+    m_textMax->SetValue( wxString::Format(_T("%d"), m_max) );
 
     sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
 
@@ -398,18 +405,20 @@ void SpinBtnWidgetsPage::OnSpinBtn(wxCommandEvent& event)
 
 void SpinBtnWidgetsPage::OnSpinBtnUp(wxCommandEvent& event)
 {
-    wxLogMessage(_T("Spin button value incremented, will be %d (was %d)"),
-                 event.GetInt(), m_spinbtn->GetValue());
+    wxLogMessage( _T("Spin button value incremented, will be %ld (was %d)"),
+                  event.GetInt(), m_spinbtn->GetValue() );
 }
 
 void SpinBtnWidgetsPage::OnSpinBtnDown(wxCommandEvent& event)
 {
-    wxLogMessage(_T("Spin button value decremented, will be %d (was %d)"),
-                 event.GetInt(), m_spinbtn->GetValue());
+    wxLogMessage( _T("Spin button value decremented, will be %ld (was %d)"),
+                  event.GetInt(), m_spinbtn->GetValue() );
 }
 
 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