]> git.saurik.com Git - wxWidgets.git/commitdiff
wxLB_MULTIPLE is same as wxLB_EXTENDED in wxGTK2
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Jun 2008 22:49:21 +0000 (22:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Jun 2008 22:49:21 +0000 (22:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/listbox.h
src/gtk/listbox.cpp

index eaf1d8e1a4abdce6a008d77ec6ce9016adf628ed..7d9ad3baaa12edfa3ca1c8068f680042bca7b293 100644 (file)
            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}
index 5c1bbc56b10cb10149b8b4847aa4e5fb1bf599e7..5f504233bd644bf81d09132aa7142079efd097d2 100644 (file)
@@ -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;
     }