X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b2f64c6c12f3f110480040b3d8b5328f156c295..ca77701441e39245dcbfce903049e76f166979e5:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 7a15b0bee7..443f0366e7 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -379,6 +379,13 @@ public: *h = s.y; } + // Determine the best size in the other direction if one of them is + // fixed. This is used with windows that can wrap their contents and + // returns input-independent best size for the others. + int GetBestHeight(int width) const; + int GetBestWidth(int height) const; + + void SetScrollHelper( wxScrollHelper *sh ) { m_scrollHelper = sh; } wxScrollHelper *GetScrollHelper() { return m_scrollHelper; } @@ -745,7 +752,7 @@ public: bool IsDescendant(wxWindowBase* win) const; // it doesn't really change parent, use Reparent() instead - void SetParent( wxWindowBase *parent ) { m_parent = (wxWindow *)parent; } + void SetParent( wxWindowBase *parent ); // change the real parent of this window, return true if the parent // was changed, false otherwise (error or newParent == oldParent) virtual bool Reparent( wxWindowBase *newParent ); @@ -1687,6 +1694,14 @@ protected: // (GetBorderSize() will be used to add them) virtual wxSize DoGetBestClientSize() const { return wxDefaultSize; } + // These two methods can be overridden to implement intelligent + // width-for-height and/or height-for-width best size determination for the + // window. By default the fixed best size is used. + virtual int DoGetBestClientHeight(int WXUNUSED(width)) const + { return wxDefaultCoord; } + virtual int DoGetBestClientWidth(int WXUNUSED(height)) const + { return wxDefaultCoord; } + // this is the virtual function to be overridden in any derived class which // wants to change how SetSize() or Move() works - it is called by all // versions of these functions in the base class