]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/mdi.cpp
add parentheses for && inside || to fix g++ 4.3 warning
[wxWidgets.git] / src / motif / mdi.cpp
index 5404741cfefea14713f64c1f1fbb35ee8a5fba47..b0975e621ed4cd6973fa7715b7c0bbf794948b57 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        mdi.cpp
+// Name:        src/motif/mdi.cpp
 // Purpose:     MDI classes
 // Author:      Julian Smart
 // Modified by:
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#ifdef __VMS
-#define XtDisplay XTDISPLAY
-#define XtWindow XTWINDOW
-#endif
-
 #include "wx/mdi.h"
-#include "wx/menu.h"
-#include "wx/settings.h"
-#include "wx/icon.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/menu.h"
+    #include "wx/icon.h"
+    #include "wx/settings.h"
+#endif
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -235,7 +233,7 @@ bool wxMDIParentFrame::ProcessEvent(wxEvent& event)
     bool res = false;
     if (m_activeChild && event.IsKindOf(CLASSINFO(wxCommandEvent)))
     {
-        res = m_activeChild->GetEventHandler()->ProcessEvent(event);
+        res = m_activeChild->HandleWindowEvent(event);
     }
 
     if (!res)
@@ -299,7 +297,7 @@ void wxMDIParentFrame::OnMenuHighlight(wxMenuEvent& event)
     if (GetStatusBar())
     {
         if (event.GetMenuId() == -1)
-            SetStatusText("");
+            SetStatusText(wxEmptyString);
         else
         {
             wxMenuBar *menuBar = (wxMenuBar*) NULL;
@@ -310,7 +308,7 @@ void wxMDIParentFrame::OnMenuHighlight(wxMenuEvent& event)
             if (menuBar)
             {
                 wxString helpString(menuBar->GetHelpString(event.GetMenuId()));
-                if (helpString != "")
+                if (!helpString.empty())
                     SetStatusText(helpString);
             }
         }
@@ -335,10 +333,6 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
     SetName(name);
     SetWindowStyleFlag(style);
 
-    m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
-    m_foregroundColour = *wxBLACK;
-    m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
-
     if ( id > -1 )
         m_windowId = id;
     else
@@ -346,11 +340,12 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
     wxMDIClientWindow* clientWindow = parent->GetClientWindow();
 
-    wxASSERT_MSG( (clientWindow != (wxWindow*) NULL), "Missing MDI client window.");
+    wxCHECK_MSG( clientWindow, false, "Missing MDI client window." );
 
-    if (clientWindow) clientWindow->AddChild(this);
+    clientWindow->AddChild(this);
 
     SetMDIParentFrame(parent);
+    PreCreation();
 
     int width = size.x;
     int height = size.y;
@@ -365,7 +360,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
     {
         wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId());
         event.SetEventObject( oldActiveChild );
-        oldActiveChild->GetEventHandler()->ProcessEvent(event);
+        oldActiveChild->HandleWindowEvent(event);
     }
 
     // This is the currently active child
@@ -390,10 +385,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
     XtAddEventHandler((Widget) m_mainWidget, ExposureMask,False,
         wxUniversalRepaintProc, (XtPointer) this);
 
+    PostCreation();
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
-    ChangeBackgroundColour();
-
     XtManageChild((Widget) m_mainWidget);
 
     SetTitle(title);
@@ -461,12 +455,12 @@ void wxMDIChildFrame::OnRaise()
     {
         wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId());
         event.SetEventObject( oldActiveChild );
-        oldActiveChild->GetEventHandler()->ProcessEvent(event);
+        oldActiveChild->HandleWindowEvent(event);
     }
 
     wxActivateEvent event(wxEVT_ACTIVATE, true, this->GetId());
     event.SetEventObject( this );
-    this->GetEventHandler()->ProcessEvent(event);
+    this->HandleWindowEvent(event);
 }
 
 void wxMDIChildFrame::OnLower()
@@ -478,7 +472,7 @@ void wxMDIChildFrame::OnLower()
     {
         wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId());
         event.SetEventObject( oldActiveChild );
-        oldActiveChild->GetEventHandler()->ProcessEvent(event);
+        oldActiveChild->HandleWindowEvent(event);
     }
     // TODO: unfortunately we don't now know which is the top-most child,
     // so make the active child NULL.
@@ -637,14 +631,9 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
 {
     SetWindowStyleFlag(style);
 
-    //    m_windowParent = parent;
-    //    m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
-
     bool success = wxNotebook::Create(parent, wxID_NOTEBOOK_CLIENT_AREA, wxPoint(0, 0), wxSize(100, 100), 0);
     if (success)
     {
-        wxFont font(10, wxSWISS, wxNORMAL, wxNORMAL);
-        SetFont(font);
         return true;
     }
     else
@@ -693,7 +682,7 @@ void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
     event.Skip();
 }
 
-void wxMDIClientWindow::OnPageChanged(wxNotebookEvent& event)
+void wxMDIClientWindow::OnPageChanged(wxBookCtrlEvent& event)
 {
     // Notify child that it has been activated
     if (event.GetOldSelection() != -1)
@@ -703,7 +692,7 @@ void wxMDIClientWindow::OnPageChanged(wxNotebookEvent& event)
         {
             wxActivateEvent event(wxEVT_ACTIVATE, false, oldChild->GetId());
             event.SetEventObject( oldChild );
-            oldChild->GetEventHandler()->ProcessEvent(event);
+            oldChild->HandleWindowEvent(event);
         }
     }
     if (event.GetSelection() != -1)
@@ -713,7 +702,7 @@ void wxMDIClientWindow::OnPageChanged(wxNotebookEvent& event)
         {
             wxActivateEvent event(wxEVT_ACTIVATE, true, activeChild->GetId());
             event.SetEventObject( activeChild );
-            activeChild->GetEventHandler()->ProcessEvent(event);
+            activeChild->HandleWindowEvent(event);
 
             if (activeChild->GetMDIParentFrame())
             {