From 71a0f42d2a5606098e3e7abbb50b9bb1cd718f9e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 11 Aug 2010 16:03:55 +0000 Subject: [PATCH] Make wxTopLevelWindow::GetDefaultSize() public and document it. This method is/will be needed by wxNonOwnedWindow in wxOSX but couldn't be used as long as it was protected, so make it public. And as it seems that it might be useful outside of wx itself, document it as well. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/toplevel.h | 8 ++++---- interface/wx/toplevel.h | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 8fcb9830d9..903a22cdce 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -247,6 +247,10 @@ public: void CentreOnScreen(int dir = wxBOTH) { DoCentre(dir | wxCENTRE_ON_SCREEN); } void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); } + // Get the default size for a new top level window. This is used when + // creating a wxTLW under some platforms if no explicit size given. + static wxSize GetDefaultSize(); + // default item access: we have a permanent default item which is the one // set by the user code but we may also have a temporary default item which @@ -331,10 +335,6 @@ protected: // client area void DoLayout(); - // Get the default size for the new window if no explicit size given. If - // there are better default sizes then these can be changed, just as long - // as they are not too small for TLWs (and not larger than screen). - static wxSize GetDefaultSize(); static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; } static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; } diff --git a/interface/wx/toplevel.h b/interface/wx/toplevel.h index a59e5e8bbe..5afa28037f 100644 --- a/interface/wx/toplevel.h +++ b/interface/wx/toplevel.h @@ -148,6 +148,19 @@ public: */ wxWindow* GetDefaultItem() const; + /** + Get the default size for a new top level window. + + This is used internally by wxWidgets on some platforms to determine the + default size for a window created using ::wxDefaultSize so it is not + necessary to use it when creating a wxTopLevelWindow, however it may be + useful if a rough estimation of the window size is needed for some + other reason. + + @since 2.9.2 + */ + static wxSize GetDefaultSize(); + /** Returns the standard icon of the window. The icon will be invalid if it hadn't been previously set by SetIcon(). -- 2.45.2