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
This commit is contained in:
Vadim Zeitlin 2010-08-11 16:03:55 +00:00
parent 06cfc05269
commit 71a0f42d2a
2 changed files with 17 additions and 4 deletions

View File

@ -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; }

View File

@ -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().