Commit d5f52eba authored by Olivier Teulière's avatar Olivier Teulière

* ./modules/gui/wxwindows: added a log window

parent bd92601c
......@@ -2,6 +2,7 @@ SOURCES_wxwindows = \
modules/gui/wxwindows/wxwindows.cpp \
modules/gui/wxwindows/wxwindows.h \
modules/gui/wxwindows/interface.cpp \
modules/gui/wxwindows/messages.cpp \
modules/gui/wxwindows/playlist.cpp \
modules/gui/wxwindows/popup.cpp \
modules/gui/wxwindows/timer.cpp \
......
......@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.10 2002/12/08 19:56:04 gbazin Exp $
* $Id: interface.cpp,v 1.11 2002/12/15 18:37:39 ipkiss Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -109,6 +109,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
EVT_MENU(Exit_Event, Interface::OnExit)
EVT_MENU(About_Event, Interface::OnAbout)
EVT_MENU(Playlist_Event, Interface::OnPlaylist)
EVT_MENU(Logs_Event, Interface::OnLogs)
EVT_MENU(OpenFile_Event, Interface::OnOpenFile)
/* Toolbar events */
EVT_MENU(OpenFile_Event, Interface::OnOpenFile)
......@@ -347,6 +348,16 @@ void Interface::OnPlaylist( wxCommandEvent& WXUNUSED(event) )
}
}
void Interface::OnLogs( wxCommandEvent& WXUNUSED(event) )
{
/* Show/hide the log window */
wxFrame *p_messages_window = p_intf->p_sys->p_messages_window;
if( p_messages_window )
{
p_messages_window->Show( ! p_messages_window->IsShown() );
}
}
void Interface::OnOpenFile( wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog( this, _("Open file"), _(""), _(""), _("*.*") );
......
......@@ -2,7 +2,7 @@
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: timer.cpp,v 1.6 2002/12/13 01:50:32 gbazin Exp $
* $Id: timer.cpp,v 1.7 2002/12/15 18:37:39 ipkiss Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -109,14 +109,7 @@ void Timer::Notify()
}
/* Update the log window */
vlc_mutex_lock( p_intf->p_sys->p_sub->p_lock );
i_stop = *p_intf->p_sys->p_sub->pi_stop;
vlc_mutex_unlock( p_intf->p_sys->p_sub->p_lock );
if( p_intf->p_sys->p_sub->i_start != i_stop )
{
/* Append all messages to log window */
}
p_intf->p_sys->p_messages_window->UpdateLog();
/* Update the playlist */
p_intf->p_sys->p_playlist_window->Manage();
......
......@@ -2,7 +2,7 @@
* wxwindows.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: wxwindows.cpp,v 1.8 2002/12/13 01:50:32 gbazin Exp $
* $Id: wxwindows.cpp,v 1.9 2002/12/15 18:37:39 ipkiss Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -198,10 +198,13 @@ bool Instance::OnInit()
/* Create the playlist window */
p_intf->p_sys->p_playlist_window = new Playlist( p_intf, MainInterface );
/* Create the log window */
p_intf->p_sys->p_messages_window = new Messages( p_intf, MainInterface );
/* Show the interface */
MainInterface->Show(TRUE);
MainInterface->Show( TRUE );
SetTopWindow(MainInterface);
SetTopWindow( MainInterface );
/* Start timer */
new Timer( p_intf, MainInterface );
......
......@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.5 2002/12/13 01:50:32 gbazin Exp $
* $Id: wxwindows.h,v 1.6 2002/12/15 18:37:39 ipkiss Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -22,9 +22,11 @@
*****************************************************************************/
#include <wx/listctrl.h>
#include <wx/textctrl.h>
#include <wx/dnd.h>
class Playlist;
class Messages;
#define SLIDER_MAX_POS 10000
......@@ -38,6 +40,7 @@ struct intf_sys_t
/* secondary windows */
Playlist *p_playlist_window;
Messages *p_messages_window;
/* special actions */
vlc_bool_t b_playing;
......@@ -121,7 +124,9 @@ private:
/* Event handlers (these functions should _not_ be virtual) */
void OnExit( wxCommandEvent& event );
void OnAbout( wxCommandEvent& event );
void OnMessages( wxCommandEvent& event );
void OnPlaylist( wxCommandEvent& event );
void OnLogs( wxCommandEvent& event );
void OnOpenFile( wxCommandEvent& event );
void OnPlayStream( wxCommandEvent& event );
void OnStopStream( wxCommandEvent& event );
......@@ -136,6 +141,31 @@ private:
intf_thread_t *p_intf;
};
/* Messages */
class Messages: public wxFrame
{
public:
/* Constructor */
Messages( intf_thread_t *p_intf, Interface *_p_main_interface );
virtual ~Messages();
void UpdateLog();
private:
/* Event handlers (these functions should _not_ be virtual) */
void OnClose( wxCommandEvent& event );
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
Interface *p_main_interface;
wxButton *ok_button;
wxTextCtrl *textctrl;
wxTextAttr *info_attr;
wxTextAttr *err_attr;
wxTextAttr *warn_attr;
wxTextAttr *dbg_attr;
};
/* Playlist */
class Playlist: public wxFrame
{
......@@ -147,6 +177,8 @@ public:
void Manage();
private:
void DeleteItem( int item );
/* Event handlers (these functions should _not_ be virtual) */
void OnAddUrl( wxCommandEvent& event );
void OnAddDirectory( wxCommandEvent& event );
......@@ -159,7 +191,6 @@ private:
DECLARE_EVENT_TABLE();
void DeleteItem( int item );
intf_thread_t *p_intf;
Interface *p_main_interface;
wxListView *listview;
......
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