X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80332672ab36153aa2424cff2a06b434287488c8..75ce4cb180dfbe5f6ee1ad6927929b43d04edcd1:/include/wx/window.h?ds=sidebyside diff --git a/include/wx/window.h b/include/wx/window.h index 4c62a7d035..a9a881c8a8 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -546,6 +546,8 @@ public: virtual void SetExtraStyle(long exStyle) { m_exStyle = exStyle; } long GetExtraStyle() const { return m_exStyle; } + bool HasExtraStyle(int exFlag) const { return (m_exStyle & exFlag) != 0; } + // make the window modal (all other windows unresponsive) virtual void MakeModal(bool modal = true); @@ -580,17 +582,35 @@ public: // this class clients and take into account the current window state virtual bool AcceptsFocus() const { return true; } - // can this window have focus right now? - bool CanAcceptFocus() const { return AcceptsFocus() && IsShown() && IsEnabled(); } + // can this window or one of its children accept focus? + // + // usually it's the same as AcceptsFocus() but is overridden for + // container windows + virtual bool AcceptsFocusRecursively() const { return AcceptsFocus(); } // can this window be given focus by keyboard navigation? if not, the // only way to give it focus (provided it accepts it at all) is to // click it virtual bool AcceptsFocusFromKeyboard() const { return AcceptsFocus(); } + + // this is mostly a helper for the various functions using it below + bool CanBeFocused() const { return IsShown() && IsEnabled(); } + + // can this window itself have focus? + bool IsFocusable() const { return AcceptsFocus() && CanBeFocused(); } + + // can this window have focus right now? + // + // if this method returns true, it means that calling SetFocus() will + // put focus either to this window or one of its children, if you need + // to know whether this window accepts focus itself, use IsFocusable() + bool CanAcceptFocus() const + { return AcceptsFocusRecursively() && CanBeFocused(); } + // can this window be assigned focus from keyboard right now? bool CanAcceptFocusFromKeyboard() const - { return AcceptsFocusFromKeyboard() && CanAcceptFocus(); } + { return AcceptsFocusFromKeyboard() && CanBeFocused(); } // call this when the return value of AcceptsFocus() changes virtual void SetCanFocus(bool WXUNUSED(canFocus)) { } @@ -639,6 +659,11 @@ public: virtual void AddChild( wxWindowBase *child ); virtual void RemoveChild( wxWindowBase *child ); + // returns true if the child is in the client area of the window, i.e. is + // not scrollbar, toolbar etc. + virtual bool IsClientAreaChild(const wxWindow *WXUNUSED(child)) const + { return true; } + // looking for windows // ------------------- @@ -1125,7 +1150,7 @@ public: void SetAccessible(wxAccessible* accessible) ; // Returns the accessible object. - wxAccessible* GetAccessible() { return m_accessible; }; + wxAccessible* GetAccessible() { return m_accessible; } // Returns the accessible object, creating if necessary. wxAccessible* GetOrCreateAccessible() ;