]> git.saurik.com Git - wxWidgets.git/commitdiff
defer calling SetCanFocus() on wxGTK until after creation
authorPaul Cornett <paulcor@bullseye.com>
Wed, 31 Jul 2013 16:03:51 +0000 (16:03 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Wed, 31 Jul 2013 16:03:51 +0000 (16:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/statbox.h
src/common/statboxcmn.cpp
src/gtk/statbox.cpp
src/gtk/window.cpp

index 02197a24793e05f32655786bf31b3978bf3ab005..d01f25796984d397fa6ba04c5bdcda2686533705 100644 (file)
@@ -27,7 +27,7 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBoxNameStr[];
 class WXDLLIMPEXP_CORE wxStaticBoxBase : public wxNavigationEnabled<wxControl>
 {
 public:
-    wxStaticBoxBase() { m_container.DisableSelfFocus(); }
+    wxStaticBoxBase();
 
     // overridden base class virtuals
     virtual bool HasTransparentBackground() { return true; }
index 487036e122933af9c147007f169f13c5af78c954..5f0f05cbeb3ad9c4004f02b8a335c5934034b309 100644 (file)
 
 extern WXDLLEXPORT_DATA(const char) wxStaticBoxNameStr[] = "groupBox";
 
+wxStaticBoxBase::wxStaticBoxBase()
+{
+#ifndef __WXGTK__
+    m_container.DisableSelfFocus();
+#endif
+}
+
 // ----------------------------------------------------------------------------
 // XTI
 // ----------------------------------------------------------------------------
index bd64a6076d81fee65504bc1619e8487a139f946a..6d0a9b0db1661274c4a64c5aef6d0788354dbd7c 100644 (file)
@@ -108,6 +108,8 @@ bool wxStaticBox::Create( wxWindow *parent,
     }
 #endif
 
+    m_container.DisableSelfFocus();
+
     return true;
 }
 
index 3e555410ffae6a91ea85a082fb19fd3f6627a39d..0285a4791212fe053e2fb2dc604269f6a6191eb7 100644 (file)
@@ -3375,8 +3375,9 @@ void wxWindowGTK::SetFocus()
 
 void wxWindowGTK::SetCanFocus(bool canFocus)
 {
-    if ( m_widget )
-        gtk_widget_set_can_focus(m_widget, canFocus);
+    wxCHECK_RET(m_widget, "invalid window");
+
+    gtk_widget_set_can_focus(m_widget, canFocus);
 
     if ( m_wxwindow && (m_widget != m_wxwindow) )
     {