]> git.saurik.com Git - wxWidgets.git/commitdiff
-1->wxID_ANY, TRUE->true, FALSE->false replacements
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 28 May 2004 10:43:39 +0000 (10:43 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 28 May 2004 10:43:39 +0000 (10:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dragimag/dragimag.cpp
samples/dynamic/dynamic.cpp
samples/erase/erase.cpp
samples/event/event.cpp
samples/exec/exec.cpp
samples/htlbox/htlbox.cpp

index 398a53d634c4ebf5b7e67f2c90a7679f2a8a65fe..dba64848960a49a99196b0b935e572ee2b0e83ef 100644 (file)
@@ -143,7 +143,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
         {
             m_currentlyHighlighted->Draw(dc);
         }
         {
             m_currentlyHighlighted->Draw(dc);
         }
-        m_draggedShape->SetShow(TRUE);
+        m_draggedShape->SetShow(true);
         m_draggedShape->Draw(dc);
 
         m_currentlyHighlighted = (DragShape*) NULL;
         m_draggedShape->Draw(dc);
 
         m_currentlyHighlighted = (DragShape*) NULL;
@@ -169,7 +169,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
                 delete m_dragImage;
 
             // Erase the dragged shape from the canvas
                 delete m_dragImage;
 
             // Erase the dragged shape from the canvas
-            m_draggedShape->SetShow(FALSE);
+            m_draggedShape->SetShow(false);
             wxClientDC dc(this);
             EraseShape(m_draggedShape, dc);
             DrawShapes(dc);
             wxClientDC dc(this);
             EraseShape(m_draggedShape, dc);
             DrawShapes(dc);
@@ -229,17 +229,17 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
             // We're currently dragging. See if we're over another shape.
             DragShape* onShape = FindShape(event.GetPosition());
 
             // We're currently dragging. See if we're over another shape.
             DragShape* onShape = FindShape(event.GetPosition());
 
-            bool mustUnhighlightOld = FALSE;
-            bool mustHighlightNew = FALSE;
+            bool mustUnhighlightOld = false;
+            bool mustHighlightNew = false;
 
             if (m_currentlyHighlighted)
             {
                 if ((onShape == (DragShape*) NULL) || (m_currentlyHighlighted != onShape))
 
             if (m_currentlyHighlighted)
             {
                 if ((onShape == (DragShape*) NULL) || (m_currentlyHighlighted != onShape))
-                    mustUnhighlightOld = TRUE;
+                    mustUnhighlightOld = true;
             }
 
             if (onShape && (onShape != m_currentlyHighlighted) && onShape->IsShown())
             }
 
             if (onShape && (onShape != m_currentlyHighlighted) && onShape->IsShown())
-                mustHighlightNew = TRUE;
+                mustHighlightNew = true;
 
             if (mustUnhighlightOld || mustHighlightNew)
                 m_dragImage->Hide();
 
             if (mustUnhighlightOld || mustHighlightNew)
                 m_dragImage->Hide();
@@ -327,12 +327,12 @@ BEGIN_EVENT_TABLE(MyFrame,wxFrame)
 END_EVENT_TABLE()
 
 MyFrame::MyFrame()
 END_EVENT_TABLE()
 
 MyFrame::MyFrame()
-: wxFrame( (wxFrame *)NULL, -1, _T("wxDragImage sample"),
+: wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxDragImage sample"),
           wxPoint(20,20), wxSize(470,360) )
 {
     wxMenu *file_menu = new wxMenu();
     file_menu->Append( wxID_ABOUT, _T("&About..."));
           wxPoint(20,20), wxSize(470,360) )
 {
     wxMenu *file_menu = new wxMenu();
     file_menu->Append( wxID_ABOUT, _T("&About..."));
-    file_menu->Append( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"), TRUE);
+    file_menu->Append( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"), true);
     file_menu->Append( wxID_EXIT, _T("E&xit"));
     
     wxMenuBar *menu_bar = new wxMenuBar();
     file_menu->Append( wxID_EXIT, _T("E&xit"));
     
     wxMenuBar *menu_bar = new wxMenuBar();
@@ -345,12 +345,12 @@ MyFrame::MyFrame()
     int widths[] = { -1, 100 };
     SetStatusWidths( 2, widths );
     
     int widths[] = { -1, 100 };
     SetStatusWidths( 2, widths );
     
-    m_canvas = new MyCanvas( this, -1, wxPoint(0,0), wxSize(10,10) );
+    m_canvas = new MyCanvas( this, wxID_ANY, wxPoint(0,0), wxSize(10,10) );
 }
 
 void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
 {
 }
 
 void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
 {
-    Close( TRUE );
+    Close( true );
 }
 
 void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
 }
 
 void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
@@ -372,7 +372,7 @@ END_EVENT_TABLE()
 MyApp::MyApp()
 {
     // Drag across whole screen
 MyApp::MyApp()
 {
     // Drag across whole screen
-    m_useScreen = FALSE;
+    m_useScreen = false;
 }
 
 bool MyApp::OnInit()
 }
 
 bool MyApp::OnInit()
@@ -431,9 +431,9 @@ bool MyApp::OnInit()
     m_background = bitmap;
 #endif
 
     m_background = bitmap;
 #endif
 
-    frame->Show( TRUE );
+    frame->Show( true );
 
 
-    return TRUE;
+    return true;
 }
 
 int MyApp::OnExit()
 }
 
 int MyApp::OnExit()
@@ -452,7 +452,7 @@ bool MyApp::TileBitmap(const wxRect& rect, wxDC& dc, wxBitmap& bitmap)
         for (j = rect.y; j < rect.y + rect.height; j+= h)
             dc.DrawBitmap(bitmap, i, j);
     }
         for (j = rect.y; j < rect.y + rect.height; j+= h)
             dc.DrawBitmap(bitmap, i, j);
     }
-    return TRUE;
+    return true;
 }
 
 void MyApp::OnUseScreen(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyApp::OnUseScreen(wxCommandEvent& WXUNUSED(event))
@@ -468,7 +468,7 @@ DragShape::DragShape(const wxBitmap& bitmap)
     m_pos.x = 0;
     m_pos.y = 0;
     m_dragMethod = SHAPE_DRAG_BITMAP;
     m_pos.x = 0;
     m_pos.y = 0;
     m_dragMethod = SHAPE_DRAG_BITMAP;
-    m_show = TRUE;
+    m_show = true;
 }
 
 DragShape::~DragShape()
 }
 
 DragShape::~DragShape()
@@ -489,11 +489,11 @@ bool DragShape::Draw(wxDC& dc, int op)
         memDC.SelectObject(m_bitmap);
     
         dc.Blit(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight(),
         memDC.SelectObject(m_bitmap);
     
         dc.Blit(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight(),
-            & memDC, 0, 0, op, TRUE);
+            & memDC, 0, 0, op, true);
 
 
-        return TRUE;
+        return true;
     }
     else
     }
     else
-        return FALSE;
+        return false;
 }
 
 }
 
index a3a6dbdd525597cb98eb41cf94e6c54279476fc8..378f6e1882f95bfe347ef53ca399bf6f71d88af3 100644 (file)
@@ -59,10 +59,10 @@ bool MyApp::OnInit(void)
   // Create the main frame window
   MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWidgets App"), 50, 50, 450, 340);
 
   // Create the main frame window
   MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWidgets App"), 50, 50, 450, 340);
 
-  frame->Connect( DYNAMIC_QUIT,  -1, wxEVT_COMMAND_MENU_SELECTED,
+  frame->Connect( DYNAMIC_QUIT,  wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
                   (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
                   &MyFrame::OnQuit );
                   (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
                   &MyFrame::OnQuit );
-  frame->Connect( DYNAMIC_ABOUT, -1, wxEVT_COMMAND_MENU_SELECTED,
+  frame->Connect( DYNAMIC_ABOUT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
                   (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
                   &MyFrame::OnAbout );
 
                   (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
                   &MyFrame::OnAbout );
 
@@ -83,26 +83,26 @@ bool MyApp::OnInit(void)
   frame->SetMenuBar(menu_bar);
 
   // Make a panel with a message
   frame->SetMenuBar(menu_bar);
 
   // Make a panel with a message
-  wxPanel *panel = new wxPanel(frame, -1, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL);
+  wxPanel *panel = new wxPanel(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL);
 
 
-  (void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxSize(-1, -1), 0);
+  (void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxDefaultSize, 0);
 
   // Show the frame
 
   // Show the frame
-  frame->Show(TRUE);
+  frame->Show(true);
 
   SetTopWindow(frame);
 
 
   SetTopWindow(frame);
 
-  return TRUE;
+  return true;
 }
 
 // My frame constructor
 MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
 }
 
 // My frame constructor
 MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
-  wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
+  wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
 {}
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
 {
 {}
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
 {
-  Close(TRUE);
+  Close(true);
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
index 9a36be354b41ead04928943250c693ed008f0999..166f7e10084c81ee9c6e9ac1b183092cd400d612 100644 (file)
@@ -105,9 +105,9 @@ bool MyApp::OnInit()
     MyFrame *frame = new MyFrame(_T("Erase sample"),
                                  wxPoint(50, 50), wxSize(450, 340));
 
     MyFrame *frame = new MyFrame(_T("Erase sample"),
                                  wxPoint(50, 50), wxSize(450, 340));
 
-    frame->Show(TRUE);
+    frame->Show(true);
 
 
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -121,7 +121,7 @@ END_EVENT_TABLE()
 
 // frame constructor
 MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 
 // frame constructor
 MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
-       : wxFrame((wxFrame *)NULL, -1, title, pos, size)
+       : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
 {
     SetIcon(wxICON(mondrian));
 
 {
     SetIcon(wxICON(mondrian));
 
@@ -150,7 +150,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
-    Close(TRUE);
+    Close(true);
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -167,7 +167,7 @@ BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
 END_EVENT_TABLE()
 
 MyCanvas::MyCanvas( MyFrame *parent )
 END_EVENT_TABLE()
 
 MyCanvas::MyCanvas( MyFrame *parent )
-        : wxScrolledWindow( parent, -1, wxDefaultPosition, wxDefaultSize,
+        : wxScrolledWindow( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                             wxScrolledWindowStyle |
                             wxNO_FULL_REPAINT_ON_RESIZE|
                             wxSUNKEN_BORDER )
                             wxScrolledWindowStyle |
                             wxNO_FULL_REPAINT_ON_RESIZE|
                             wxSUNKEN_BORDER )
@@ -176,7 +176,7 @@ MyCanvas::MyCanvas( MyFrame *parent )
 
     m_bitmap = wxBitmap( wxICON(mondrian) );
 
 
     m_bitmap = wxBitmap( wxICON(mondrian) );
 
-    new wxStaticBitmap( this, -1, m_bitmap, wxPoint(80,20) );
+    new wxStaticBitmap( this, wxID_ANY, m_bitmap, wxPoint(80,20) );
 }
 
 void MyCanvas::OnChar( wxKeyEvent &event )
 }
 
 void MyCanvas::OnChar( wxKeyEvent &event )
@@ -211,7 +211,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
     dc.SetBrush( *wxBLACK_BRUSH );
     dc.DrawRectangle( 0,0,200,50 );
 
     dc.SetBrush( *wxBLACK_BRUSH );
     dc.DrawRectangle( 0,0,200,50 );
 
-    dc.DrawBitmap( m_bitmap, 10, 20, TRUE );
+    dc.DrawBitmap( m_bitmap, 10, 20, true );
 
     dc.SetTextForeground(*wxBLUE);
     dc.DrawText(_T("This text is drawn from OnPaint"), 65, 65);
 
     dc.SetTextForeground(*wxBLUE);
     dc.DrawText(_T("This text is drawn from OnPaint"), 65, 65);
index 3604d6e296b891ca676241daff8bdd4fccab8860..ee1b87c5e77dd35c64d9d2b9439a4294046d3e70 100644 (file)
@@ -59,7 +59,7 @@ DEFINE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND)
 // it may also be convenient to define an event table macro for this event type
 #define EVT_MY_CUSTOM_COMMAND(id, fn) \
     DECLARE_EVENT_TABLE_ENTRY( \
 // it may also be convenient to define an event table macro for this event type
 #define EVT_MY_CUSTOM_COMMAND(id, fn) \
     DECLARE_EVENT_TABLE_ENTRY( \
-        wxEVT_MY_CUSTOM_COMMAND, id, -1, \
+        wxEVT_MY_CUSTOM_COMMAND, id, wxID_ANY, \
         (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
         (wxObject *) NULL \
     ),
         (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
         (wxObject *) NULL \
     ),
@@ -178,10 +178,10 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 
     EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop)
 
 
     EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop)
 
-    EVT_MY_CUSTOM_COMMAND(-1, MyFrame::OnProcessCustom)
+    EVT_MY_CUSTOM_COMMAND(wxID_ANY, MyFrame::OnProcessCustom)
 
     // this would also work:
 
     // this would also work:
-    //EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, -1, MyFrame::OnProcessCustom)
+    //EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, wxID_ANY, MyFrame::OnProcessCustom)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
@@ -212,12 +212,12 @@ bool MyApp::OnInit()
 
     // and show it (the frames, unlike simple controls, are not shown when
     // created initially)
 
     // and show it (the frames, unlike simple controls, are not shown when
     // created initially)
-    frame->Show(TRUE);
+    frame->Show(true);
 
     // success: wxApp::OnRun() will be called which will enter the main message
 
     // success: wxApp::OnRun() will be called which will enter the main message
-    // loop and the application will run. If we returned FALSE here, the
+    // loop and the application will run. If we returned false here, the
     // application would exit immediately.
     // application would exit immediately.
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -226,7 +226,7 @@ bool MyApp::OnInit()
 
 // frame constructor
 MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 
 // frame constructor
 MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
-       : wxFrame((wxFrame *)NULL, -1, title, pos, size)
+       : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
 {
     // init members
     m_nPush = 0;
 {
     // init members
     m_nPush = 0;
@@ -241,7 +241,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     wxMenu *menuEvent = new wxMenu;
     menuEvent->Append(Event_Connect, _T("&Connect\tCtrl-C"),
                      _T("Connect or disconnect the dynamic event handler"),
     wxMenu *menuEvent = new wxMenu;
     menuEvent->Append(Event_Connect, _T("&Connect\tCtrl-C"),
                      _T("Connect or disconnect the dynamic event handler"),
-                     TRUE /* checkable */);
+                     true /* checkable */);
     menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"),
                       _T("Dynamic event sample - only works after Connect"));
     menuEvent->AppendSeparator();
     menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"),
                       _T("Dynamic event sample - only works after Connect"));
     menuEvent->AppendSeparator();
@@ -277,7 +277,7 @@ MyFrame::~MyFrame()
     // crashes!
     while ( m_nPush-- != 0 )
     {
     // crashes!
     while ( m_nPush-- != 0 )
     {
-        PopEventHandler(TRUE /* delete handler */);
+        PopEventHandler(true /* delete handler */);
     }
 }
 
     }
 }
 
@@ -287,8 +287,8 @@ MyFrame::~MyFrame()
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
-    // TRUE is to force the frame to close
-    Close(TRUE);
+    // true is to force the frame to close
+    Close(true);
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -317,7 +317,7 @@ void MyFrame::OnConnect(wxCommandEvent& event)
     if ( event.IsChecked() )
     {
         // disconnect
     if ( event.IsChecked() )
     {
         // disconnect
-        Connect(Event_Dynamic, -1, wxEVT_COMMAND_MENU_SELECTED,
+        Connect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 (wxCommandEventFunction)&MyFrame::OnDynamic);
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 (wxCommandEventFunction)&MyFrame::OnDynamic);
@@ -327,7 +327,7 @@ void MyFrame::OnConnect(wxCommandEvent& event)
     }
     else // connect
     {
     }
     else // connect
     {
-        Disconnect(Event_Dynamic, -1, wxEVT_COMMAND_MENU_SELECTED);
+        Disconnect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED);
 
         SetStatusText(_T("You can no more use \"Dynamic\" item in the menu"));
         SetStatusText(_T("Dynamic: off"), Status_Dynamic);
 
         SetStatusText(_T("You can no more use \"Dynamic\" item in the menu"));
         SetStatusText(_T("Dynamic: off"), Status_Dynamic);
@@ -349,7 +349,7 @@ void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
 {
     wxCHECK_RET( m_nPush, _T("this command should be disabled!") );
 
 {
     wxCHECK_RET( m_nPush, _T("this command should be disabled!") );
 
-    PopEventHandler(TRUE /* delete handler */);
+    PopEventHandler(true /* delete handler */);
     m_nPush--;
 
     SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
     m_nPush--;
 
     SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
index eaeb0b15b9b0bb5d9667b361978a5b07d9d8fb22..ab5d6a9acc41307e2d4af14cc4ca35ddc10cb255 100644 (file)
@@ -338,18 +338,18 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 
     EVT_IDLE(MyFrame::OnIdle)
 
 
     EVT_IDLE(MyFrame::OnIdle)
 
-    EVT_TIMER(-1, MyFrame::OnTimer)
+    EVT_TIMER(wxID_ANY, MyFrame::OnTimer)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(MyPipeFrame, wxFrame)
     EVT_BUTTON(Exec_Btn_Send, MyPipeFrame::OnBtnSend)
     EVT_BUTTON(Exec_Btn_Get, MyPipeFrame::OnBtnGet)
 
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(MyPipeFrame, wxFrame)
     EVT_BUTTON(Exec_Btn_Send, MyPipeFrame::OnBtnSend)
     EVT_BUTTON(Exec_Btn_Get, MyPipeFrame::OnBtnGet)
 
-    EVT_TEXT_ENTER(-1, MyPipeFrame::OnTextEnter)
+    EVT_TEXT_ENTER(wxID_ANY, MyPipeFrame::OnTextEnter)
 
     EVT_CLOSE(MyPipeFrame::OnClose)
 
 
     EVT_CLOSE(MyPipeFrame::OnClose)
 
-    EVT_END_PROCESS(-1, MyPipeFrame::OnProcessTerm)
+    EVT_END_PROCESS(wxID_ANY, MyPipeFrame::OnProcessTerm)
 END_EVENT_TABLE()
 
 // Create a new application object: this macro will allow wxWidgets to create
 END_EVENT_TABLE()
 
 // Create a new application object: this macro will allow wxWidgets to create
@@ -375,13 +375,13 @@ bool MyApp::OnInit()
                                  wxDefaultPosition, wxSize(500, 140));
 
     // Show it and tell the application that it's our main window
                                  wxDefaultPosition, wxSize(500, 140));
 
     // Show it and tell the application that it's our main window
-    frame->Show(TRUE);
+    frame->Show(true);
     SetTopWindow(frame);
 
     // success: wxApp::OnRun() will be called which will enter the main message
     SetTopWindow(frame);
 
     // success: wxApp::OnRun() will be called which will enter the main message
-    // loop and the application will run. If we returned FALSE here, the
+    // loop and the application will run. If we returned false here, the
     // application would exit immediately.
     // application would exit immediately.
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -394,7 +394,7 @@ bool MyApp::OnInit()
 
 // frame constructor
 MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 
 // frame constructor
 MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
-       : wxFrame((wxFrame *)NULL, -1, title, pos, size),
+       : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size),
          m_timerIdleWakeUp(this)
 {
     m_pidLast = 0;
          m_timerIdleWakeUp(this)
 {
     m_pidLast = 0;
@@ -452,7 +452,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     SetMenuBar(menuBar);
 
     // create the listbox in which we will show misc messages as they come
     SetMenuBar(menuBar);
 
     // create the listbox in which we will show misc messages as they come
-    m_lbox = new wxListBox(this, -1);
+    m_lbox = new wxListBox(this, wxID_ANY);
     wxFont font(12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
                 wxFONTWEIGHT_NORMAL);
     if ( font.Ok() )
     wxFont font(12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
                 wxFONTWEIGHT_NORMAL);
     if ( font.Ok() )
@@ -471,8 +471,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
-    // TRUE is to force the frame to close
-    Close(TRUE);
+    // true is to force the frame to close
+    Close(true);
 }
 
 void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event))
@@ -669,11 +669,11 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event))
                           wxYES_NO | wxCANCEL | wxICON_QUESTION, this) )
     {
         case wxYES:
                           wxYES_NO | wxCANCEL | wxICON_QUESTION, this) )
     {
         case wxYES:
-            sync = TRUE;
+            sync = true;
             break;
 
         case wxNO:
             break;
 
         case wxNO:
-            sync = FALSE;
+            sync = false;
             break;
 
         default:
             break;
 
         default:
@@ -823,23 +823,23 @@ bool MyFrame::GetDDEServer()
     wxString server = wxGetTextFromUser(_T("Server to connect to:"),
                                         DIALOG_TITLE, m_server);
     if ( !server )
     wxString server = wxGetTextFromUser(_T("Server to connect to:"),
                                         DIALOG_TITLE, m_server);
     if ( !server )
-        return FALSE;
+        return false;
 
     m_server = server;
 
     wxString topic = wxGetTextFromUser(_T("DDE topic:"), DIALOG_TITLE, m_topic);
     if ( !topic )
 
     m_server = server;
 
     wxString topic = wxGetTextFromUser(_T("DDE topic:"), DIALOG_TITLE, m_topic);
     if ( !topic )
-        return FALSE;
+        return false;
 
     m_topic = topic;
 
     wxString cmd = wxGetTextFromUser(_T("DDE command:"), DIALOG_TITLE, m_cmdDde);
     if ( !cmd )
 
     m_topic = topic;
 
     wxString cmd = wxGetTextFromUser(_T("DDE command:"), DIALOG_TITLE, m_cmdDde);
     if ( !cmd )
-        return FALSE;
+        return false;
 
     m_cmdDde = cmd;
 
 
     m_cmdDde = cmd;
 
-    return TRUE;
+    return true;
 }
 
 void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event))
@@ -963,7 +963,7 @@ void MyProcess::OnTerminate(int pid, int status)
 
 bool MyPipedProcess::HasInput()
 {
 
 bool MyPipedProcess::HasInput()
 {
-    bool hasInput = FALSE;
+    bool hasInput = false;
 
     if ( IsInputAvailable() )
     {
 
     if ( IsInputAvailable() )
     {
@@ -975,7 +975,7 @@ bool MyPipedProcess::HasInput()
 
         m_parent->GetLogListBox()->Append(msg);
 
 
         m_parent->GetLogListBox()->Append(msg);
 
-        hasInput = TRUE;
+        hasInput = true;
     }
 
     if ( IsErrorAvailable() )
     }
 
     if ( IsErrorAvailable() )
@@ -988,7 +988,7 @@ bool MyPipedProcess::HasInput()
 
         m_parent->GetLogListBox()->Append(msg);
 
 
         m_parent->GetLogListBox()->Append(msg);
 
-        hasInput = TRUE;
+        hasInput = true;
     }
 
     return hasInput;
     }
 
     return hasInput;
@@ -1020,7 +1020,7 @@ bool MyPipedProcess2::HasInput()
         m_input.clear();
 
         // call us once again - may be we'll have output
         m_input.clear();
 
         // call us once again - may be we'll have output
-        return TRUE;
+        return true;
     }
 
     return MyPipedProcess::HasInput();
     }
 
     return MyPipedProcess::HasInput();
@@ -1033,7 +1033,7 @@ bool MyPipedProcess2::HasInput()
 MyPipeFrame::MyPipeFrame(wxFrame *parent,
                          const wxString& cmd,
                          wxProcess *process)
 MyPipeFrame::MyPipeFrame(wxFrame *parent,
                          const wxString& cmd,
                          wxProcess *process)
-           : wxFrame(parent, -1, cmd),
+           : wxFrame(parent, wxID_ANY, cmd),
              m_process(process),
              // in a real program we'd check that the streams are !NULL here
              m_in(*process->GetInputStream()),
              m_process(process),
              // in a real program we'd check that the streams are !NULL here
              m_in(*process->GetInputStream()),
@@ -1041,13 +1041,13 @@ MyPipeFrame::MyPipeFrame(wxFrame *parent,
 {
     m_process->SetNextHandler(this);
 
 {
     m_process->SetNextHandler(this);
 
-    wxPanel *panel = new wxPanel(this, -1);
+    wxPanel *panel = new wxPanel(this, wxID_ANY);
 
 
-    m_textIn = new wxTextCtrl(panel, -1, _T(""),
+    m_textIn = new wxTextCtrl(panel, wxID_ANY, _T(""),
                               wxDefaultPosition, wxDefaultSize,
                               wxTE_PROCESS_ENTER);
                               wxDefaultPosition, wxDefaultSize,
                               wxTE_PROCESS_ENTER);
-    m_textOut = new wxTextCtrl(panel, -1, _T(""));
-    m_textOut->SetEditable(FALSE);
+    m_textOut = new wxTextCtrl(panel, wxID_ANY, _T(""));
+    m_textOut->SetEditable(false);
 
     wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
     sizerTop->Add(m_textIn, 0, wxGROW | wxALL, 5);
 
     wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
     sizerTop->Add(m_textIn, 0, wxGROW | wxALL, 5);
index 162fce3ef2647daa6fb9d6f3429ac2f1cd0afd75..aa0f22e7f674951937dc387728c5eef63780ed92 100644 (file)
@@ -127,7 +127,7 @@ private:
 class MyApp : public wxApp
 {
 public:
 class MyApp : public wxApp
 {
 public:
-    virtual bool OnInit() { (new MyFrame())->Show(); return TRUE; }
+    virtual bool OnInit() { (new MyFrame())->Show(); return true; }
 };
 
 // ----------------------------------------------------------------------------
 };
 
 // ----------------------------------------------------------------------------
@@ -192,7 +192,7 @@ IMPLEMENT_APP(MyApp)
 
 // frame constructor
 MyFrame::MyFrame()
 
 // frame constructor
 MyFrame::MyFrame()
-       : wxFrame(NULL, -1, _T("HtmlLbox wxWidgets Sample"),
+       : wxFrame(NULL, wxID_ANY, _T("HtmlLbox wxWidgets Sample"),
                  wxDefaultPosition, wxSize(400, 500))
 {
     // set the frame icon
                  wxDefaultPosition, wxSize(400, 500))
 {
     // set the frame icon
@@ -248,7 +248,7 @@ MyFrame::MyFrame()
 
     // create the child controls
     m_hlbox = new MyHtmlListBox(this);
 
     // create the child controls
     m_hlbox = new MyHtmlListBox(this);
-    wxTextCtrl *text = new wxTextCtrl(this, -1, _T(""),
+    wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""),
                                       wxDefaultPosition, wxDefaultSize,
                                       wxTE_MULTILINE);
     delete wxLog::SetActiveTarget(new wxLogTextCtrl(text));
                                       wxDefaultPosition, wxDefaultSize,
                                       wxTE_MULTILINE);
     delete wxLog::SetActiveTarget(new wxLogTextCtrl(text));
@@ -272,8 +272,8 @@ MyFrame::~MyFrame()
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
-    // TRUE is to force the frame to close
-    Close(TRUE);
+    // true is to force the frame to close
+    Close(true);
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -398,7 +398,7 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event)
 // ============================================================================
 
 MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi)
 // ============================================================================
 
 MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi)
-             : wxHtmlListBox(parent, -1, wxDefaultPosition, wxDefaultSize,
+             : wxHtmlListBox(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                              multi ? wxLB_MULTIPLE : 0)
 {
     m_change = true;
                              multi ? wxLB_MULTIPLE : 0)
 {
     m_change = true;