\r
/* default height */\r
ClientHeight = 37 + ToolBar->Height;\r
+\r
+ StringListPref = new TStringList();\r
+}\r
+//---------------------------------------------------------------------------\r
+__fastcall TMainFrameDlg::~TMainFrameDlg()\r
+{\r
+ delete StringListPref;\r
}\r
//---------------------------------------------------------------------------\r
\r
//---------------------------------------------------------------------------\r
void __fastcall TMainFrameDlg::MenuPreferencesClick( TObject *Sender )\r
{\r
- TPreferencesDlg *p_preferences = p_intfGlobal->p_sys->p_preferences;\r
- if( p_preferences == NULL )\r
- {\r
- p_preferences = new TPreferencesDlg( this );\r
- p_preferences->CreateConfigDialog( "main" );\r
- p_intfGlobal->p_sys->p_preferences = p_preferences;\r
- }\r
- else\r
- {\r
- p_preferences->Show();\r
- }\r
+ CreatePreferences( "main" );\r
}\r
//---------------------------------------------------------------------------\r
void __fastcall TMainFrameDlg::MenuAboutClick( TObject *Sender )\r
}\r
//---------------------------------------------------------------------------\r
\r
+\r
+/*****************************************************************************\r
+ * CreateConfig: create a configuration dialog and save it for further use\r
+ *****************************************************************************\r
+ * Check if the dialog box is already opened, if so this will save us\r
+ * quite a bit of work. (the interface will be destroyed when you actually\r
+ * close the main window, but remember that it is only hidden if you\r
+ * clicked on the action buttons). This trick also allows us not to\r
+ * duplicate identical dialog windows.\r
+ *****************************************************************************/\r
+void __fastcall TMainFrameDlg::CreatePreferences( AnsiString Name )\r
+{\r
+ TPreferencesDlg *Preferences;\r
+ int i_index, i_pos;\r
+\r
+ i_index = StringListPref->IndexOf( Name );\r
+ if( i_index != -1 )\r
+ {\r
+ /* config dialog already exists */\r
+ Preferences = (TPreferencesDlg *)StringListPref->Objects[i_index];\r
+ }\r
+ else\r
+ {\r
+ /* create the config dialog */\r
+ Preferences = new TPreferencesDlg( this );\r
+ Preferences->CreateConfigDialog( Name.c_str() );\r
+\r
+ /* save it */\r
+ i_pos = StringListPref->Add( Name );\r
+ StringListPref->Objects[i_pos] = Preferences;\r
+ }\r
+\r
+ /* display the dialog */\r
+ Preferences->Show();\r
+}\r
+//---------------------------------------------------------------------------\r
+\r
+\r
object MainFrameDlg: TMainFrameDlg\r
- Left = 304\r
- Top = 245\r
- Width = 534\r
- Height = 307\r
+ Left = 314\r
+ Top = 198\r
+ Width = 535\r
+ Height = 306\r
BorderIcons = [biSystemMenu, biMinimize]\r
Caption = 'VideoLAN Client (win32 interface)'\r
Color = clBtnFace\r
object ToolBar: TToolBar\r
Left = 0\r
Top = 0\r
- Width = 526\r
+ Width = 527\r
Height = 60\r
ButtonHeight = 52\r
ButtonWidth = 39\r
end\r
object StatusBar: TStatusBar\r
Left = 0\r
- Top = 242\r
- Width = 526\r
+ Top = 241\r
+ Width = 527\r
Height = 19\r
Panels = <>\r
ParentShowHint = False\r
object GroupBoxFile: TGroupBox\r
Left = 0\r
Top = 100\r
- Width = 526\r
+ Width = 527\r
Height = 32\r
Align = alTop\r
TabOrder = 2\r
object LabelFileName: TLabel\r
Left = 2\r
Top = 15\r
- Width = 522\r
+ Width = 523\r
Height = 15\r
Align = alClient\r
Alignment = taCenter\r
object GroupBoxNetwork: TGroupBox\r
Left = 0\r
Top = 164\r
- Width = 526\r
+ Width = 527\r
Height = 40\r
Align = alTop\r
TabOrder = 3\r
object GroupBoxDisc: TGroupBox\r
Left = 0\r
Top = 132\r
- Width = 526\r
+ Width = 527\r
Height = 32\r
Align = alTop\r
TabOrder = 4\r
object GroupBoxSlider: TGroupBox\r
Left = 0\r
Top = 60\r
- Width = 526\r
+ Width = 527\r
Height = 40\r
Align = alTop\r
Caption = '0:00:00'\r
object TrackBar: TTrackBar\r
Left = 2\r
Top = 15\r
- Width = 522\r
+ Width = 523\r
Height = 21\r
Align = alTop\r
Orientation = trHorizontal\r
void __fastcall ButtonGoClick( TObject *Sender );\r
private: // User declarations\r
public: // User declarations\r
+ TStringList *StringListPref; /* stores config dialogs */\r
__fastcall TMainFrameDlg( TComponent* Owner );\r
+ virtual __fastcall ~TMainFrameDlg();\r
void __fastcall DisplayHint( TObject *Sender );\r
void __fastcall ModeManage();\r
+ void __fastcall CreatePreferences( AnsiString Name );\r
void __fastcall MenuProgramClick( TObject *Sender );\r
void __fastcall MenuAudioClick( TObject *Sender );\r
void __fastcall MenuSubtitleClick( TObject *Sender );\r
/* init configure button */\r
ButtonConfig = CreateButton( this, 16, 70, 192, 25, "Configure" );\r
ButtonConfig->Enabled = false;\r
+ ButtonConfig->OnClick = ButtonConfigClick;\r
\r
/* init select button */\r
ButtonSelect = CreateButton( this, 110, 70, 192, 25, "Select" );\r
//---------------------------------------------------------------------------\r
void __fastcall TGroupBoxPlugin::ButtonConfigClick( TObject *Sender )\r
{\r
- /* FIXME: TODO */\r
+ p_intfGlobal->p_sys->p_window->CreatePreferences( ModuleSelected->psz_name );\r
}\r
//---------------------------------------------------------------------------\r
void __fastcall TGroupBoxPlugin::UpdateChanges()\r
//---------------------------------------------------------------------------\r
void __fastcall TPreferencesDlg::FormShow( TObject *Sender )\r
{\r
+/*\r
p_intfGlobal->p_sys->p_window->MenuPreferences->Checked = true;\r
p_intfGlobal->p_sys->p_window->PopupPreferences->Checked = true;\r
+*/\r
}\r
//---------------------------------------------------------------------------\r
void __fastcall TPreferencesDlg::FormHide( TObject *Sender )\r
{\r
+/*\r
p_intfGlobal->p_sys->p_window->MenuPreferences->Checked = false;\r
p_intfGlobal->p_sys->p_window->PopupPreferences->Checked = false;\r
+*/\r
}\r
\r
\r
\r
void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )\r
{\r
- bool config_dialog;\r
module_t *p_module;\r
module_t *p_module_plugins;\r
unsigned int i;\r
TGroupBoxBool *GroupBoxBool;\r
TListItem *ListItem;\r
\r
- /* Check if the dialog box is already opened, if so this will save us\r
- * quite a bit of work. (the interface will be destroyed when you actually\r
- * close the main window, but remember that it is only hidden if you\r
- * clicked on the action buttons). This trick also allows us not to\r
- * duplicate identical dialog windows. */\r
-\r
- /* FIXME: we must find a way of really checking whether the dialog\r
- * box is already opened */\r
- config_dialog = false;\r
-\r
- if( config_dialog )\r
- {\r
- /* Yeah it was open */\r
- Show();\r
- return;\r
- }\r
-\r
/* Look for the selected module */\r
for( p_module = p_module_bank->first ; p_module != NULL ;\r
p_module = p_module->next )\r
{\r
-\r
if( psz_module_name && !strcmp( psz_module_name, p_module->psz_name ) )\r
break;\r
}\r
* FIXME: i don't know why, but both lines are necessary */\r
PageControlPref->ActivePageIndex = 1;\r
PageControlPref->ActivePageIndex = 0;\r
-\r
- /* Ok, job done successfully. Let's keep a reference to the dialog box*/\r
- /* FIXME: TODO */\r
-\r
- /* we want this ref to be destroyed if the object is destroyed */\r
- /* FIXME: TODO */\r
- \r
- Show();\r
}\r
#undef ADD_PANEL\r
//---------------------------------------------------------------------------\r
01FFFFFF0000FFFF01FFFFFF0000FFFF81FFFFFF0000FFFFC3FFFFFF0000FFFF\r
FFFFFFFF0000FFFFFFFFFFFF0000FFFFFFFFFFFF0000FFFFFFFFFFFF0000}\r
OldCreateOrder = False\r
+ Position = poDefaultPosOnly\r
OnClose = FormClose\r
OnHide = FormHide\r
OnShow = FormShow\r