]> 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 1ddc29573e7db0a45ac79e3807a22eee02c7e73a..b0975e621ed4cd6973fa7715b7c0bbf794948b57 100644 (file)
 // 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"
 
 #ifndef WX_PRECOMP
     #include "wx/menu.h"
+    #include "wx/icon.h"
+    #include "wx/settings.h"
 #endif
 
-#include "wx/settings.h"
-#include "wx/icon.h"
-
 #ifdef __VMS__
 #pragma message disable nosimpint
 #endif
@@ -239,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)
@@ -339,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
@@ -350,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;
@@ -369,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
@@ -394,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);
@@ -465,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()
@@ -482,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.
@@ -641,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
@@ -697,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)
@@ -707,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)
@@ -717,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())
             {