#endif // wxUSE_STATUSBAR
// override wxWindow methods to take into account tool/menu/statusbars
- virtual void DoSetClientSize(int width, int height);
virtual void DoGetClientSize( int *width, int *height ) const;
#if wxUSE_MENUS_NATIVE
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
- virtual void DoSetClientSize(int width, int height);
- virtual void DoGetClientSize( int *width, int *height ) const;
private:
DECLARE_EVENT_TABLE()
// common part of all ctors
void Init();
- // move the window to the specified location and resize it: this is called
- // from both DoSetSize() and DoSetClientSize()
+ // move the window to the specified location and resize it
virtual void DoMoveWindow(int x, int y, int width, int height);
// take into account WM decorations here
int sizeFlags = wxSIZE_AUTO);
// override these methods to take into account tool/menu/statusbars
- virtual void DoSetClientSize(int width, int height);
virtual void DoGetClientSize(int *width, int *height) const;
// this method takes the size of the window not taking account of
- // decorations and is used by both DoSetSize() and DoSetClientSize()
+ // decorations
void GTKDoSetSize(int width, int height);
*height = 0;
}
-void wxFrame::DoSetClientSize( int width, int height )
-{
- wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
-
-#if wxUSE_MENUS_NATIVE
- // menu bar
- if (m_frameMenuBar && !(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOMENUBAR) != 0))
- {
- if (!m_menuBarDetached)
- height += m_menuBarHeight;
- else
- height += wxPLACE_HOLDER;
- }
-#endif // wxUSE_MENUS_NATIVE
-
-#if wxUSE_STATUSBAR
- // status bar
- if (m_frameStatusBar && m_frameStatusBar->IsShown() &&
- !(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOSTATUSBAR) != 0))
- height += wxSTATUS_HEIGHT;
-#endif
-
-#if wxUSE_TOOLBAR
- // tool bar
- if (m_frameToolBar && m_frameToolBar->IsShown())
- {
- if (m_toolBarDetached)
- {
- height += wxPLACE_HOLDER;
- }
- else
- {
- int x, y;
- m_frameToolBar->GetSize( &x, &y );
- if ( m_frameToolBar->IsVertical() )
- {
- width += x;
- }
- else
- {
- height += y;
- }
- }
- }
-#endif
-
- wxTopLevelWindow::DoSetClientSize( width, height );
-}
-
void wxFrame::GtkOnSize()
{
// avoid recursions
wxWindow::DoSetSize( x, y, width, height, sizeFlags );
}
-void wxMDIChildFrame::DoSetClientSize(int width, int height)
-{
- wxWindow::DoSetClientSize( width, height );
-}
-
-void wxMDIChildFrame::DoGetClientSize( int *width, int *height ) const
-{
- wxWindow::DoGetClientSize( width, height );
-}
-
void wxMDIChildFrame::AddChild( wxWindowBase *child )
{
wxWindow::AddChild(child);
}
}
-void wxTopLevelWindowGTK::DoSetClientSize( int width, int height )
-{
- GTKDoSetSize(width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle);
-}
-
void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH,
int maxW, int maxH,
int incW, int incH )
{
wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
- if (m_wxwindow)
- {
- int dw = 0;
- int dh = 0;
-
- if (m_hasScrolling)
- {
- GetScrollbarWidth(m_widget, dw, dh);
- }
-
- const int border = GTK_CONTAINER(m_wxwindow)->border_width;
- dw += 2 * border;
- dh += 2 * border;
-
- width += dw;
- height += dh;
- }
-
- SetSize(width, height);
+ const wxSize size = GetSize();
+ const wxSize clientSize = GetClientSize();
+ SetSize(width + (size.x - clientSize.x), height + (size.y - clientSize.y));
}
void wxWindowGTK::DoGetClientSize( int *width, int *height ) const