X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3b3dc8019a520ce5e166c8ae9098ba020f8b3f94..c895624b1353d96d7cf1f1ea9581fe81792499dc:/src/motif/mdi.cpp diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp index 1ddc29573e..998bc5d107 100644 --- a/src/motif/mdi.cpp +++ b/src/motif/mdi.cpp @@ -12,20 +12,14 @@ // 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 @@ -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()) {