]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/mdig.cpp
eVC3 warning fix.
[wxWidgets.git] / src / generic / mdig.cpp
index ea08482ba25906eb8ffa68df9192a1bbb4996c0c..0e2f44031ca7d278c6877bee3d41899289414798 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     29/07/2002
 // RCS-ID:      $Id$
 // Copyright:   (c) Hans Van Leemputten
 // Created:     29/07/2002
 // RCS-ID:      $Id$
 // Copyright:   (c) Hans Van Leemputten
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ===========================================================================
 /////////////////////////////////////////////////////////////////////////////
 
 // ===========================================================================
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "mdig.h"
 #endif
 
     #pragma implementation "mdig.h"
 #endif
 
@@ -51,7 +51,9 @@ enum MDI_MENU_ID
 IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIParentFrame, wxFrame)
 
 BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame)
 IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIParentFrame, wxFrame)
 
 BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame)
-    EVT_MENU (-1, wxGenericMDIParentFrame::DoHandleMenu)
+#if wxUSE_MENUS
+    EVT_MENU (wxID_ANY, wxGenericMDIParentFrame::DoHandleMenu)
+#endif
 END_EVENT_TABLE()
 
 wxGenericMDIParentFrame::wxGenericMDIParentFrame()
 END_EVENT_TABLE()
 
 wxGenericMDIParentFrame::wxGenericMDIParentFrame()
@@ -121,7 +123,7 @@ bool wxGenericMDIParentFrame::Create(wxWindow *parent,
 
   OnCreateClient();
 
 
   OnCreateClient();
 
-  return TRUE;
+  return true;
 }
 
 #if wxUSE_MENUS
 }
 
 #if wxUSE_MENUS
@@ -190,12 +192,12 @@ bool wxGenericMDIParentFrame::ProcessEvent(wxEvent& event)
     // Stops the same event being processed repeatedly
     static wxEventType inEvent = wxEVT_NULL;
     if (inEvent == event.GetEventType())
     // Stops the same event being processed repeatedly
     static wxEventType inEvent = wxEVT_NULL;
     if (inEvent == event.GetEventType())
-        return FALSE;
+        return false;
 
     inEvent = event.GetEventType();
 
     // Let the active child (if any) process the event first.
 
     inEvent = event.GetEventType();
 
     // Let the active child (if any) process the event first.
-    bool res = FALSE;
+    bool res = false;
     if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent))
 #if 0
         /* This is sure to not give problems... */
     if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent))
 #if 0
         /* This is sure to not give problems... */
@@ -256,7 +258,7 @@ void wxGenericMDIParentFrame::ActivateNext()
 {
     if (m_pClientWindow && m_pClientWindow->GetSelection() != -1)
     {
 {
     if (m_pClientWindow && m_pClientWindow->GetSelection() != -1)
     {
-        int active = m_pClientWindow->GetSelection() + 1;
+        size_t active = m_pClientWindow->GetSelection() + 1;
         if (active >= m_pClientWindow->GetPageCount())
             active = 0;
 
         if (active >= m_pClientWindow->GetPageCount())
             active = 0;
 
@@ -406,18 +408,18 @@ wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
 
     if (pParentFrame != NULL)
     {
 
     if (pParentFrame != NULL)
     {
-        bool bActive = FALSE;
+        bool bActive = false;
         if (pParentFrame->GetActiveChild() == this)
         {
             pParentFrame->SetActiveChild((wxGenericMDIChildFrame*) NULL);
             pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) NULL);
         if (pParentFrame->GetActiveChild() == this)
         {
             pParentFrame->SetActiveChild((wxGenericMDIChildFrame*) NULL);
             pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) NULL);
-            bActive = TRUE;
+            bActive = true;
         }
 
         wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow();
 
         // Remove page if still there
         }
 
         wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow();
 
         // Remove page if still there
-        int pos;
+        size_t pos;
         for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
         {
             if (pClientWindow->GetPage(pos) == this)
         for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
         {
             if (pClientWindow->GetPage(pos) == this)
@@ -437,7 +439,7 @@ wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
             }
             else
             {
             }
             else
             {
-                if (pClientWindow->GetPageCount() - 1 >= 0)
+                if ((int)pClientWindow->GetPageCount() - 1 >= 0)
                     pClientWindow->SetSelection(pClientWindow->GetPageCount() - 1);
             }
         }
                     pClientWindow->SetSelection(pClientWindow->GetPageCount() - 1);
             }
         }
@@ -466,11 +468,11 @@ bool wxGenericMDIChildFrame::Create( wxGenericMDIParentFrame *parent,
 
     m_Title = title;
 
 
     m_Title = title;
 
-    pClientWindow->AddPage(this, title, TRUE);
+    pClientWindow->AddPage(this, title, true);
     ApplyMDIChildFrameRect();   // Ok confirme the size change!
     pClientWindow->Refresh();
 
     ApplyMDIChildFrameRect();   // Ok confirme the size change!
     pClientWindow->Refresh();
 
-    return TRUE;
+    return true;
 }
 
 #if wxUSE_MENUS
 }
 
 #if wxUSE_MENUS
@@ -516,7 +518,7 @@ void wxGenericMDIChildFrame::SetTitle(const wxString& title)
 
         if (pClientWindow != NULL)
         {
 
         if (pClientWindow != NULL)
         {
-            int pos;
+            size_t pos;
             for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
             {
                 if (pClientWindow->GetPage(pos) == this)
             for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
             {
                 if (pClientWindow->GetPage(pos) == this)
@@ -544,7 +546,7 @@ void wxGenericMDIChildFrame::Activate()
 
         if (pClientWindow != NULL)
         {
 
         if (pClientWindow != NULL)
         {
-            int pos;
+            size_t pos;
             for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
             {
                 if (pClientWindow->GetPage(pos) == this)
             for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
             {
                 if (pClientWindow->GetPage(pos) == this)
@@ -566,10 +568,12 @@ void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event)
         // but may be the MDI frame does?
         m_pMDIParentFrame->OnMenuHighlight(event);
     }
         // but may be the MDI frame does?
         m_pMDIParentFrame->OnMenuHighlight(event);
     }
+#else
+    wxUnusedVar(event);
 #endif // wxUSE_STATUSBAR
 }
 
 #endif // wxUSE_STATUSBAR
 }
 
-void wxGenericMDIChildFrame::OnActivate(wxActivateEvent& event)
+void wxGenericMDIChildFrame::OnActivate(wxActivateEvent& WXUNUSED(event))
 {
     // Do mothing.
 }
 {
     // Do mothing.
 }
@@ -588,7 +592,7 @@ void wxGenericMDIChildFrame::OnSize(wxSizeEvent& WXUNUSED(event))
     {
         // do we have _exactly_ one child?
         wxWindow *child = (wxWindow *)NULL;
     {
         // do we have _exactly_ one child?
         wxWindow *child = (wxWindow *)NULL;
-        for ( wxWindowList::Node *node = GetChildren().GetFirst();
+        for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
               node;
               node = node->GetNext() )
         {
               node;
               node = node->GetNext() )
         {
@@ -706,13 +710,13 @@ bool wxGenericMDIClientWindow::CreateClient( wxGenericMDIParentFrame *parent, lo
         GetTabView()->SetTabSize(120, 18);
         GetTabView()->SetTabSelectionHeight(20);
         */
         GetTabView()->SetTabSize(120, 18);
         GetTabView()->SetTabSelectionHeight(20);
         */
-        return TRUE;
+        return true;
     }
     else
     }
     else
-        return FALSE;
+        return false;
 }
 
 }
 
-int wxGenericMDIClientWindow::SetSelection(int nPage)
+int wxGenericMDIClientWindow::SetSelection(size_t nPage)
 {
     int oldSelection = wxNotebook::SetSelection(nPage);
 
 {
     int oldSelection = wxNotebook::SetSelection(nPage);
 
@@ -745,7 +749,7 @@ void wxGenericMDIClientWindow::PageChanged(int OldSelection, int newSelection)
         wxGenericMDIChildFrame* oldChild = (wxGenericMDIChildFrame *)GetPage(OldSelection);
         if (oldChild)
         {
         wxGenericMDIChildFrame* oldChild = (wxGenericMDIChildFrame *)GetPage(OldSelection);
         if (oldChild)
         {
-            wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldChild->GetId());
+            wxActivateEvent event(wxEVT_ACTIVATE, false, oldChild->GetId());
             event.SetEventObject( oldChild );
             oldChild->GetEventHandler()->ProcessEvent(event);
         }
             event.SetEventObject( oldChild );
             oldChild->GetEventHandler()->ProcessEvent(event);
         }
@@ -757,7 +761,7 @@ void wxGenericMDIClientWindow::PageChanged(int OldSelection, int newSelection)
         wxGenericMDIChildFrame* activeChild = (wxGenericMDIChildFrame *)GetPage(newSelection);
         if (activeChild)
         {
         wxGenericMDIChildFrame* activeChild = (wxGenericMDIChildFrame *)GetPage(newSelection);
         if (activeChild)
         {
-            wxActivateEvent event(wxEVT_ACTIVATE, TRUE, activeChild->GetId());
+            wxActivateEvent event(wxEVT_ACTIVATE, true, activeChild->GetId());
             event.SetEventObject( activeChild );
             activeChild->GetEventHandler()->ProcessEvent(event);
 
             event.SetEventObject( activeChild );
             activeChild->GetEventHandler()->ProcessEvent(event);
 
@@ -781,7 +785,7 @@ void wxGenericMDIClientWindow::OnSize(wxSizeEvent& event)
 {
     wxNotebook::OnSize(event);
 
 {
     wxNotebook::OnSize(event);
 
-    int pos;
+    size_t pos;
     for (pos = 0; pos < GetPageCount(); pos++)
     {
         ((wxGenericMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect();
     for (pos = 0; pos < GetPageCount(); pos++)
     {
         ((wxGenericMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect();