]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/gauge.cpp
Fixed the code to actually work.
[wxWidgets.git] / samples / widgets / gauge.cpp
index 353dd228a4d1a5c53d6614065d7e63d0eac01f5c..477f8d429bf138dff75f928ed0a77a261efee944 100644 (file)
@@ -29,6 +29,7 @@
     #include "wx/log.h"
     #include "wx/timer.h"
 
+    #include "wx/bitmap.h"
     #include "wx/button.h"
     #include "wx/checkbox.h"
     #include "wx/combobox.h"
@@ -41,7 +42,7 @@
 #include "wx/sizer.h"
 
 #include "widgets.h"
-#if 1
+#if wxUSE_GAUGE
 #include "icons/gauge.xpm"
 
 // ----------------------------------------------------------------------------
@@ -209,7 +210,7 @@ GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook,
                                             _T("Set &range"),
                                             GaugePage_RangeText,
                                             &m_textRange);
-    m_textRange->SetValue(wxString::Format(_T("%lu"), m_range));
+    m_textRange->SetValue( wxString::Format(_T("%lu"), m_range) );
     sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
 
     btn = new wxButton(this, GaugePage_Progress, _T("Simulate &progress"));
@@ -271,7 +272,7 @@ void GaugeWidgetsPage::CreateGauge()
     {
         val = m_gauge->GetValue();
 
-        m_sizerGauge->Remove(m_gauge);
+        m_sizerGauge->Detach( m_gauge );
         delete m_gauge;
     }
 
@@ -361,7 +362,7 @@ void GaugeWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
     event.Enable( m_chkVert->GetValue() || m_chkSmooth->GetValue() );
 }
 
-void GaugeWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
+void GaugeWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
 {
     CreateGauge();
 }
@@ -400,4 +401,5 @@ void GaugeWidgetsPage::StopTimer()
     wxLogMessage(_T("Progress finished."));
 }
 
-#endif
\ No newline at end of file
+#endif
+    // wxUSE_GAUGE