// reset the cached best size value so it will be recalculated the
// next time it is needed.
- void InvalidateBestSize() { m_bestSizeCache = wxDefaultSize; }
+ void InvalidateBestSize();
void CacheBestSize(const wxSize& size) const
{ wxConstCast(this, wxWindowBase)->m_bestSizeCache = size; }
// set min/max size of the window
virtual void SetSizeHints( int minW, int minH,
int maxW = wxDefaultCoord, int maxH = wxDefaultCoord,
- int incW = wxDefaultCoord, int incH = wxDefaultCoord );
+ int incW = wxDefaultCoord, int incH = wxDefaultCoord )
+ {
+ DoSetSizeHints(minW, minH, maxW, maxH, incW, incH);
+ }
+
void SetSizeHints( const wxSize& minSize,
const wxSize& maxSize=wxDefaultSize,
const wxSize& incSize=wxDefaultSize)
{
- SetSizeHints(minSize.x, minSize.y,
- maxSize.x, maxSize.y,
- incSize.x, incSize.y);
+ DoSetSizeHints(minSize.x, minSize.y,
+ maxSize.x, maxSize.y,
+ incSize.x, incSize.y);
}
+ virtual void DoSetSizeHints(int minW, int minH,
+ int maxW = wxDefaultCoord, int maxH = wxDefaultCoord,
+ int incW = wxDefaultCoord, int incH = wxDefaultCoord );
+
virtual void SetVirtualSizeHints( int minW, int minH,
int maxW = wxDefaultCoord, int maxH = wxDefaultCoord );
void SetVirtualSizeHints( const wxSize& minSize,
// return the window which currently has the focus or NULL
static wxWindow *FindFocus();
-
+
static wxWindow *DoFindFocus() /* = 0: implement in derived classes */;
// can this window have focus?
// find window among the descendants of this one either by id or by
// name (return NULL if not found)
- wxWindow *FindWindow( long winid );
- wxWindow *FindWindow( const wxString& name );
+ wxWindow *FindWindow(long winid) const;
+ wxWindow *FindWindow(const wxString& name) const;
// Find a window among any window (all return NULL if not found)
static wxWindow *FindWindowById( long winid, const wxWindow *parent = NULL );
}
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)
{
virtual bool SetBackgroundStyle(wxBackgroundStyle style) { m_backgroundStyle = style; return true; }
virtual wxBackgroundStyle GetBackgroundStyle() const { return m_backgroundStyle; }
+ // returns true if the control has "transparent" areas such as a
+ // wxStaticText and wxCheckBox and the background should be adapted
+ // from a parent window
+ virtual bool HasTransparentBackground() { return false; }
+
// set/retrieve the font for the window (SetFont() returns true if the
// font really changed)
virtual bool SetFont(const wxFont& font) = 0;
// returns the main window of composite control; this is the window
// that FindFocus returns if the focus is in one of composite control's
// windows
- virtual wxWindow *GetMainWindowOfCompositeControl()
+ virtual wxWindow *GetMainWindowOfCompositeControl()
{ return (wxWindow*)this; }
// the window id - a number which uniquely identifies a window among
// ----------------------------------------------------------------------------
// include the declaration of the platform-specific class
-#if defined(__WXMSW__)
+#if defined(__WXPALMOS__)
+ #ifdef __WXUNIVERSAL__
+ #define wxWindowNative wxWindowPalm
+ #else // !wxUniv
+ #define wxWindowPalm wxWindow
+ #endif // wxUniv/!wxUniv
+ #include "wx/palmos/window.h"
+#elif defined(__WXMSW__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowMSW
#else // !wxUniv
{
public:
wxWindowAccessible(wxWindow* win): wxAccessible(win) { if (win) win->SetAccessible(this); }
- virtual ~wxWindowAccessible() {};
+ virtual ~wxWindowAccessible() {}
// Overridables