modules/gui/wxwindows/*:

 * implemented sorting by a column by clicking on it
parent aed1e85b
......@@ -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 Teulire <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
**********************************************************************/
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment