Commit f57fdbdd authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/preferences.cpp: compilation fix + cosmetic code clean-up
(indentations mainly).
parent a8855655
......@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.28 2003/09/22 14:40:10 zorglub Exp $
* $Id: preferences.cpp,v 1.29 2003/09/22 21:07:35 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -121,7 +121,7 @@ public:
PrefsPanel() { }
PrefsPanel( wxWindow *parent, intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog, int i_object_id, char *, char * );
PrefsDialog *, int i_object_id, char *, char * );
virtual ~PrefsPanel() {}
void ApplyChanges();
......@@ -410,7 +410,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
config_data->psz_section = NULL;
config_data->i_object_id = GENERAL_ID;
config_data->psz_help = strdup( GENERAL_HELP );
printf("dans pouet: %i\n",config_data->i_object_id);
general_item = AppendItem( root_item, wxU(_("General Settings")),
-1, -1, config_data );
......@@ -765,7 +764,7 @@ void PrefsTreeCtrl::OnAdvanced( wxCommandEvent& event )
*****************************************************************************/
PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog,
int i_object_id, char *psz_section, char*psz_help )
int i_object_id, char *psz_section, char *psz_help )
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize )
{
module_config_t *p_item;
......@@ -797,14 +796,11 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
if( i_object_id == PLUGIN_ID || i_object_id == GENERAL_ID ||
i_object_id == CAPABILITY_ID )
{
wxStaticBox *static_box = new wxStaticBox( this, -1, wxT( "" ) );
wxStaticBox *static_box = new wxStaticBox( this, -1, wxT("") );
wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( static_box,
wxVERTICAL );
label = new wxStaticText( this, -1,
wxU(_( psz_help) ) );
label = new wxStaticText( this, -1, wxU(_( psz_help) ) );
box_sizer->Add( label, 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
sizer->Add( box_sizer, 0, wxEXPAND | wxALL , 5 );
}
else
......@@ -836,8 +832,9 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
p_item++;
}
}
/* Add a head title to the panel */
wxStaticBox *static_box = new wxStaticBox( this, -1, wxT( "" ) );
wxStaticBox *static_box = new wxStaticBox( this, -1, wxT("") );
wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( static_box,
wxVERTICAL );
......@@ -852,14 +849,12 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
sizer->Add( box_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT , 5 );
if( psz_help && psz_help[1] )
/* Check that we have at least something */
if( psz_help && psz_help[1] )
{
help_box = new wxStaticBox( this, -1, wxT( "" ) );
help_sizer = new wxStaticBoxSizer( help_box,
wxHORIZONTAL ) ;
help = new wxStaticText( this, -1,
wxT(_( psz_help) ),
help_box = new wxStaticBox( this, -1, wxT("") );
help_sizer = new wxStaticBoxSizer( help_box, wxHORIZONTAL ) ;
help = new wxStaticText( this, -1, wxU(_(psz_help)),
wxDefaultPosition, wxDefaultSize,
wxST_NO_AUTORESIZE | wxALIGN_LEFT,
wxT("") );
......@@ -882,8 +877,8 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
strcmp( psz_section, p_item->psz_text ) )
break;
/* put each config option in a separate panel so we can hide advanced
* options easily */
/* put each config option in a separate panel so we can hide
* advanced options easily */
wxPanel *panel = new wxPanel( config_window, -1, wxDefaultPosition,
wxDefaultSize );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxHORIZONTAL );
......@@ -908,13 +903,11 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
{
p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability,
p_item->psz_type ) )
if( !strcmp( p_parser->psz_capability, p_item->psz_type ) )
{
combo->Append( wxU(p_parser->psz_longname),
p_parser->psz_object_name );
if( p_item->psz_value &&
!strcmp(p_item->psz_value,
if( p_item->psz_value && !strcmp(p_item->psz_value,
p_parser->psz_object_name) )
combo->SetValue( wxU(p_parser->psz_longname) );
}
......@@ -940,7 +933,8 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
{
textctrl = new wxTextCtrl( panel, -1,
wxU(p_item->psz_value),
wxDefaultPosition, wxDefaultSize,
wxDefaultPosition,
wxDefaultSize,
wxTE_PROCESS_ENTER);
textctrl->SetToolTip( wxU(p_item->psz_longtext) );
config_data->control.textctrl = textctrl;
......@@ -950,7 +944,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
{
combo = new wxComboBox( panel, -1, wxU(p_item->psz_value),
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY | wxCB_SORT );
0, NULL, wxCB_READONLY|wxCB_SORT );
/* build a list of available options */
for( int i_index = 0; p_item->ppsz_list[i_index];
......@@ -984,7 +978,8 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
case CONFIG_ITEM_INTEGER:
label = new wxStaticText(panel, -1, wxU(p_item->psz_text));
spin = new wxSpinCtrl( panel, -1,
wxString::Format(wxT("%d"),p_item->i_value),
wxString::Format(wxT("%d"),
p_item->i_value),
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS,
-16000, 16000, p_item->i_value);
......@@ -1012,8 +1007,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
combo = new wxComboBox( panel, -1, wxU("f"),
wxDefaultPosition, wxDefaultSize, 0
, NULL, wxCB_READONLY | wxCB_SORT );
for( int i = 0; i < sizeof(keys)/sizeof(key_descriptor_s);
i++ )
for( int i=0; i < sizeof(keys)/sizeof(key_descriptor_s); i++ )
{
combo->Append( wxU(_(keys[i].psz_key_string)),
(void*)&keys[i].i_key_code );
......@@ -1024,18 +1018,17 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL
| wxALL, 5 );
panel_sizer->Add( alt, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel_sizer->Add( ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel_sizer->Add( shift, 0, wxALIGN_CENTER_VERTICAL |
wxALL, 5 );
panel_sizer->Add( combo, 0, wxALIGN_CENTER_VERTICAL
| wxALL, 5 );
panel_sizer->Add( ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
panel_sizer->Add( shift, 0, wxALIGN_CENTER_VERTICAL |wxALL, 5);
panel_sizer->Add( combo, 0, wxALIGN_CENTER_VERTICAL |wxALL, 5);
break;
}
case CONFIG_ITEM_FLOAT:
label = new wxStaticText(panel, -1, wxU(p_item->psz_text));
textctrl = new wxTextCtrl( panel, -1,
wxString::Format(wxT("%f"),p_item->f_value),
wxString::Format(wxT("%f"),
p_item->f_value),
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER );
textctrl->SetToolTip( wxU(p_item->psz_longtext) );
......@@ -1056,7 +1049,6 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
if( p_item->b_advanced ) b_has_advanced = VLC_TRUE;
break;
default:
delete panel; panel = NULL;
delete panel_sizer;
......@@ -1076,6 +1068,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
config_sizer->Add( panel, 0, wxEXPAND | wxALL, 2 );
}
while( p_item->i_type != CONFIG_HINT_END && p_item++ );
config_sizer->Layout();
config_window->SetSizer( config_sizer );
sizer->Add( config_window, 1, wxEXPAND | wxALL, 5 );
......
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