X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0492c5a094d1baac126331385d66d2f66aa5db52..40dac23a6acb19fdb7c42e9f229b5774e57fda6b:/src/motif/mdi.cpp diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp index f6d2dc6e6b..bace16b9f9 100644 --- a/src/motif/mdi.cpp +++ b/src/motif/mdi.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -37,10 +36,6 @@ extern wxList wxModelessWindows; extern void wxFrameFocusProc(Widget workArea, XtPointer clientData, XmAnyCallbackStruct *cbs); -// From wxWindow -extern void wxCanvasRepaintProc (Widget, XtPointer, XmDrawingAreaCallbackStruct * cbs); -extern void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallbackStruct * cbs); - #define wxID_NOTEBOOK_CLIENT_AREA wxID_HIGHEST + 100 #if !USE_SHARED_LIBRARY @@ -49,17 +44,17 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxNotebook) BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) -EVT_SIZE(wxMDIParentFrame::OnSize) -EVT_ACTIVATE(wxMDIParentFrame::OnActivate) -EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) + EVT_SIZE(wxMDIParentFrame::OnSize) + EVT_ACTIVATE(wxMDIParentFrame::OnActivate) + EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) END_EVENT_TABLE() BEGIN_EVENT_TABLE(wxMDIClientWindow, wxNotebook) -EVT_SCROLL(wxMDIClientWindow::OnScroll) -EVT_NOTEBOOK_PAGE_CHANGED(wxID_NOTEBOOK_CLIENT_AREA, wxMDIClientWindow::OnPageChanged) + EVT_SCROLL(wxMDIClientWindow::OnScroll) + EVT_NOTEBOOK_PAGE_CHANGED(wxID_NOTEBOOK_CLIENT_AREA, wxMDIClientWindow::OnPageChanged) END_EVENT_TABLE() -#endif +#endif // USE_SHARED_LIBRARY // Parent frame @@ -114,12 +109,6 @@ wxMDIParentFrame::~wxMDIParentFrame() m_clientWindow = NULL; } -// Get size *available for subwindows* i.e. excluding menu bar. -void wxMDIParentFrame::GetClientSize(int *x, int *y) const -{ - wxFrame::GetClientSize(x, y); -} - void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) { m_frameMenuBar = menu_bar; @@ -142,6 +131,11 @@ void wxMDIParentFrame::OnSize(wxSizeEvent& event) GetClientWindow()->SetSize(x, y, width, height); } +void wxMDIParentFrame::GetClientSize(int *width, int *height) const +{ + wxFrame::GetClientSize(width, height); +} + void wxMDIParentFrame::OnActivate(wxActivateEvent& event) { // Do nothing @@ -242,6 +236,18 @@ bool wxMDIParentFrame::ProcessEvent(wxEvent& event) return res; } +void wxMDIParentFrame::DoSetSize(int x, int y, + int width, int height, + int sizeFlags) +{ + wxWindow::DoSetSize(x, y, width, height, sizeFlags); +} + +void wxMDIParentFrame::DoSetClientSize(int width, int height) +{ + wxWindow::DoSetClientSize(width, height); +} + // Responds to colour changes, and passes event on to children. void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { @@ -345,9 +351,10 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, */ XmNresizePolicy, XmRESIZE_NONE, NULL); - - XtAddCallback ((Widget) m_mainWidget, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this); + XtAddEventHandler((Widget) m_mainWidget, ExposureMask,FALSE, + wxUniversalRepaintProc, (XtPointer) this); + SetCanAddEventHandler(TRUE); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); @@ -370,8 +377,10 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, wxMDIChildFrame::~wxMDIChildFrame() { - XtRemoveCallback ((Widget) m_mainWidget, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this); - + if (m_mainWidget) + XtRemoveEventHandler((Widget) m_mainWidget, ExposureMask,FALSE, + wxUniversalRepaintProc, (XtPointer) this); + if (GetMDIParentFrame()) { wxMDIParentFrame* parentFrame = GetMDIParentFrame(); @@ -438,9 +447,9 @@ void wxMDIChildFrame::OnLower() // Set the client size (i.e. leave the calculation of borders etc. // to wxWindows) -void wxMDIChildFrame::SetClientSize(int width, int height) +void wxMDIChildFrame::DoSetClientSize(int width, int height) { - wxWindow::SetClientSize(width, height); + wxWindow::DoSetClientSize(width, height); } void wxMDIChildFrame::GetClientSize(int* width, int* height) const @@ -448,9 +457,9 @@ void wxMDIChildFrame::GetClientSize(int* width, int* height) const wxWindow::GetSize(width, height); } -void wxMDIChildFrame::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags) { - wxWindow::SetSize(x, y, width, height, sizeFlags); + wxWindow::DoSetSize(x, y, width, height, sizeFlags); } void wxMDIChildFrame::GetSize(int* width, int* height) const @@ -592,14 +601,14 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) return FALSE; } -void wxMDIClientWindow::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags) { - wxWindow::SetSize(x, y, width, height, sizeFlags); + wxWindow::DoSetSize(x, y, width, height, sizeFlags); } -void wxMDIClientWindow::SetClientSize(int width, int height) +void wxMDIClientWindow::DoSetClientSize(int width, int height) { - wxWindow::SetClientSize(width, height); + wxWindow::DoSetClientSize(width, height); } void wxMDIClientWindow::GetClientSize(int *width, int *height) const