]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/mdig.cpp
Instead of m_menuBar use GetMenuBar() which will be modified (with next patch)
[wxWidgets.git] / src / generic / mdig.cpp
index ea08482ba25906eb8ffa68df9192a1bbb4996c0c..e0b951be0e7b369d28c20b8b8bc1dc49d85431ba 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     29/07/2002
 // RCS-ID:      $Id$
 // Copyright:   (c) Hans Van Leemputten
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ===========================================================================
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "mdig.h"
 #endif
 
@@ -51,7 +51,9 @@ enum MDI_MENU_ID
 IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIParentFrame, wxFrame)
 
 BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame)
+#if wxUSE_MENUS
     EVT_MENU (-1, wxGenericMDIParentFrame::DoHandleMenu)
+#endif
 END_EVENT_TABLE()
 
 wxGenericMDIParentFrame::wxGenericMDIParentFrame()
@@ -256,7 +258,7 @@ void wxGenericMDIParentFrame::ActivateNext()
 {
     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;
 
@@ -417,7 +419,7 @@ wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
         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)
@@ -437,7 +439,7 @@ wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
             }
             else
             {
-                if (pClientWindow->GetPageCount() - 1 >= 0)
+                if ((int)pClientWindow->GetPageCount() - 1 >= 0)
                     pClientWindow->SetSelection(pClientWindow->GetPageCount() - 1);
             }
         }
@@ -516,7 +518,7 @@ void wxGenericMDIChildFrame::SetTitle(const wxString& title)
 
         if (pClientWindow != NULL)
         {
-            int pos;
+            size_t pos;
             for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
             {
                 if (pClientWindow->GetPage(pos) == this)
@@ -544,7 +546,7 @@ void wxGenericMDIChildFrame::Activate()
 
         if (pClientWindow != NULL)
         {
-            int pos;
+            size_t pos;
             for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
             {
                 if (pClientWindow->GetPage(pos) == this)
@@ -569,7 +571,7 @@ void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event)
 #endif // wxUSE_STATUSBAR
 }
 
-void wxGenericMDIChildFrame::OnActivate(wxActivateEvent& event)
+void wxGenericMDIChildFrame::OnActivate(wxActivateEvent& WXUNUSED(event))
 {
     // Do mothing.
 }
@@ -588,7 +590,7 @@ void wxGenericMDIChildFrame::OnSize(wxSizeEvent& WXUNUSED(event))
     {
         // 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() )
         {
@@ -712,7 +714,7 @@ bool wxGenericMDIClientWindow::CreateClient( wxGenericMDIParentFrame *parent, lo
         return FALSE;
 }
 
-int wxGenericMDIClientWindow::SetSelection(int nPage)
+int wxGenericMDIClientWindow::SetSelection(size_t nPage)
 {
     int oldSelection = wxNotebook::SetSelection(nPage);
 
@@ -781,7 +783,7 @@ void wxGenericMDIClientWindow::OnSize(wxSizeEvent& event)
 {
     wxNotebook::OnSize(event);
 
-    int pos;
+    size_t pos;
     for (pos = 0; pos < GetPageCount(); pos++)
     {
         ((wxGenericMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect();