Applied listbox isselected fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -756,19 +756,10 @@ bool wxListBox::IsSelected( int n ) const
|
|||||||
wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid listbox") );
|
wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid listbox") );
|
||||||
|
|
||||||
GList *target = g_list_nth( m_list->children, n );
|
GList *target = g_list_nth( m_list->children, n );
|
||||||
if (target)
|
|
||||||
{
|
wxCHECK_MSG( target, FALSE, wxT("invalid listbox index") );
|
||||||
GList *child = m_list->selection;
|
|
||||||
while (child)
|
return (GTK_WIDGET(target->data)->state == GTK_STATE_SELECTED) ;
|
||||||
{
|
|
||||||
if (child->data == target->data) return TRUE;
|
|
||||||
child = child->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wxFAIL_MSG(wxT("wrong listbox index"));
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListBox::SetSelection( int n, bool select )
|
void wxListBox::SetSelection( int n, bool select )
|
||||||
|
@@ -756,19 +756,10 @@ bool wxListBox::IsSelected( int n ) const
|
|||||||
wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid listbox") );
|
wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid listbox") );
|
||||||
|
|
||||||
GList *target = g_list_nth( m_list->children, n );
|
GList *target = g_list_nth( m_list->children, n );
|
||||||
if (target)
|
|
||||||
{
|
wxCHECK_MSG( target, FALSE, wxT("invalid listbox index") );
|
||||||
GList *child = m_list->selection;
|
|
||||||
while (child)
|
return (GTK_WIDGET(target->data)->state == GTK_STATE_SELECTED) ;
|
||||||
{
|
|
||||||
if (child->data == target->data) return TRUE;
|
|
||||||
child = child->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wxFAIL_MSG(wxT("wrong listbox index"));
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListBox::SetSelection( int n, bool select )
|
void wxListBox::SetSelection( int n, bool select )
|
||||||
|
Reference in New Issue
Block a user