virtual bool Destroy();
- void GetClientSize(int *width, int *height) const;
- void GetSize(int *width, int *height) const ;
- void GetPosition(int *x, int *y) const ;
-
- wxSize GetSize() const { return wxWindow::GetSize(); }
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
- wxSize GetClientSize() const { return wxWindow::GetClientSize(); }
-
void ClientToScreen(int *x, int *y) const;
wxPoint ClientToScreen(const wxPoint& pt) const { return wxWindow::ClientToScreen(pt); }
bool PreResize();
+protected:
+ void DoGetClientSize(int *width, int *height) const;
+ void DoGetSize(int *width, int *height) const ;
+ void DoGetPosition(int *x, int *y) const ;
+
protected:
wxMenuBar * m_frameMenuBar;
wxStatusBar * m_frameStatusBar;
void OnSize(wxSizeEvent& event);
void OnActivate(wxActivateEvent& event);
void OnSysColourChanged(wxSysColourChangedEvent& event);
+ void OnMenuHighlight(wxMenuEvent& event);
void SetMenuBar(wxMenuBar *menu_bar);
- // Gets the size available for subwindows after menu size, toolbar size
- // and status bar size have been subtracted. If you want to manage your own
- // toolbar(s), don't call SetToolBar.
- void GetClientSize(int *width, int *height) const;
- wxSize GetClientSize() const { return wxWindow::GetClientSize(); }
-
// Get the active MDI child window
wxMDIChildFrame *GetActiveChild() const ;
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
+ // Gets the size available for subwindows after menu size, toolbar size
+ // and status bar size have been subtracted. If you want to manage your own
+ // toolbar(s), don't call SetToolBar.
+ void DoGetClientSize(int *width, int *height) const;
protected:
void SetMenuBar(wxMenuBar *menu_bar);
void SetTitle(const wxString& title);
- void GetClientSize(int *width, int *height) const;
- void GetSize(int *width, int *height) const;
- void GetPosition(int *x, int *y) const ;
-
// Set icon
virtual void SetIcon(const wxIcon& icon);
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
+
+ void DoGetClientSize(int *width, int *height) const;
+ void DoGetSize(int *width, int *height) const;
+ void DoGetPosition(int *x, int *y) const ;
};
/* The client window is a child of the parent MDI frame, and itself
~wxMDIClientWindow();
- void GetClientSize(int *width, int *height) const;
- void GetSize(int *width, int *height) const ;
- void GetPosition(int *x, int *y) const ;
-
// Note: this is virtual, to allow overridden behaviour.
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
+ void DoGetClientSize(int *width, int *height) const;
+ void DoGetSize(int *width, int *height) const ;
+ void DoGetPosition(int *x, int *y) const ;
+
+
private:
DECLARE_EVENT_TABLE()
};
}
// Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
-void wxFrame::GetClientSize(int *x, int *y) const
+void wxFrame::DoGetClientSize(int *x, int *y) const
{
Dimension xx, yy;
XtVaGetValues((Widget) m_workArea, XmNwidth, &xx, XmNheight, &yy, NULL);
}
-void wxFrame::GetSize(int *width, int *height) const
+void wxFrame::DoGetSize(int *width, int *height) const
{
Dimension xx, yy;
XtVaGetValues((Widget) m_frameShell, XmNwidth, &xx, XmNheight, &yy, NULL);
*width = xx; *height = yy;
}
-void wxFrame::GetPosition(int *x, int *y) const
+void wxFrame::DoGetPosition(int *x, int *y) const
{
Window parent_window = XtWindow((Widget) m_frameShell),
next_parent = XtWindow((Widget) m_frameShell),
EVT_SIZE(wxMDIParentFrame::OnSize)
EVT_ACTIVATE(wxMDIParentFrame::OnActivate)
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
+ EVT_MENU_HIGHLIGHT_ALL(wxMDIParentFrame::OnMenuHighlight)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxMDIClientWindow, wxNotebook)
GetClientWindow()->SetSize(x, y, width, height);
}
-void wxMDIParentFrame::GetClientSize(int *width, int *height) const
+void wxMDIParentFrame::DoGetClientSize(int *width, int *height) const
{
- wxFrame::GetClientSize(width, height);
+ wxFrame::DoGetClientSize(width, height);
}
void wxMDIParentFrame::OnActivate(wxActivateEvent& WXUNUSED(event))
// TODO
}
+// Default menu selection behaviour - display a help string
+void wxMDIParentFrame::OnMenuHighlight(wxMenuEvent& event)
+{
+ if (GetStatusBar())
+ {
+ if (event.GetMenuId() == -1)
+ SetStatusText("");
+ else
+ {
+ wxMenuBar *menuBar = (wxMenuBar*) NULL;
+ if (GetActiveChild())
+ menuBar = GetActiveChild()->GetMenuBar();
+ else
+ menuBar = GetMenuBar();
+ if (menuBar)
+ {
+ wxString helpString(menuBar->GetHelpString(event.GetMenuId()));
+ if (helpString != "")
+ SetStatusText(helpString);
+ }
+ }
+ }
+}
+
// Child frame
wxMDIChildFrame::wxMDIChildFrame()
wxWindow::DoSetClientSize(width, height);
}
-void wxMDIChildFrame::GetClientSize(int* width, int* height) const
+void wxMDIChildFrame::DoGetClientSize(int* width, int* height) const
{
- wxWindow::GetSize(width, height);
+ wxWindow::DoGetSize(width, height);
}
void wxMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
-void wxMDIChildFrame::GetSize(int* width, int* height) const
+void wxMDIChildFrame::DoGetSize(int* width, int* height) const
{
- wxWindow::GetSize(width, height);
+ wxWindow::DoGetSize(width, height);
}
-void wxMDIChildFrame::GetPosition(int *x, int *y) const
+void wxMDIChildFrame::DoGetPosition(int *x, int *y) const
{
- wxWindow::GetPosition(x, y);
+ wxWindow::DoGetPosition(x, y);
}
bool wxMDIChildFrame::Show(bool show)
wxWindow::DoSetClientSize(width, height);
}
-void wxMDIClientWindow::GetClientSize(int *width, int *height) const
+void wxMDIClientWindow::DoGetClientSize(int *width, int *height) const
{
- wxWindow::GetClientSize(width, height);
+ wxWindow::DoGetClientSize(width, height);
}
-void wxMDIClientWindow::GetSize(int *width, int *height) const
+void wxMDIClientWindow::DoGetSize(int *width, int *height) const
{
- wxWindow::GetSize(width, height);
+ wxWindow::DoGetSize(width, height);
}
-void wxMDIClientWindow::GetPosition(int *x, int *y) const
+void wxMDIClientWindow::DoGetPosition(int *x, int *y) const
{
- wxWindow::GetPosition(x, y);
+ wxWindow::DoGetPosition(x, y);
}
// Explicitly call default scroll behaviour