Commit 5cc09386 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: misc small improvements and fixes.
parent fd76cffd
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* fileinfo.cpp : wxWindows plugin for vlc * fileinfo.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: fileinfo.cpp,v 1.5 2003/03/26 00:56:22 gbazin Exp $ * $Id: fileinfo.cpp,v 1.6 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -61,9 +61,9 @@ BEGIN_EVENT_TABLE(FileInfo, wxFrame) ...@@ -61,9 +61,9 @@ BEGIN_EVENT_TABLE(FileInfo, wxFrame)
/* Button events */ /* Button events */
EVT_BUTTON(wxID_OK, FileInfo::OnClose) EVT_BUTTON(wxID_OK, FileInfo::OnClose)
/* Special events : we don't want to destroy the window when the user /* Destroy the window when the user closes the window */
* clicks on (X) */
EVT_CLOSE(FileInfo::OnClose) EVT_CLOSE(FileInfo::OnClose)
END_EVENT_TABLE() END_EVENT_TABLE()
/***************************************************************************** /*****************************************************************************
...@@ -76,13 +76,19 @@ FileInfo::FileInfo( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -76,13 +76,19 @@ FileInfo::FileInfo( intf_thread_t *_p_intf, Interface *_p_main_interface ):
/* Initializations */ /* Initializations */
intf_thread_t *p_intf = _p_intf; intf_thread_t *p_intf = _p_intf;
input_thread_t *p_input = p_intf->p_sys->p_input; input_thread_t *p_input = p_intf->p_sys->p_input;
SetIcon( *p_intf->p_sys->p_icon );
SetAutoLayout(TRUE);
/* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 );
panel->SetAutoLayout( TRUE );
wxTreeCtrl *tree = wxTreeCtrl *tree =
new wxTreeCtrl( this, -1, wxDefaultPosition, wxSize(350,350), new wxTreeCtrl( panel, -1, wxDefaultPosition, wxSize(350,350),
wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT | wxSUNKEN_BORDER ); wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT | wxSUNKEN_BORDER );
/* Create the OK button */ /* Create the OK button */
wxButton *ok_button = new wxButton( this, wxID_OK, _("OK") ); wxButton *ok_button = new wxButton( panel, wxID_OK, _("OK") );
ok_button->SetDefault(); ok_button->SetDefault();
/* Place everything in sizers */ /* Place everything in sizers */
...@@ -90,14 +96,22 @@ FileInfo::FileInfo( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -90,14 +96,22 @@ FileInfo::FileInfo( intf_thread_t *_p_intf, Interface *_p_main_interface ):
ok_button_sizer->Add( ok_button, 0, wxALL, 5 ); ok_button_sizer->Add( ok_button, 0, wxALL, 5 );
ok_button_sizer->Layout(); ok_button_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
main_sizer->Add( tree, 1, wxGROW|wxEXPAND | wxALL, 5 ); wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
main_sizer->Add( ok_button_sizer, 0, wxALIGN_CENTRE ); panel_sizer->Add( tree, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( ok_button_sizer, 0, wxALIGN_CENTRE );
panel_sizer->Layout();
panel->SetSizerAndFit( panel_sizer );
main_sizer->Add( panel, 1, wxEXPAND, 0 );
main_sizer->Layout(); main_sizer->Layout();
SetAutoLayout(TRUE);
SetSizerAndFit( main_sizer ); SetSizerAndFit( main_sizer );
if ( !p_intf->p_sys->p_input ) {
if ( !p_intf->p_sys->p_input )
{
/* Nothing to show, but hey... */
Show( true );
return; return;
} }
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
wxTreeItemId root = tree->AddRoot( p_input->psz_name ); wxTreeItemId root = tree->AddRoot( p_input->psz_name );
tree->Expand( root ); tree->Expand( root );
...@@ -107,12 +121,15 @@ FileInfo::FileInfo( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -107,12 +121,15 @@ FileInfo::FileInfo( intf_thread_t *_p_intf, Interface *_p_main_interface ):
wxTreeItemId cat = tree->AppendItem( root, p_cat->psz_name ); wxTreeItemId cat = tree->AppendItem( root, p_cat->psz_name );
input_info_t *p_info = p_cat->p_info; input_info_t *p_info = p_cat->p_info;
while ( p_info ) { while ( p_info ) {
tree->AppendItem( cat, wxString(p_info->psz_name) + ": " + p_info->psz_value ); tree->AppendItem( cat, wxString(p_info->psz_name) + ": "
+ p_info->psz_value );
p_info = p_info->p_next; p_info = p_info->p_next;
} }
p_cat = p_cat->p_next; p_cat = p_cat->p_next;
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
Show( true );
} }
FileInfo::~FileInfo() FileInfo::~FileInfo()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc * interface.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.18 2003/04/01 00:18:29 gbazin Exp $ * $Id: interface.cpp,v 1.19 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -138,11 +138,11 @@ Interface::Interface( intf_thread_t *_p_intf ): ...@@ -138,11 +138,11 @@ Interface::Interface( intf_thread_t *_p_intf ):
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_prefs_dialog = NULL; p_prefs_dialog = NULL;
p_fileinfo_window = NULL;
i_old_playing_status = PAUSE_S; i_old_playing_status = PAUSE_S;
/* Give our interface a nice little icon */ /* Give our interface a nice little icon */
SetIcon( *new wxIcon( vlc_xpm ) ); p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
SetIcon( *p_intf->p_sys->p_icon );
/* Create a sizer for the main frame */ /* Create a sizer for the main frame */
frame_sizer = new wxBoxSizer( wxHORIZONTAL ); frame_sizer = new wxBoxSizer( wxHORIZONTAL );
...@@ -183,7 +183,6 @@ Interface::Interface( intf_thread_t *_p_intf ): ...@@ -183,7 +183,6 @@ Interface::Interface( intf_thread_t *_p_intf ):
Interface::~Interface() Interface::~Interface()
{ {
if( p_prefs_dialog ) p_prefs_dialog->Destroy(); if( p_prefs_dialog ) p_prefs_dialog->Destroy();
if( p_fileinfo_window ) p_fileinfo_window->Destroy();
} }
/***************************************************************************** /*****************************************************************************
...@@ -417,16 +416,8 @@ void Interface::OnLogs( wxCommandEvent& WXUNUSED(event) ) ...@@ -417,16 +416,8 @@ void Interface::OnLogs( wxCommandEvent& WXUNUSED(event) )
void Interface::OnFileInfo( wxCommandEvent& WXUNUSED(event) ) void Interface::OnFileInfo( wxCommandEvent& WXUNUSED(event) )
{ {
/* Show/hide the fileinfo window */ /* Open a fileinfo window */
if( p_fileinfo_window == NULL ) new FileInfo( p_intf, this );
{
p_fileinfo_window = new FileInfo( p_intf, this );
}
if( p_fileinfo_window )
{
p_fileinfo_window->Show( true );//! p_messages_window->IsShown() );
}
} }
void Interface::OnPreferences( wxCommandEvent& WXUNUSED(event) ) void Interface::OnPreferences( wxCommandEvent& WXUNUSED(event) )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc * playlist.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: messages.cpp,v 1.1 2002/12/15 22:45:09 ipkiss Exp $ * $Id: messages.cpp,v 1.2 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* *
...@@ -76,6 +76,7 @@ Messages::Messages( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -76,6 +76,7 @@ Messages::Messages( intf_thread_t *_p_intf, Interface *_p_main_interface ):
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */ /* Create a panel to put everything in */
wxPanel *messages_panel = new wxPanel( this, -1 ); wxPanel *messages_panel = new wxPanel( this, -1 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.11 2003/04/01 00:18:29 gbazin Exp $ * $Id: open.cpp,v 1.12 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -144,6 +144,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface, ...@@ -144,6 +144,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface,
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */ /* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 ); wxPanel *panel = new wxPanel( this, -1 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc * playlist.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: playlist.cpp,v 1.6 2003/03/26 00:56:22 gbazin Exp $ * $Id: playlist.cpp,v 1.7 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* *
...@@ -98,6 +98,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -98,6 +98,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ):
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
SetIcon( *p_intf->p_sys->p_icon );
/* Create our "Manage" menu */ /* Create our "Manage" menu */
wxMenu *manage_menu = new wxMenu; wxMenu *manage_menu = new wxMenu;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc * preferences.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.9 2003/04/01 00:18:29 gbazin Exp $ * $Id: preferences.cpp,v 1.10 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -188,6 +188,8 @@ BEGIN_EVENT_TABLE(PrefsDialog, wxFrame) ...@@ -188,6 +188,8 @@ BEGIN_EVENT_TABLE(PrefsDialog, wxFrame)
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
EVT_BUTTON(wxID_SAVE, PrefsDialog::OnSave) EVT_BUTTON(wxID_SAVE, PrefsDialog::OnSave)
/* Don't destroy the window when the user closes it */
EVT_CLOSE(PrefsDialog::OnCancel)
END_EVENT_TABLE() END_EVENT_TABLE()
// menu and control ids // menu and control ids
...@@ -223,6 +225,7 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, Interface *_p_main_interface) ...@@ -223,6 +225,7 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, Interface *_p_main_interface)
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */ /* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 ); wxPanel *panel = new wxPanel( this, -1 );
...@@ -435,7 +438,9 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -435,7 +438,9 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
p_sizer->Layout(); p_sizer->Layout();
/* Update Tree Ctrl */ /* Update Tree Ctrl */
#ifndef WIN32 /* Workaround a bug in win32 implementation */
SelectItem( GetFirstChild( root_item, cookie ) ); SelectItem( GetFirstChild( root_item, cookie ) );
#endif
} }
PrefsTreeCtrl::~PrefsTreeCtrl() PrefsTreeCtrl::~PrefsTreeCtrl()
...@@ -677,10 +682,10 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -677,10 +682,10 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
case CONFIG_ITEM_FLOAT: case CONFIG_ITEM_FLOAT:
label = new wxStaticText(panel, -1, p_item->psz_text); label = new wxStaticText(panel, -1, p_item->psz_text);
spin = new wxSpinCtrl( panel, -1, spin = new wxSpinCtrl( panel, -1,
wxString::Format("%d", p_item->i_value), wxString::Format("%f", p_item->f_value),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, wxSP_ARROW_KEYS,
0, 16000, p_item->i_value); 0, 16000, (int)p_item->f_value);
spin->SetToolTip( p_item->psz_longtext ); spin->SetToolTip( p_item->psz_longtext );
config_data->control.spinctrl = spin; config_data->control.spinctrl = spin;
panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc * streamout.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.4 2003/04/01 00:18:29 gbazin Exp $ * $Id: streamout.cpp,v 1.5 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -132,6 +132,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -132,6 +132,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ):
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */ /* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 ); wxPanel *panel = new wxPanel( this, -1 );
...@@ -356,7 +357,7 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent ) ...@@ -356,7 +357,7 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
new wxRadioButton( panel, EncapsulationRadio1_Event + i, new wxRadioButton( panel, EncapsulationRadio1_Event + i,
encapsulation_array[i] ); encapsulation_array[i] );
panel_sizer->Add( encapsulation_radios[i], 0, panel_sizer->Add( encapsulation_radios[i], 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 5 ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
} }
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.14 2003/03/30 11:43:38 gbazin Exp $ * $Id: wxwindows.h,v 1.15 2003/04/01 16:11:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -39,6 +39,7 @@ struct intf_sys_t ...@@ -39,6 +39,7 @@ struct intf_sys_t
{ {
/* the wx parent window */ /* the wx parent window */
wxWindow *p_wxwindow; wxWindow *p_wxwindow;
wxIcon *p_icon;
/* secondary windows */ /* secondary windows */
Playlist *p_playlist_window; Playlist *p_playlist_window;
...@@ -156,7 +157,6 @@ private: ...@@ -156,7 +157,6 @@ private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
wxFrame *p_prefs_dialog; wxFrame *p_prefs_dialog;
wxFrame *p_fileinfo_window;
int i_old_playing_status; int i_old_playing_status;
}; };
......
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