wxLB_MULTIPLE is same as wxLB_EXTENDED in wxGTK2

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-06-23 22:49:21 +00:00
parent b0267bdc2c
commit b4de6e0d25
2 changed files with 9 additions and 12 deletions

View File

@ -28,10 +28,11 @@
Single-selection list. Single-selection list.
@style{wxLB_MULTIPLE} @style{wxLB_MULTIPLE}
Multiple-selection list: the user can toggle multiple items on and Multiple-selection list: the user can toggle multiple items on and
off. off. This is the same as wxLB_EXTENDED in wxGTK2 port.
@style{wxLB_EXTENDED} @style{wxLB_EXTENDED}
Extended-selection list: the user can select multiple items using Extended-selection list: the user can extend the selection by using
the SHIFT key and the mouse or special key combinations. @c SHIFT or @c CTRL keys together with the cursor movement keys or
the mouse.
@style{wxLB_HSCROLL} @style{wxLB_HSCROLL}
Create horizontal scrollbar if contents are too wide (Windows only). Create horizontal scrollbar if contents are too wide (Windows only).
@style{wxLB_ALWAYS_SB} @style{wxLB_ALWAYS_SB}

View File

@ -119,11 +119,11 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection),
{ {
if (g_blockEventsOnDrag) return; if (g_blockEventsOnDrag) return;
if (listbox->HasFlag(wxLB_MULTIPLE) || listbox->HasFlag(wxLB_EXTENDED)) if (listbox->HasFlag(wxLB_MULTIPLE | wxLB_EXTENDED))
{ {
listbox->CalcAndSendEvent(); listbox->CalcAndSendEvent();
} }
else else // single selection
{ {
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() ); wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
event.SetEventObject( listbox ); event.SetEventObject( listbox );
@ -421,17 +421,13 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
gtk_tree_view_set_enable_search(m_treeview, FALSE); gtk_tree_view_set_enable_search(m_treeview, FALSE);
GtkSelectionMode mode; GtkSelectionMode mode;
if (style & wxLB_MULTIPLE) // GTK_SELECTION_EXTENDED is a deprecated synonym for GTK_SELECTION_MULTIPLE
if ( style & (wxLB_MULTIPLE | wxLB_EXTENDED) )
{ {
mode = GTK_SELECTION_MULTIPLE; mode = GTK_SELECTION_MULTIPLE;
} }
else if (style & wxLB_EXTENDED) else // no multi-selection flags specified
{ {
mode = GTK_SELECTION_EXTENDED;
}
else
{
// if style was 0 set single mode
m_windowStyle |= wxLB_SINGLE; m_windowStyle |= wxLB_SINGLE;
mode = GTK_SELECTION_SINGLE; mode = GTK_SELECTION_SINGLE;
} }