added CentreOnScreen(), updated the docs to clear this mess a bit

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5807 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-02 18:48:41 +00:00
parent 3fcdd07b5d
commit 7eb4e9cc0f
3 changed files with 44 additions and 11 deletions

View File

@@ -354,10 +354,11 @@ void wxWindowBase::Centre(int direction)
// controls are always centered on their parent because it doesn't make
// sense to centre them on the screen
if ( !(direction & wxCENTRE_ON_SCREEN) || wxDynamicCast(this, wxControl) )
if ( !(direction & wxCENTRE_ON_SCREEN) || !IsTopLevel() )
{
// theo nly chance to get this is to have a wxControl without parent
wxCHECK_RET( parent, wxT("a control must have a parent") );
// the only chance to get this is to have a not top level window
// without parent which shouldn't happen
wxCHECK_RET( parent, wxT("this window must have a parent") );
// adjust to the parents client area origin
wxPoint posParent = parent->ClientToScreen(wxPoint(0, 0));