From b4de6e0d251563883c64bcfa54ab730d3a1f3441 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 23 Jun 2008 22:49:21 +0000 Subject: [PATCH] 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 --- interface/listbox.h | 7 ++++--- src/gtk/listbox.cpp | 14 +++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/interface/listbox.h b/interface/listbox.h index eaf1d8e1a4..7d9ad3baaa 100644 --- a/interface/listbox.h +++ b/interface/listbox.h @@ -28,10 +28,11 @@ Single-selection list. @style{wxLB_MULTIPLE} 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} - Extended-selection list: the user can select multiple items using - the SHIFT key and the mouse or special key combinations. + Extended-selection list: the user can extend the selection by using + @c SHIFT or @c CTRL keys together with the cursor movement keys or + the mouse. @style{wxLB_HSCROLL} Create horizontal scrollbar if contents are too wide (Windows only). @style{wxLB_ALWAYS_SB} diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 5c1bbc56b1..5f504233bd 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -119,11 +119,11 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection), { if (g_blockEventsOnDrag) return; - if (listbox->HasFlag(wxLB_MULTIPLE) || listbox->HasFlag(wxLB_EXTENDED)) + if (listbox->HasFlag(wxLB_MULTIPLE | wxLB_EXTENDED)) { listbox->CalcAndSendEvent(); } - else + else // single selection { wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() ); event.SetEventObject( listbox ); @@ -421,17 +421,13 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, gtk_tree_view_set_enable_search(m_treeview, FALSE); 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; } - else if (style & wxLB_EXTENDED) - { - mode = GTK_SELECTION_EXTENDED; - } - else + else // no multi-selection flags specified { - // if style was 0 set single mode m_windowStyle |= wxLB_SINGLE; mode = GTK_SELECTION_SINGLE; } -- 2.45.2