]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement wxWindow::SetFocusIgnoringChildren for GTK+
authorRobert Roebling <robert@roebling.de>
Sat, 15 Sep 2007 22:06:22 +0000 (22:06 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 15 Sep 2007 22:06:22 +0000 (22:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/containr.h
include/wx/gtk/window.h
src/gtk/window.cpp

index 41a8bbe336826daff6914ba4d93412c5f284f231..0d38361739f15c500d7b91842a2afc52fbf72b90 100644 (file)
@@ -177,7 +177,7 @@ protected:
                                                                               \
     void classname::SetFocusIgnoringChildren()                                \
     {                                                                         \
-        SetFocus();                                                           \
+        basename::SetFocusIgnoringChildren();                                 \
     }
 
 #else // !wxHAS_NATIVE_TAB_TRAVERSAL
index 038127f4871c25a89dc2c1156fe67c9cb772e3bd..2a623ee0c1a48e11e8fd4f5a97b3a91642ed251f 100644 (file)
@@ -60,6 +60,7 @@ public:
     virtual bool IsRetained() const;
 
     virtual void SetFocus();
+    virtual void SetFocusIgnoringChildren();
     virtual void SetCanFocus(bool canFocus);
 
     virtual bool Reparent( wxWindowBase *newParent );
index 363f13d445e6cfa71c6084845854102bd4e8b520..bb6bd9a565297649bd8160cd150db9159dbb5ccd 100644 (file)
@@ -3172,6 +3172,24 @@ bool wxWindowGTK::GTKSetDelayedFocusIfNeeded()
     return false;
 }
 
+void wxWindowGTK::SetFocusIgnoringChildren()
+{
+    wxCHECK_RET( m_widget != NULL, wxT("invalid window") );
+    if ( m_hasFocus )
+    {
+        // don't do anything if we already have focus
+        return;
+    }
+
+    if (m_wxwindow)
+    {
+        if (!GTK_WIDGET_CAN_FOCUS(m_wxwindow))
+            GTK_WIDGET_SET_FLAGS(m_wxwindow, GTK_CAN_FOCUS);
+    }
+    
+    wxWindowGTK::SetFocus();
+}
+
 void wxWindowGTK::SetFocus()
 {
     wxCHECK_RET( m_widget != NULL, wxT("invalid window") );