Tries to fix wxListBox focus problems.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2001-11-22 11:38:56 +00:00
parent 1539c2f54a
commit 780bb8744b
4 changed files with 42 additions and 0 deletions

View File

@@ -667,6 +667,12 @@ void wxListBox::Clear()
wxCHECK_RET( m_list != NULL, wxT("invalid listbox") ); wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
gtk_list_clear_items( m_list, 0, GetCount() ); gtk_list_clear_items( m_list, 0, GetCount() );
if ( GTK_LIST(m_list)->last_focus_child != NULL )
{
// This should be NULL, I think.
GTK_LIST(m_list)->last_focus_child = NULL;
}
if ( HasClientObjectData() ) if ( HasClientObjectData() )
{ {

View File

@@ -3237,6 +3237,13 @@ void wxWindowGTK::SetFocus()
{ {
wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
#if 0
wxPrintf( "SetFocus from " );
if (GetClassInfo() && GetClassInfo()->GetClassName())
wxPrintf( GetClassInfo()->GetClassName() );
wxPrintf( ".\n" );
#endif
if (m_wxwindow) if (m_wxwindow)
{ {
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow)) if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
@@ -3261,6 +3268,14 @@ void wxWindowGTK::SetFocus()
// ? // ?
} }
} }
#if 0
wxPrintf( "SetFocus finished in " );
if (GetClassInfo() && GetClassInfo()->GetClassName())
wxPrintf( GetClassInfo()->GetClassName() );
wxPrintf( ".\n" );
#endif
} }
bool wxWindowGTK::AcceptsFocus() const bool wxWindowGTK::AcceptsFocus() const

View File

@@ -667,6 +667,12 @@ void wxListBox::Clear()
wxCHECK_RET( m_list != NULL, wxT("invalid listbox") ); wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
gtk_list_clear_items( m_list, 0, GetCount() ); gtk_list_clear_items( m_list, 0, GetCount() );
if ( GTK_LIST(m_list)->last_focus_child != NULL )
{
// This should be NULL, I think.
GTK_LIST(m_list)->last_focus_child = NULL;
}
if ( HasClientObjectData() ) if ( HasClientObjectData() )
{ {

View File

@@ -3237,6 +3237,13 @@ void wxWindowGTK::SetFocus()
{ {
wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
#if 0
wxPrintf( "SetFocus from " );
if (GetClassInfo() && GetClassInfo()->GetClassName())
wxPrintf( GetClassInfo()->GetClassName() );
wxPrintf( ".\n" );
#endif
if (m_wxwindow) if (m_wxwindow)
{ {
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow)) if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
@@ -3261,6 +3268,14 @@ void wxWindowGTK::SetFocus()
// ? // ?
} }
} }
#if 0
wxPrintf( "SetFocus finished in " );
if (GetClassInfo() && GetClassInfo()->GetClassName())
wxPrintf( GetClassInfo()->GetClassName() );
wxPrintf( ".\n" );
#endif
} }
bool wxWindowGTK::AcceptsFocus() const bool wxWindowGTK::AcceptsFocus() const