- // default): Set functions return true if colour was changed
- virtual bool SetBackgroundColour( const wxColour &colour );
- virtual bool SetForegroundColour( const wxColour &colour );
+ // default): SetXXX() functions return true if colour was changed,
+ // SetDefaultXXX() reset the "m_inheritXXX" flag after setting the
+ // value to prevent it from being inherited by our children
+ virtual bool SetBackgroundColour(const wxColour& colour);
+ void SetOwnBackgroundColour(const wxColour& colour)
+ {
+ if ( SetBackgroundColour(colour) )
+ m_inheritBgCol = false;
+ }
+ wxColour GetBackgroundColour() const;
+
+ // if the window shouldn't inherit its colour from the parent, override
+ // this function to return true
+ //
+ // this is currently only used by wxMSW and wxUniv but should be useful for
+ // the other ports too
+ virtual bool ProvidesBackground() const { return false; }
+
+ virtual bool SetForegroundColour(const wxColour& colour);
+ void SetOwnForegroundColour(const wxColour& colour)
+ {
+ if ( SetForegroundColour(colour) )
+ m_inheritFgCol = false;
+ }
+ wxColour GetForegroundColour() const;