]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/containr.h
simplify wxEVT_MENU_OPEN/CLOSE generation
[wxWidgets.git] / include / wx / containr.h
index 87ab324a281efe6ea544d132e1d56acebd9cdf0b..0ba59825c5905d714afe03b24f980783c194175d 100644 (file)
@@ -70,6 +70,11 @@ public:
     // wxListCtrl) and so should get focus for ourselves
     bool AcceptsFocusRecursively() const { return true; }
 
+    // this is used to determine whether we can accept focus when Tab or
+    // another navigation key is pressed -- we alsways can, for the same reason
+    // as mentioned above for AcceptsFocusRecursively()
+    bool AcceptsFocusFromKeyboard() const { return true; }
+
     // Call this when the number of children of the window changes.
     // If we have any children, this panel (used just as container for
     // them) shouldn't get focus for itself.
@@ -103,6 +108,7 @@ private:
 public:                                                                       \
     virtual bool AcceptsFocus() const;                                        \
     virtual bool AcceptsFocusRecursively() const;                             \
+    virtual bool AcceptsFocusFromKeyboard() const;                            \
     virtual void AddChild(wxWindowBase *child);                               \
     virtual void RemoveChild(wxWindowBase *child);                            \
     virtual void SetFocus();                                                  \
@@ -143,9 +149,13 @@ protected:                                                                    \
     bool classname::AcceptsFocus() const                                      \
     {                                                                         \
         return m_container.AcceptsFocus();                                    \
+    }                                                                         \
+                                                                              \
+    bool classname::AcceptsFocusFromKeyboard() const                          \
+    {                                                                         \
+        return m_container.AcceptsFocusFromKeyboard();                        \
     }
 
-
 #ifdef wxHAS_NATIVE_TAB_TRAVERSAL
 
 // ----------------------------------------------------------------------------
@@ -254,6 +264,7 @@ public:                                                                       \
     void classname::OnChildFocus(wxChildFocusEvent& event)                    \
     {                                                                         \
         m_container.SetLastFocus(event.GetWindow());                          \
+        event.Skip();                                                         \
     }                                                                         \
                                                                               \
     void classname::OnFocus(wxFocusEvent& event)                              \