* fileinfo.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
/* Button events */
EVT_BUTTON(wxID_OK, FileInfo::OnClose)
- /* Special events : we don't want to destroy the window when the user
- * clicks on (X) */
+ /* Destroy the window when the user closes the window */
EVT_CLOSE(FileInfo::OnClose)
+
END_EVENT_TABLE()
/*****************************************************************************
/* Initializations */
intf_thread_t *p_intf = _p_intf;
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 =
- new wxTreeCtrl( this, -1, wxDefaultPosition, wxSize(350,350),
+ new wxTreeCtrl( panel, -1, wxDefaultPosition, wxSize(350,350),
wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT | wxSUNKEN_BORDER );
/* 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();
/* Place everything in sizers */
ok_button_sizer->Add( ok_button, 0, wxALL, 5 );
ok_button_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
- main_sizer->Add( tree, 1, wxGROW|wxEXPAND | wxALL, 5 );
- main_sizer->Add( ok_button_sizer, 0, wxALIGN_CENTRE );
+ wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
+ 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();
- SetAutoLayout(TRUE);
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;
}
+
vlc_mutex_lock( &p_input->stream.stream_lock );
wxTreeItemId root = tree->AddRoot( p_input->psz_name );
tree->Expand( root );
wxTreeItemId cat = tree->AppendItem( root, p_cat->psz_name );
input_info_t *p_info = p_cat->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_cat = p_cat->p_next;
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+ Show( true );
}
FileInfo::~FileInfo()
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
/* Initializations */
p_intf = _p_intf;
p_prefs_dialog = NULL;
- p_fileinfo_window = NULL;
i_old_playing_status = PAUSE_S;
/* 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 */
frame_sizer = new wxBoxSizer( wxHORIZONTAL );
Interface::~Interface()
{
if( p_prefs_dialog ) p_prefs_dialog->Destroy();
- if( p_fileinfo_window ) p_fileinfo_window->Destroy();
}
/*****************************************************************************
void Interface::OnFileInfo( wxCommandEvent& WXUNUSED(event) )
{
- /* Show/hide the fileinfo window */
- if( p_fileinfo_window == NULL )
- {
- p_fileinfo_window = new FileInfo( p_intf, this );
- }
-
- if( p_fileinfo_window )
- {
- p_fileinfo_window->Show( true );//! p_messages_window->IsShown() );
- }
+ /* Open a fileinfo window */
+ new FileInfo( p_intf, this );
}
void Interface::OnPreferences( wxCommandEvent& WXUNUSED(event) )
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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 Teulière <ipkiss@via.ecp.fr>
*
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
+ SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */
wxPanel *messages_panel = new wxPanel( this, -1 );
* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
+ SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 );
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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 Teulière <ipkiss@via.ecp.fr>
*
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
+ SetIcon( *p_intf->p_sys->p_icon );
/* Create our "Manage" menu */
wxMenu *manage_menu = new wxMenu;
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
EVT_BUTTON(wxID_SAVE, PrefsDialog::OnSave)
+ /* Don't destroy the window when the user closes it */
+ EVT_CLOSE(PrefsDialog::OnCancel)
END_EVENT_TABLE()
// menu and control ids
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
+ SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 );
p_sizer->Layout();
/* Update Tree Ctrl */
+#ifndef WIN32 /* Workaround a bug in win32 implementation */
SelectItem( GetFirstChild( root_item, cookie ) );
+#endif
}
PrefsTreeCtrl::~PrefsTreeCtrl()
case CONFIG_ITEM_FLOAT:
label = new wxStaticText(panel, -1, p_item->psz_text);
spin = new wxSpinCtrl( panel, -1,
- wxString::Format("%d", p_item->i_value),
+ wxString::Format("%f", p_item->f_value),
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS,
- 0, 16000, p_item->i_value);
+ 0, 16000, (int)p_item->f_value);
spin->SetToolTip( p_item->psz_longtext );
config_data->control.spinctrl = spin;
panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
* streamout.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
+ SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 );
new wxRadioButton( panel, EncapsulationRadio1_Event + i,
encapsulation_array[i] );
panel_sizer->Add( encapsulation_radios[i], 0,
- wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 5 );
+ wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
}
panel->SetSizerAndFit( panel_sizer );
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* 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>
*
{
/* the wx parent window */
wxWindow *p_wxwindow;
+ wxIcon *p_icon;
/* secondary windows */
Playlist *p_playlist_window;
intf_thread_t *p_intf;
wxFrame *p_prefs_dialog;
- wxFrame *p_fileinfo_window;
int i_old_playing_status;
};