X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e7f59ab29c1178495337e920c59e0e345628a6b..7f4f5e8c24607ead9b5e2f4c60658dcd61f028f4:/interface/wx/window.h diff --git a/interface/wx/window.h b/interface/wx/window.h index 63ac914054..548752f7c9 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -767,7 +767,7 @@ public: wxPanel), the size returned by this function will be the same as the size the window would have had after calling Fit(). - Note that when you write your own widget you need to overload the + Note that when you write your own widget you need to override the DoGetBestSize() function instead of this (non-virtual!) function. @see CacheBestSize(), @ref overview_windowsizing @@ -971,12 +971,12 @@ public: @see @ref overview_windowsizing */ - virtual void SetClientSize(int width, int height); + void SetClientSize(int width, int height); /** @overload */ - virtual void SetClientSize(const wxSize& size); + void SetClientSize(const wxSize& size); /** This normally does not need to be called by user code. @@ -1114,17 +1114,17 @@ public: @see Move(), @ref overview_windowsizing */ - virtual void SetSize(const wxRect& rect); + void SetSize(const wxRect& rect); /** @overload */ - virtual void SetSize(const wxSize& size); + void SetSize(const wxSize& size); /** @overload */ - virtual void SetSize(int width, int height); + void SetSize(int width, int height); /** Use of this function for windows which are not toplevel windows @@ -1172,7 +1172,7 @@ public: @param direction Specifies the direction for the centring. May be wxHORIZONTAL, wxVERTICAL - or wxBOTH. It may also include wxCENTRE_ON_SCREEN flag + or wxBOTH. It may also include the wxCENTRE_ON_SCREEN flag if you want to centre the window on the entire screen and not on its parent window. @@ -1198,6 +1198,21 @@ public: @see wxTopLevelWindow::CentreOnScreen */ void CentreOnParent(int direction = wxBOTH); + + /** + Centres the window. + + @param direction + Specifies the direction for the centring. May be wxHORIZONTAL, + wxVERTICAL or wxBOTH. It may also include the wxCENTRE_ON_SCREEN + flag. + + @remarks This function is not meant to be called directly by user code, + but via Centre, Center, CentreOnParent, or CenterOnParent. + This function can be overriden to fine-tune centring behaviour. + */ + virtual void DoCentre(int direction); + /** This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows. @@ -1408,8 +1423,14 @@ public: //@{ /** - Clears the window by filling it with the current background colour. Does not - cause an erase background event to be generated. + Clears the window by filling it with the current background colour. + + Does not cause an erase background event to be generated. + + Notice that this uses wxClientDC to draw on the window and the results + of doing it while also drawing on wxPaintDC for this window are + undefined. Hence this method shouldn't be used from EVT_PAINT handlers, + just use wxDC::Clear() on the wxPaintDC you already use there instead. */ virtual void ClearBackground(); @@ -1825,6 +1846,19 @@ public: */ bool ProcessWindowEvent(wxEvent& event); + /** + Wrapper for wxEvtHandler::ProcessEventLocally(). + + This method is similar to ProcessWindowEvent() but can be used to + search for the event handler only in this window and any event handlers + pushed on top of it. Unlike ProcessWindowEvent() it won't propagate the + event upwards. But it will use the validator and event handlers + associated with this window, if any. + + @since 2.9.1 + */ + bool ProcessWindowEventLocally(wxEvent& event); + /** Removes and returns the top-most event handler on the event handler stack. @@ -2084,6 +2118,12 @@ public: /** Raises the window to the top of the window hierarchy (Z-order). + Notice that this function only requests the window manager to raise + this window to the top of Z-order. Depending on its configuration, the + window manager may raise the window, not do it at all or indicate that + a window requested to be raised in some other way, e.g. by flashing its + icon if it is minimized. + @remarks This function only works for wxTopLevelWindow-derived classes. @@ -3132,6 +3172,8 @@ public: The search is recursive in both cases. @see FindWindow() + + @return Window with the given @a id or @NULL if not found. */ static wxWindow* FindWindowById(long id, const wxWindow* parent = 0); @@ -3145,6 +3187,8 @@ public: The search is recursive in both cases. @see FindWindow() + + @return Window with the given @a label or @NULL if not found. */ static wxWindow* FindWindowByLabel(const wxString& label, const wxWindow* parent = 0); @@ -3161,6 +3205,8 @@ public: FindWindowByLabel() is called. @see FindWindow() + + @return Window with the given @a name or @NULL if not found. */ static wxWindow* FindWindowByName(const wxString& name, const wxWindow* parent = 0);