X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1ccbb61aba5a0bbd93ba036ba8e1194e349064f6..00421206821da3373ddc075d63149826b3be38af:/src/motif/frame.cpp diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index 4ea8a6716e..98682e8b99 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -189,12 +189,14 @@ bool wxFrame::Create(wxWindow *parent, XmNbottomAttachment, XmATTACH_FORM, // XmNresizePolicy, XmRESIZE_ANY, NULL); + + XtAddEventHandler((Widget) m_clientArea, ExposureMask,FALSE, + wxUniversalRepaintProc, (XtPointer) this); XtVaSetValues((Widget) m_frameWidget, XmNworkWindow, (Widget) m_workArea, NULL); - XtManageChild((Widget) m_clientArea); XtManageChild((Widget) m_workArea); @@ -287,9 +289,13 @@ bool wxFrame::Create(wxWindow *parent, wxFrame::~wxFrame() { + if (m_clientArea) + XtRemoveEventHandler((Widget) m_clientArea, ExposureMask, FALSE, + wxUniversalRepaintProc, (XtPointer) this); + if (GetMainWidget()) Show(FALSE); - + if (m_frameMenuBar) { m_frameMenuBar->DestroyMenuBar(); @@ -406,7 +412,7 @@ void wxFrame::GetClientSize(int *x, int *y) const // Set the client size (i.e. leave the calculation of borders etc. // to wxWindows) -void wxFrame::SetClientSize(int width, int height) +void wxFrame::DoSetClientSize(int width, int height) { // Calculate how large the new main window should be // by finding the difference between the client area and the @@ -474,7 +480,7 @@ void wxFrame::GetPosition(int *x, int *y) const if (y) *y = yy; } -void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags) { if (x > -1) XtVaSetValues((Widget) m_frameShell, XmNx, x, NULL); @@ -782,21 +788,12 @@ void wxFrame::OnActivate(wxActivateEvent& event) } } -// The default implementation for the close window event - calls +// The default implementation for the close window event. // OnClose for backward compatibility. void wxFrame::OnCloseWindow(wxCloseEvent& event) { - // Compatibility - if ( GetEventHandler()->OnClose() || event.GetForce()) - { - this->Destroy(); - } -} - -bool wxFrame::OnClose() -{ - return TRUE; + this->Destroy(); } // Destroy the window (delayed, if a managed window) @@ -872,7 +869,9 @@ void wxFrame::ProcessCommand(int id) } */ - GetEventHandler()->ProcessEvent(commandEvent); + wxEvtHandler* evtHandler = GetEventHandler(); + + evtHandler->ProcessEvent(commandEvent); } // Checks if there is a toolbar, and returns the first free client position