]> git.sesse.net Git - vlc/commitdiff
modules/gui/wxwindows/*:
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Mon, 17 Nov 2003 00:06:19 +0000 (00:06 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Mon, 17 Nov 2003 00:06:19 +0000 (00:06 +0000)
 * implemented sorting by a column by clicking on it

modules/gui/wxwindows/playlist.cpp
modules/gui/wxwindows/wxwindows.h

index 028caa18ca75e8b8ba8b91ffa953c7b43303ce99..2583c96c43579a61a765f19b6864e398e7f47370 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: playlist.cpp,v 1.23 2003/10/29 17:32:54 zorglub Exp $
+ * $Id: playlist.cpp,v 1.24 2003/11/17 00:06:19 sigmunau Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *
@@ -114,6 +114,7 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
 
     /* Listview events */
     EVT_LIST_ITEM_ACTIVATED(ListView_Event, Playlist::OnActivateItem)
+    EVT_LIST_COL_CLICK(ListView_Event, Playlist::OnColSelect)
     EVT_LIST_KEY_DOWN(ListView_Event, Playlist::OnKeyDown)
 
     /* Button events */
@@ -663,6 +664,36 @@ void Playlist::OnSort( wxCommandEvent& event )
     return;
 }
 
+void Playlist::OnColSelect( wxListEvent& event )
+{
+    playlist_t *p_playlist =
+        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                       FIND_ANYWHERE );
+    if( p_playlist == NULL )
+    {
+        return;
+    }
+    switch( event.GetColumn() )
+    {
+        case 0:
+            playlist_SortTitle( p_playlist, 0 );
+            break;
+        case 1:
+            playlist_SortAuthor( p_playlist, 0 );
+            break;
+        case 2:
+            playlist_SortGroup( p_playlist, 0 );
+            break;
+        default:
+            break;
+    }
+    vlc_object_release( p_playlist );
+
+    Rebuild();
+
+    return;
+}
+
 /**********************************************************************
  * Search functions
  **********************************************************************/
index 4a538e8cb35afaeaaecef7ea3f12064281956730..4eb1a22f6dddb105a3807faa6a64e426cb32bc0d 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.69 2003/11/10 00:14:05 gbazin Exp $
+ * $Id: wxwindows.h,v 1.70 2003/11/17 00:06:19 sigmunau Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -747,6 +747,7 @@ private:
     void OnSave( wxCommandEvent& event );
 
     void OnSort( wxCommandEvent& event );
+    void OnColSelect( wxListEvent& event );
 
     void OnUp( wxCommandEvent& event);
     void OnDown( wxCommandEvent& event);