]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/controls/controls.cpp
refresh the MDI frame window menu whenever a child frame is shown/hidden (and not...
[wxWidgets.git] / samples / controls / controls.cpp
index 1e747125162b406e66803ce6d7b3159f5a871374..57daa3fd06170e5156e59904586c8a3efea893c4 100644 (file)
@@ -19,9 +19,7 @@
     #include "wx/wx.h"
 #endif
 
-#if !defined( __WXMSW__ ) || defined( __WIN95__ )
 #include "wx/spinbutt.h"
-#endif
 #include "wx/tglbtn.h"
 #include "wx/bookctrl.h"
 #include "wx/imaglist.h"
@@ -882,7 +880,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
                             _T("This is also supposed to demonstrate how ")
                             _T("to use static controls with line wrapping."),
                             wxDefaultPosition,
-                            wxSize(240, -1)
+                            wxSize(240, wxDefaultCoord)
                           );
 #endif
     wrapping_sizer->Add( m_wrappingText );
@@ -915,7 +913,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
 #endif // wxUSE_SPINBTN
 
 #if wxUSE_SPINCTRL
-    m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, _T(""), wxPoint(200, 160), wxSize(80, wxDefaultCoord) );
+    m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, wxEmptyString, wxPoint(200, 160), wxSize(80, wxDefaultCoord) );
     m_spinctrl->SetRange(10,30);
     m_spinctrl->SetValue(15);
 #endif // wxUSE_SPINCTRL
@@ -1068,6 +1066,19 @@ void MyPanel::OnIdle(wxIdleEvent& event)
         s_selCombo = sel;
     }
 
+    static int s_selChoice = INVALID_SELECTION;
+    sel = m_choice->GetSelection();
+    if ( sel != s_selChoice )
+    {
+        if ( s_selChoice != INVALID_SELECTION )
+        {
+            wxLogMessage(_T("EVT_IDLE: choice selection changed from %d to %d"),
+                         s_selChoice, sel);
+        }
+
+        s_selChoice = sel;
+    }
+
     event.Skip();
 }
 
@@ -1757,13 +1768,10 @@ void MyFrame::OnQuit (wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
 {
-    SetSize(800, 600);
-#if 0
     wxBusyCursor bc;
 
     wxMessageDialog dialog(this, _T("This is a control sample"), _T("About Controls"), wxOK );
     dialog.ShowModal();
-#endif
 }
 
 void MyFrame::OnClearLog(wxCommandEvent& WXUNUSED(event))