]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/containr.h
Fixed bug #1022383: 'several ComboBoxes appear selected'
[wxWidgets.git] / include / wx / containr.h
index e5399b71ce5df0d20210c6bff11f898e083dea31..00edc5861ed4171c50edeebfd8352b50ee7e8e02 100644 (file)
@@ -65,7 +65,7 @@ public:
     void HandleOnFocus(wxFocusEvent& event);
     void HandleOnWindowDestroy(wxWindowBase *child);
 
     void HandleOnFocus(wxFocusEvent& event);
     void HandleOnWindowDestroy(wxWindowBase *child);
 
-    // should be called from SetFocus(), returns FALSE if we did nothing with
+    // should be called from SetFocus(), returns false if we did nothing with
     // the focus and the default processing should take place
     bool DoSetFocus();
 
     // the focus and the default processing should take place
     bool DoSetFocus();
 
@@ -92,10 +92,13 @@ protected:
     // a temporary override of m_winDefault, use the latter if NULL
     wxWindow *m_winTmpDefault;
 
     // 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)
 };
 
     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);
 
 // ----------------------------------------------------------------------------
 extern bool wxSetFocusToChild(wxWindow *win, wxWindow **child);
 
 // ----------------------------------------------------------------------------
@@ -110,6 +113,7 @@ public: \
     void OnFocus(wxFocusEvent& event); \
     virtual void OnChildFocus(wxChildFocusEvent& event); \
     virtual void SetFocus(); \
     void OnFocus(wxFocusEvent& event); \
     virtual void OnChildFocus(wxChildFocusEvent& event); \
     virtual void SetFocus(); \
+    virtual void SetFocusIgnoringChildren(); \
     virtual void RemoveChild(wxWindowBase *child); \
     virtual wxWindow *GetDefaultItem() const; \
     virtual wxWindow *SetDefaultItem(wxWindow *child); \
     virtual void RemoveChild(wxWindowBase *child); \
     virtual wxWindow *GetDefaultItem() const; \
     virtual wxWindow *SetDefaultItem(wxWindow *child); \
@@ -160,6 +164,11 @@ void classname::SetFocus() \
         wxWindow::SetFocus(); \
 } \
  \
         wxWindow::SetFocus(); \
 } \
  \
+void classname::SetFocusIgnoringChildren() \
+{ \
+        wxWindow::SetFocus(); \
+} \
+ \
 void classname::OnChildFocus(wxChildFocusEvent& event) \
 { \
     m_container.SetLastFocus(event.GetWindow()); \
 void classname::OnChildFocus(wxChildFocusEvent& event) \
 { \
     m_container.SetLastFocus(event.GetWindow()); \