]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/samples/fl/fl_demo1.cpp
New wxTE_ flags
[wxWidgets.git] / contrib / samples / fl / fl_demo1.cpp
index 6de4a663791bddce0afe701b4757694b374d177e..30f4b8d514dae6a3779a87a5fe9539649a269aa6 100644 (file)
@@ -49,7 +49,7 @@
 char  wxDummyChar;
 
 
 char  wxDummyChar;
 
 
-IMPLEMENT_APP  (MyApp)
+IMPLEMENT_APP (MyApp)
 
 bool MyApp::OnInit(void)
 {
 
 bool MyApp::OnInit(void)
 {
@@ -69,9 +69,11 @@ bool MyApp::OnInit(void)
     
     frame->SetMenuBar(menu_bar);
     
     
     frame->SetMenuBar(menu_bar);
     
+#if wxUSE_STATUSBAR
     frame->CreateStatusBar(3);
     frame->CreateStatusBar(3);
+#endif // wxUSE_STATUSBAR
     
     
-    frame->Show(TRUE);
+    frame->Show(true);
     
     frame->mpClientWnd->Refresh();
     
     
     frame->mpClientWnd->Refresh();
     
@@ -83,7 +85,7 @@ The ONLY purpose is to demonstrate self-layouting toolbars,\nflat-bitmapped-butt
 (cbRowDragPlugin & cbBarHintsPlugin)\n\n\
 BTW, disabled images and label-text are rendered at run-time") );
     
 (cbRowDragPlugin & cbBarHintsPlugin)\n\n\
 BTW, disabled images and label-text are rendered at run-time") );
     
-    return TRUE;
+    return true;
 }
 
 /***** Implementation for class MyFrame *****/
 }
 
 /***** Implementation for class MyFrame *****/
@@ -97,7 +99,7 @@ BEGIN_EVENT_TABLE( MyFrame, wxFrame )
 END_EVENT_TABLE()
 
 void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
 END_EVENT_TABLE()
 
 void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
-{                                              
+{
     wxMessageBox(_T("Hey - you found a BIG question-mark !!"));
 }
 
     wxMessageBox(_T("Hey - you found a BIG question-mark !!"));
 }
 
@@ -115,7 +117,7 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
 {
     wxTextCtrl* pCtrl = 
         
 {
     wxTextCtrl* pCtrl = 
         
-        new wxTextCtrl( this, -1, value, 
+        new wxTextCtrl( this, wxID_ANY, value, 
         wxDefaultPosition, wxSize(0,0), wxTE_MULTILINE );
     
     pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
         wxDefaultPosition, wxSize(0,0), wxTE_MULTILINE );
     
     pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
@@ -124,7 +126,7 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
 }
 
 MyFrame::MyFrame(wxFrame *frame)
 }
 
 MyFrame::MyFrame(wxFrame *frame)
-    : wxFrame( frame, -1, _("wxWidgets 2.0 wxFrameLayout Test Application"), wxDefaultPosition, 
+    : wxFrame( frame, wxID_ANY, _("wxWidgets 2.0 wxFrameLayout Test Application"), wxDefaultPosition, 
           wxSize( 700, 500 ), 
           wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | 
           wxTHICK_FRAME   | wxSYSTEM_MENU  | wxCAPTION, 
           wxSize( 700, 500 ), 
           wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | 
           wxTHICK_FRAME   | wxSYSTEM_MENU  | wxCAPTION, 
@@ -138,7 +140,7 @@ MyFrame::MyFrame(wxFrame *frame)
     cbCommonPaneProperties props;
     mpLayout->GetPaneProperties( props );
     
     cbCommonPaneProperties props;
     mpLayout->GetPaneProperties( props );
     
-    props.mRealTimeUpdatesOn = FALSE; // real-time OFF!!!
+    props.mRealTimeUpdatesOn = false; // real-time OFF!!!
     
     mpLayout->SetPaneProperties( props, wxALL_PANES );
 #endif
     
     mpLayout->SetPaneProperties( props, wxALL_PANES );
 #endif
@@ -161,7 +163,7 @@ MyFrame::MyFrame(wxFrame *frame)
     cbDimInfo sizes0( 200,45, // when docked horizontally      
                       200,85, // when docked vertically        
                       175,35, // when floated                  
     cbDimInfo sizes0( 200,45, // when docked horizontally      
                       200,85, // when docked vertically        
                       175,35, // when floated                  
-                      FALSE,  // the bar is not fixed-size
+                      false,  // the bar is not fixed-size
                       4,      // vertical gap (bar border)
                       4       // horizontal gap (bar border)
                     ); 
                       4,      // vertical gap (bar border)
                       4       // horizontal gap (bar border)
                     ); 
@@ -169,7 +171,7 @@ MyFrame::MyFrame(wxFrame *frame)
     cbDimInfo sizes1( 150,35, // when docked horizontally      
                       150,85, // when docked vertically        
                       175,35, // when floated                  
     cbDimInfo sizes1( 150,35, // when docked horizontally      
                       150,85, // when docked vertically        
                       175,35, // when floated                  
-                      TRUE,   // the bar is not fixed-size
+                      true,   // the bar is not fixed-size
                       4,      // vertical gap (bar border)
                       4       // horizontal gap (bar border)
                     ); 
                       4,      // vertical gap (bar border)
                       4       // horizontal gap (bar border)
                     ); 
@@ -177,7 +179,7 @@ MyFrame::MyFrame(wxFrame *frame)
     cbDimInfo sizes2( 195,35, // when docked horizontally      
                       185,37, // when docked vertically        
                       195,35, // when floated                  
     cbDimInfo sizes2( 195,35, // when docked horizontally      
                       185,37, // when docked vertically        
                       195,35, // when floated                  
-                      TRUE,   // the bar is not fixed-size
+                      true,   // the bar is not fixed-size
                       4,      // vertical gap (bar border)
                       4,      // horizontal gap (bar border)
                       new cbDynToolBarDimHandler()
                       4,      // vertical gap (bar border)
                       4,      // horizontal gap (bar border)
                       new cbDynToolBarDimHandler()
@@ -188,7 +190,7 @@ MyFrame::MyFrame(wxFrame *frame)
                       0,                        // insert into 0th row (vert. position)
                       0,                        // offset from the start of row (in pixels)
                       _("InfoViewer1"),            // name to refer in customization pop-ups
                       0,                        // insert into 0th row (vert. position)
                       0,                        // offset from the start of row (in pixels)
                       _("InfoViewer1"),            // name to refer in customization pop-ups
-                      TRUE
+                      true
                     );
     
     mpLayout->AddBar( CreateTextCtrl(_("Bye")),    // bar window
                     );
     
     mpLayout->AddBar( CreateTextCtrl(_("Bye")),    // bar window
@@ -196,7 +198,7 @@ MyFrame::MyFrame(wxFrame *frame)
                       1,                        // insert into 0th row (vert. position)
                       0,                        // offset from the start of row (in pixels)
                       _("InfoViewer2"),            // name to refer in customization pop-ups
                       1,                        // insert into 0th row (vert. position)
                       0,                        // offset from the start of row (in pixels)
                       _("InfoViewer2"),            // name to refer in customization pop-ups
-                      TRUE
+                      true
                     );
     
     mpLayout->AddBar( CreateTextCtrl(_("Fixed0")), // bar window
                     );
     
     mpLayout->AddBar( CreateTextCtrl(_("Fixed0")), // bar window
@@ -204,12 +206,12 @@ MyFrame::MyFrame(wxFrame *frame)
                       0,                        // insert into 0th row (vert. position)
                       0,                        // offset from the start of row (in pixels)
                       _("ToolBar1"),               // name to refer in customization pop-ups
                       0,                        // insert into 0th row (vert. position)
                       0,                        // offset from the start of row (in pixels)
                       _("ToolBar1"),               // name to refer in customization pop-ups
-                      TRUE
+                      true
                     );
     
     wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
     
                     );
     
     wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
     
-    pToolBar->Create( this, -1 );
+    pToolBar->Create( this, wxID_ANY );
     
     // 1001-1006 ids of command events fired by added tool-buttons
 
     
     // 1001-1006 ids of command events fired by added tool-buttons
 
@@ -217,7 +219,9 @@ MyFrame::MyFrame(wxFrame *frame)
     pToolBar->AddSeparator();
     pToolBar->AddTool( 1002, wxString(wxT(BMP_DIR)) + wxT("open.bmp") );
     pToolBar->AddTool( 1003, wxString(wxT(BMP_DIR)) + wxT("save.bmp") );
     pToolBar->AddSeparator();
     pToolBar->AddTool( 1002, wxString(wxT(BMP_DIR)) + wxT("open.bmp") );
     pToolBar->AddTool( 1003, wxString(wxT(BMP_DIR)) + wxT("save.bmp") );
-    pToolBar->AddSeparator(new wxMySeparatorLine(pToolBar, -1));    
+#if wxUSE_STATLINE
+    pToolBar->AddSeparator(new wxMySeparatorLine(pToolBar, wxID_ANY));    
+#endif // wxUSE_STATLINE
     pToolBar->AddTool( 1004, wxString(wxT(BMP_DIR)) + wxT("cut.bmp") );
     pToolBar->AddTool( 1005, wxString(wxT(BMP_DIR)) + wxT("copy.bmp") );
     pToolBar->AddTool( 1006, wxString(wxT(BMP_DIR)) + wxT("paste.bmp") );
     pToolBar->AddTool( 1004, wxString(wxT(BMP_DIR)) + wxT("cut.bmp") );
     pToolBar->AddTool( 1005, wxString(wxT(BMP_DIR)) + wxT("copy.bmp") );
     pToolBar->AddTool( 1006, wxString(wxT(BMP_DIR)) + wxT("paste.bmp") );
@@ -228,10 +232,10 @@ MyFrame::MyFrame(wxFrame *frame)
                       0,                    // insert into 0th row (vert. position)
                       0,                    // offset from the start of row (in pixels)
                       wxT("ToolBar2"),           // name to refer in customization pop-ups
                       0,                    // insert into 0th row (vert. position)
                       0,                    // offset from the start of row (in pixels)
                       wxT("ToolBar2"),           // name to refer in customization pop-ups
-                      FALSE
+                      false
                     );
     
                     );
     
-    mpLayout->EnableFloating( TRUE ); // off, thinking about wxGtk...
+    mpLayout->EnableFloating( true ); // off, thinking about wxGtk...
 }
 
 MyFrame::~MyFrame()
 }
 
 MyFrame::~MyFrame()
@@ -241,6 +245,7 @@ MyFrame::~MyFrame()
 }
 
 #define LINE_SIZE 3
 }
 
 #define LINE_SIZE 3
+#if wxUSE_STATLINE
 void wxMySeparatorLine::DoSetSize( int x, int y,
                                    int width, int height,
                                    int sizeFlags)
 void wxMySeparatorLine::DoSetSize( int x, int y,
                                    int width, int height,
                                    int sizeFlags)
@@ -258,3 +263,4 @@ void wxMySeparatorLine::DoSetSize( int x, int y,
     
     wxStaticLine::DoSetSize(x, y, width, height, sizeFlags);
 }
     
     wxStaticLine::DoSetSize(x, y, width, height, sizeFlags);
 }
+#endif // wxUSE_STATLINE