+void GaugeWidgetsPage::StartTimer(wxButton *clicked)
+{
+ static const int INTERVAL = 300;
+
+ wxLogMessage(wxT("Launched progress timer (interval = %d ms)"), INTERVAL);
+
+ m_timer = new wxTimer(this,
+ clicked->GetId() == GaugePage_Progress ? GaugePage_Timer : GaugePage_IndeterminateTimer);
+ m_timer->Start(INTERVAL);
+
+ clicked->SetLabel(wxT("&Stop timer"));
+
+ if (clicked->GetId() == GaugePage_Progress)
+ FindWindow(GaugePage_IndeterminateProgress)->Disable();
+ else
+ FindWindow(GaugePage_Progress)->Disable();
+}
+
+void GaugeWidgetsPage::StopTimer(wxButton *clicked)
+{
+ wxCHECK_RET( m_timer, wxT("shouldn't be called") );
+
+ m_timer->Stop();
+ delete m_timer;
+ m_timer = NULL;
+
+ if (clicked->GetId() == GaugePage_Progress)
+ {
+ clicked->SetLabel(wxT("Simulate &progress"));
+ FindWindow(GaugePage_IndeterminateProgress)->Enable();
+ }
+ else
+ {
+ clicked->SetLabel(wxT("Simulate indeterminate job"));
+ FindWindow(GaugePage_Progress)->Enable();
+ }
+
+ wxLogMessage(wxT("Progress finished."));
+}
+