X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72fc5caf0644f2ac2f110a07c037e5f3b0c73829..7d56fb8fcdb469bdef549319b2d81ab4b02b5a67:/include/wx/window.h?ds=sidebyside diff --git a/include/wx/window.h b/include/wx/window.h index 28f89731f9..3a1e9362bb 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -271,11 +271,19 @@ public: *h = s.y; } - // centre with respect to the the parent window + // the generic centre function - centers the window on parent by + // default or on screen if it doesn't have parent or + // wxCENTER_ON_SCREEN flag is given void Centre( int direction = wxBOTH ); void Center( int direction = wxBOTH ) { Centre(direction); } - void CentreOnParent( int dir = wxBOTH ) { Centre(dir | wxCENTER_FRAME); } - void CenterOnParent( int dir = wxBOTH ) { Centre(dir | wxCENTER_FRAME); } + + // centre on screen (only works for top level windows) + void CentreOnScreen(int dir = wxBOTH) { Centre(dir | wxCENTER_ON_SCREEN); } + void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); } + + // centre with respect to the the parent window + void CentreOnParent(int dir = wxBOTH) { Centre(dir | wxCENTER_FRAME); } + void CenterOnParent(int dir = wxBOTH) { CentreOnParent(dir); } // set window size to wrap around its children virtual void Fit();