]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/mdi.cpp
fix focus problems in picker controls under MSW which were due to not letting the...
[wxWidgets.git] / src / motif / mdi.cpp
index 09894eea98dfcd3f726b9d0e898bb98ab22bd1f9..998bc5d107c1a786f5e6c4fcfd606d4503972324 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
@@ -238,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)
@@ -338,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
@@ -349,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;
@@ -368,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
@@ -393,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);
@@ -464,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()
@@ -481,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.
@@ -640,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
@@ -706,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)
@@ -716,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())
             {