X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af49c4b8a2d3553e733e71c7dd3911881f4c1a2a..31ad423e4fb556ec225a63b161154d3bf3445c1b:/include/wx/containr.h?ds=sidebyside diff --git a/include/wx/containr.h b/include/wx/containr.h index 234161da03..cd308a2306 100644 --- a/include/wx/containr.h +++ b/include/wx/containr.h @@ -13,7 +13,7 @@ #ifndef _WX_CONTAINR_H_ #define _WX_CONTAINR_H_ -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "containr.h" #endif @@ -69,6 +69,9 @@ public: // the focus and the default processing should take place bool DoSetFocus(); + // can our child get the focus? + bool AcceptsFocus() const; + // called from OnChildFocus() handler, i.e. when one of our (grand) // children gets the focus void SetLastFocus(wxWindow *win); @@ -89,10 +92,13 @@ protected: // a temporary override of m_winDefault, use the latter if NULL wxWindow *m_winTmpDefault; + // a guard against infinite recursion + bool m_inSetFocus; + DECLARE_NO_COPY_CLASS(wxControlContainer) }; -// this function is for wxWindows internal use only +// this function is for wxWidgets internal use only extern bool wxSetFocusToChild(wxWindow *win, wxWindow **child); // ---------------------------------------------------------------------------- @@ -111,6 +117,7 @@ public: \ virtual wxWindow *GetDefaultItem() const; \ virtual wxWindow *SetDefaultItem(wxWindow *child); \ virtual void SetTmpDefaultItem(wxWindow *win); \ + virtual bool AcceptsFocus() const; \ \ protected: \ wxControlContainer m_container @@ -164,6 +171,10 @@ void classname::OnChildFocus(wxChildFocusEvent& event) \ void classname::OnFocus(wxFocusEvent& event) \ { \ m_container.HandleOnFocus(event); \ +} \ +bool classname::AcceptsFocus() const \ +{ \ + return m_container.AcceptsFocus(); \ }