X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0d9c6cb9112174b71970686a95b628819797b87..e32d4b8f07fa4315b7641861c6b740e149b7e6fd:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 3a0b1e7d52..ffa36e365e 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -102,6 +102,10 @@ enum wxWindowVariant wxWINDOW_VARIANT_MAX }; +#if wxUSE_SYSTEM_OPTIONS + #define wxWINDOW_DEFAULT_VARIANT wxT("window-default-variant") +#endif + // ---------------------------------------------------------------------------- // (pseudo)template list classes // ---------------------------------------------------------------------------- @@ -313,7 +317,7 @@ public: // 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; } @@ -360,16 +364,24 @@ public: // 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, @@ -489,7 +501,9 @@ public: virtual void SetFocusFromKbd() { SetFocus(); } // return the window which currently has the focus or NULL - static wxWindow *FindFocus() /* = 0: implement in derived classes */; + static wxWindow *FindFocus(); + + static wxWindow *DoFindFocus() /* = 0: implement in derived classes */; // can this window have focus? virtual bool AcceptsFocus() const { return IsShown() && IsEnabled(); } @@ -743,6 +757,13 @@ public: } 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) { @@ -1014,6 +1035,10 @@ public: // is only used for wxWin itself or for user code which wants to call // platform-specific APIs virtual WXWidget GetHandle() const = 0; + // associate the window with a new native handle + virtual void AssociateHandle(WXWidget WXUNUSED(handle)) { } + // dissociate the current native handle from the window + virtual void DissociateHandle() { } #if wxUSE_PALETTE // Store the palette used by DCs in wxWindow so that the dcs can share @@ -1064,6 +1089,12 @@ protected: // Send the wxWindowDestroyEvent void SendDestroyEvent(); + // 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() + { return (wxWindow*)this; } + // the window id - a number which uniquely identifies a window among // its siblings unless it is wxID_ANY wxWindowID m_windowId; @@ -1194,7 +1225,7 @@ protected: void SetBestSize(const wxSize& size) { SetBestFittingSize(size); } // set the initial window size if none is given (i.e. at least one of the - // components of the size passed to ctor/Create() is -1) + // components of the size passed to ctor/Create() is wxDefaultCoord) // // normally just calls SetBestSize() for controls, but can be overridden // not to do it for the controls which have to do some additional @@ -1286,7 +1317,14 @@ private: // ---------------------------------------------------------------------------- // 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 @@ -1388,7 +1426,7 @@ class WXDLLEXPORT wxWindowAccessible: public wxAccessible { public: wxWindowAccessible(wxWindow* win): wxAccessible(win) { if (win) win->SetAccessible(this); } - virtual ~wxWindowAccessible() {}; + virtual ~wxWindowAccessible() {} // Overridables