X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/574c939ef1c1b835a8bc65c0fe724548fa04ec49..e5ee4c908b9dbcf07f0441aa74d8635b7343be4d:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 1e4736b97b..fcb1ec05df 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -293,8 +293,8 @@ public: int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 ); - int GetMinWidth() const { return m_minWidth; } - int GetMinHeight() const { return m_minHeight; } + virtual int GetMinWidth() const { return m_minWidth; } + virtual int GetMinHeight() const { return m_minHeight; } int GetMaxWidth() const { return m_maxWidth; } int GetMaxHeight() const { return m_maxHeight; } @@ -734,9 +734,13 @@ public: virtual void GetPositionConstraint(int *x, int *y) const ; // sizers - // TODO: what are they and how do they work?? void SetSizer( wxSizer *sizer ); wxSizer *GetSizer() const { return m_windowSizer; } + + // Track if this window is a member of a sizer + void SetContainingSizer(wxSizer* sizer) { m_containingSizer = sizer; } + wxSizer *GetContainingSizer() const { return m_containingSizer; } + #endif // wxUSE_CONSTRAINTS // backward compatibility @@ -770,15 +774,16 @@ public: // Store the palette used by DCs in wxWindow so that the dcs can share // a palette. And we can respond to palette messages. wxPalette GetPalette() const { return m_palette; } + // When palette is changed tell the DC to set the system palette to the // new one. - void SetPalette(wxPalette &pal) { - m_custompalette=true; - m_palette=pal; - wxWindowDC d((wxWindow *) this); - d.SetPalette(pal); - } - bool HasCustomPalette() { return m_custompalette; } + void SetPalette(const wxPalette& pal); + + // return true if we have a specific palette + bool HasCustomPalette() const { return m_hasCustomPalette; } + + // return the first parent window with a custom palette or NULL + wxWindow *GetAncestorWithCustomPalette() const; #endif // wxUSE_PALETTE protected: @@ -839,10 +844,11 @@ protected: // constraints this window is involved in wxWindowList *m_constraintsInvolvedIn; - // top level and the parent sizers - // TODO what's this and how does it work?) + // this window's sizer wxSizer *m_windowSizer; - wxWindowBase *m_sizerParent; + + // The sizer this window is a member of, if any + wxSizer *m_containingSizer; // Layout() window automatically when its size changes? bool m_autoLayout:1; @@ -864,10 +870,10 @@ protected: wxString m_windowName; bool m_themeEnabled; -#ifdef wxUSE_PALETTE +#if wxUSE_PALETTE wxPalette m_palette; - bool m_custompalette; -#endif + bool m_hasCustomPalette; +#endif // wxUSE_PALETTE protected: @@ -961,10 +967,6 @@ protected: // a toolbar that it manages itself). virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags); -#ifdef __WXPM__ - // extra OS/2 layout processing - virtual void OS2Layout(int width, int height) { }; -#endif private: