Fixed XIM compilation, but doesn't work yet.
[wxWidgets.git] / samples / layout / layout.cpp
index 1392d689216a750c5e992d0b5caca5474ad3ba33..9754aeb87211736e6dffa386adaee3393b22744d 100644 (file)
@@ -267,7 +267,7 @@ NewSizerFrame::NewSizerFrame(wxFrame *frame, char *title, int x, int y ):
   // has a text ctrl in the middle. at the bottom, we have
   // two buttons which.
 
-  wxBox *topsizer = new wxBox( wxVERTICAL );
+  wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
   
   // 1) top: create wxStaticText with minimum size equal to its default size
   topsizer->Add( 
@@ -285,6 +285,18 @@ NewSizerFrame::NewSizerFrame(wxFrame *frame, char *title, int x, int y ):
     wxALL,        //   and make border all around
     5 );         // set border width to 5
 
+  // 2.5) Gratuitous test of wxStaticBoxSizers
+  wxBoxSizer *statsizer = new wxStaticBoxSizer(
+    new wxStaticBox(this, -1, "A wxStaticBoxSizer"),
+    wxVERTICAL );
+  statsizer->Add(
+    new wxStaticText(this, -1, "And some TEXT inside it"),
+    0,
+    wxCENTER |
+    wxALL,
+    30);
+  topsizer->Add(statsizer, 1, wxEXPAND | wxALL, 10);
+
 
   // 3) middle: create wxStaticLine with minimum size (3x3)
   topsizer->Add( 
@@ -296,7 +308,7 @@ NewSizerFrame::NewSizerFrame(wxFrame *frame, char *title, int x, int y ):
      
 
   // 4) bottom: create two centred wxButtons  
-  wxBox *button_box = new wxBox( wxHORIZONTAL );
+  wxBoxSizer *button_box = new wxBoxSizer( wxHORIZONTAL );
   button_box->Add(
      new wxButton( this, -1, "Two buttons in a box" ), 
      0,           // make horizontally unstretchable
@@ -313,6 +325,7 @@ NewSizerFrame::NewSizerFrame(wxFrame *frame, char *title, int x, int y ):
      0,          // make vertically unstretchable
      wxCENTER ); // no border and centre horizontally
 
+  SetAutoLayout( TRUE );
   
   // set frame to minimum size
   topsizer->Fit( this );  
@@ -321,8 +334,6 @@ NewSizerFrame::NewSizerFrame(wxFrame *frame, char *title, int x, int y ):
   topsizer->SetSizeHints( this );  
   
   SetSizer( topsizer );
-  
-  SetAutoLayout( TRUE );
 }