Make wxCheckListBox call event.SetString() on all platforms, not just wxMSW. Mention again, that wxCommandEvent::IsChecked() cannot be used for it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,7 +18,10 @@
|
|||||||
@beginEventTable{wxCommandEvent}
|
@beginEventTable{wxCommandEvent}
|
||||||
@event{EVT_CHECKLISTBOX(id, func)}
|
@event{EVT_CHECKLISTBOX(id, func)}
|
||||||
Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
|
Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
|
||||||
the check list box is checked or unchecked.
|
the check list box is checked or unchecked. wxCommandEvent::GetInt()
|
||||||
|
will contain the index of the item that was checked or unchecked.
|
||||||
|
wxCommandEvent::IsChecked() is not valid! Use wxCheckListBox::IsChecked()
|
||||||
|
instead.
|
||||||
@endEventTable
|
@endEventTable
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
|
@@ -1986,6 +1986,8 @@ public:
|
|||||||
Process a @c wxEVT_COMMAND_LISTBOX_SELECTED command, which is generated by a wxListBox control.
|
Process a @c wxEVT_COMMAND_LISTBOX_SELECTED command, which is generated by a wxListBox control.
|
||||||
@event{EVT_LISTBOX_DCLICK(id, func)}
|
@event{EVT_LISTBOX_DCLICK(id, func)}
|
||||||
Process a @c wxEVT_COMMAND_LISTBOX_DOUBLECLICKED command, which is generated by a wxListBox control.
|
Process a @c wxEVT_COMMAND_LISTBOX_DOUBLECLICKED command, which is generated by a wxListBox control.
|
||||||
|
@event{EVT_CHECKLISTBOX(id, func)}
|
||||||
|
Process a @c wxEVT_COMMAND_CHECKLISTBOX_TOGGLED command, which is generated by a wxCheckListBox control.
|
||||||
@event{EVT_MENU(id, func)}
|
@event{EVT_MENU(id, func)}
|
||||||
Process a @c wxEVT_COMMAND_MENU_SELECTED command, which is generated by a menu item.
|
Process a @c wxEVT_COMMAND_MENU_SELECTED command, which is generated by a menu item.
|
||||||
@event{EVT_MENU_RANGE(id1, id2, func)}
|
@event{EVT_MENU_RANGE(id1, id2, func)}
|
||||||
|
@@ -35,6 +35,7 @@ static void gtk_checklist_toggled(GtkCellRendererToggle * WXUNUSED(renderer),
|
|||||||
listbox->GetId() );
|
listbox->GetId() );
|
||||||
new_event.SetEventObject( listbox );
|
new_event.SetEventObject( listbox );
|
||||||
new_event.SetInt( gtk_tree_path_get_indices(path)[0] );
|
new_event.SetInt( gtk_tree_path_get_indices(path)[0] );
|
||||||
|
new_event.SetString( listbox->GetString( new_event.GetInt() ));
|
||||||
gtk_tree_path_free(path);
|
gtk_tree_path_free(path);
|
||||||
listbox->Check( new_event.GetInt(), !listbox->IsChecked(new_event.GetInt()));
|
listbox->Check( new_event.GetInt(), !listbox->IsChecked(new_event.GetInt()));
|
||||||
listbox->HandleWindowEvent( new_event );
|
listbox->HandleWindowEvent( new_event );
|
||||||
|
@@ -121,6 +121,7 @@ void wxCheckListBox::SetValueCallback( unsigned int n, wxListWidgetColumn* col ,
|
|||||||
|
|
||||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
|
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
|
||||||
event.SetInt( n );
|
event.SetInt( n );
|
||||||
|
event.SetString( GetString( n ) );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
HandleWindowEvent( event );
|
HandleWindowEvent( event );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user