]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/controls/controls.cpp
Comment out wxHVScrolledWindow
[wxWidgets.git] / samples / controls / controls.cpp
index b113708fdb13359f7067379a580f22a1ab7d4286..0f95b1664661449ed8dc74e0452b404927369c6c 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"
@@ -438,6 +436,7 @@ const int  ID_COMBO_APPEND      = 144;
 const int  ID_COMBO_DELETE      = 145;
 const int  ID_COMBO_FONT        = 146;
 const int  ID_COMBO_ENABLE      = 147;
+const int  ID_COMBO_SET_TEXT    = 148;
 
 const int  ID_RADIOBOX          = 160;
 const int  ID_RADIOBOX_SEL_NUM  = 161;
@@ -515,6 +514,7 @@ EVT_BUTTON    (ID_COMBO_CLEAR,          MyPanel::OnComboButtons)
 EVT_BUTTON    (ID_COMBO_APPEND,         MyPanel::OnComboButtons)
 EVT_BUTTON    (ID_COMBO_DELETE,         MyPanel::OnComboButtons)
 EVT_BUTTON    (ID_COMBO_FONT,           MyPanel::OnComboButtons)
+EVT_BUTTON    (ID_COMBO_SET_TEXT,       MyPanel::OnComboButtons)
 EVT_CHECKBOX  (ID_COMBO_ENABLE,         MyPanel::OnComboButtons)
 EVT_RADIOBOX  (ID_RADIOBOX,             MyPanel::OnRadio)
 EVT_BUTTON    (ID_RADIOBOX_SEL_NUM,     MyPanel::OnRadioButtons)
@@ -799,6 +799,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
     (void)new wxButton( panel, ID_COMBO_APPEND, _T("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
     (void)new wxButton( panel, ID_COMBO_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
     (void)new wxButton( panel, ID_COMBO_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
+    (void)new wxButton( panel, ID_COMBO_SET_TEXT, _T("Set 'Hi!' at #2"), wxPoint(340,180), wxSize(140,30) );
     (void)new wxCheckBox( panel, ID_COMBO_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) );
     m_book->AddPage(panel, _T("wxComboBox"), false, Image_Combo);
 
@@ -882,7 +883,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 +916,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
@@ -1421,6 +1422,11 @@ void MyPanel::OnComboButtons( wxCommandEvent &event )
                 m_combo->SetFont( *wxITALIC_FONT );
                 break;
             }
+        case ID_COMBO_SET_TEXT:
+            {
+                m_combo->SetString( 2, wxT("Hi!") );
+                break;
+            }
     }
 }
 
@@ -1770,13 +1776,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))