X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0492c5a094d1baac126331385d66d2f66aa5db52..92049cd473c81fbce934e71796b2d841d5e605fa:/src/motif/frame.cpp diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index d024c6db91..08cb475d7d 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -44,23 +44,20 @@ #include #include #include -#include #if XmVersion > 1000 #include #endif #include "wx/motif/private.h" +extern wxHashTable *wxWidgetHashTable; + void wxCloseFrameCallback(Widget, XtPointer, XmAnyCallbackStruct *cbs); void wxFrameFocusProc(Widget workArea, XtPointer clientData, XmAnyCallbackStruct *cbs); static void wxFrameMapProc(Widget frameShell, XtPointer clientData, XCrossingEvent * event); -// From wxWindow -extern void wxCanvasRepaintProc (Widget, XtPointer, XmDrawingAreaCallbackStruct * cbs); -extern void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallbackStruct * cbs); - extern wxList wxModelessWindows; extern wxList wxPendingDelete; @@ -96,7 +93,7 @@ wxFrame::wxFrame() m_frameMenuBar = NULL; m_frameStatusBar = NULL; - m_windowParent = NULL; + m_parent = NULL; m_iconized = FALSE; //// Motif-specific @@ -138,7 +135,7 @@ bool wxFrame::Create(wxWindow *parent, m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE); m_foregroundColour = *wxBLACK; - m_windowFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); + m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); if ( id > -1 ) m_windowId = id; @@ -194,10 +191,10 @@ bool wxFrame::Create(wxWindow *parent, XmNbottomAttachment, XmATTACH_FORM, // XmNresizePolicy, XmRESIZE_ANY, NULL); - - XtAddCallback ((Widget) m_clientArea, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this); - XtAddCallback ((Widget) m_clientArea, XmNinputCallback, (XtCallbackProc) wxCanvasInputEvent, (XtPointer) this); + XtAddEventHandler((Widget) m_clientArea, ExposureMask,FALSE, + wxUniversalRepaintProc, (XtPointer) this); + XtVaSetValues((Widget) m_frameWidget, XmNworkWindow, (Widget) m_workArea, NULL); @@ -294,12 +291,13 @@ bool wxFrame::Create(wxWindow *parent, wxFrame::~wxFrame() { + if (m_clientArea) + XtRemoveEventHandler((Widget) m_clientArea, ExposureMask, FALSE, + wxUniversalRepaintProc, (XtPointer) this); + if (GetMainWidget()) Show(FALSE); - XtRemoveCallback ((Widget) m_clientArea, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this); - XtRemoveCallback ((Widget) m_clientArea, XmNinputCallback, (XtCallbackProc) wxCanvasInputEvent, (XtPointer) this); - if (m_frameMenuBar) { m_frameMenuBar->DestroyMenuBar(); @@ -416,7 +414,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 @@ -484,7 +482,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); @@ -873,7 +871,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