defer calling SetCanFocus() on wxGTK until after creation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett 2013-07-31 16:03:51 +00:00
parent cc4d5638c6
commit 4ae5ada038
4 changed files with 13 additions and 3 deletions

View 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; }

View File

@ -29,6 +29,13 @@
extern WXDLLEXPORT_DATA(const char) wxStaticBoxNameStr[] = "groupBox";
wxStaticBoxBase::wxStaticBoxBase()
{
#ifndef __WXGTK__
m_container.DisableSelfFocus();
#endif
}
// ----------------------------------------------------------------------------
// XTI
// ----------------------------------------------------------------------------

View File

@ -108,6 +108,8 @@ bool wxStaticBox::Create( wxWindow *parent,
}
#endif
m_container.DisableSelfFocus();
return true;
}

View 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) )
{