1 /*****************************************************************************
\r
2 * preferences.h: the "Preferences" dialog box
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2002 VideoLAN
\r
6 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
21 *****************************************************************************/
\r
23 #ifndef preferencesH
\r
24 #define preferencesH
\r
25 //---------------------------------------------------------------------------
\r
26 #include <Classes.hpp>
\r
27 #include <Controls.hpp>
\r
28 #include <StdCtrls.hpp>
\r
29 #include <Forms.hpp>
\r
30 #include <Buttons.hpp>
\r
31 #include <ComCtrls.hpp>
\r
32 #include <ExtCtrls.hpp>
\r
33 //---------------------------------------------------------------------------
\r
34 class TGroupBoxPref : public TGroupBox
\r
37 __fastcall TGroupBoxPref( TComponent* Owner, module_config_t *p_config_arg );
\r
38 module_config_t *p_config;
\r
39 TListView * __fastcall CreateListView( TWinControl *Parent,
\r
40 int Left, int Width, int Top, int Height, TViewStyle ViewStyle );
\r
41 TButton * __fastcall CreateButton( TWinControl *Parent,
\r
42 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
43 TCheckBox * __fastcall CreateCheckBox( TWinControl *Parent,
\r
44 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
45 TLabel * __fastcall CreateLabel( TWinControl *Parent,
\r
46 int Left, int Width, int Top, int Height, AnsiString Caption,
\r
48 TEdit * __fastcall CreateEdit( TWinControl *Parent,
\r
49 int Left, int Width, int Top, int Height, AnsiString Text );
\r
50 TUpDown * __fastcall CreateUpDown( TWinControl *Parent,
\r
51 int Min, int Max, int Position, bool Thousands );
\r
53 //---------------------------------------------------------------------------
\r
54 class TGroupBoxPlugin : public TGroupBoxPref
\r
57 __fastcall TGroupBoxPlugin( TComponent* Owner, module_config_t *p_config );
\r
58 TListView *ListView;
\r
59 TButton *ButtonConfig;
\r
60 TButton *ButtonSelect;
\r
63 TLabel *LabelSelected;
\r
65 module_t *ModuleSelected;
\r
66 void __fastcall ListViewSelectItem( TObject *Sender, TListItem *Item,
\r
68 void __fastcall ButtonSelectClick( TObject *Sender );
\r
69 void __fastcall ButtonConfigClick( TObject *Sender );
\r
70 void __fastcall EditChange( TObject *Sender );
\r
72 //---------------------------------------------------------------------------
\r
73 class TGroupBoxString : public TGroupBoxPref
\r
76 __fastcall TGroupBoxString( TComponent* Owner, module_config_t *p_config );
\r
79 void __fastcall EditChange( TObject *Sender );
\r
81 //---------------------------------------------------------------------------
\r
82 class TGroupBoxInteger : public TGroupBoxPref
\r
85 __fastcall TGroupBoxInteger( TComponent* Owner, module_config_t *p_config );
\r
89 void __fastcall EditChange( TObject *Sender );
\r
91 //---------------------------------------------------------------------------
\r
92 class TGroupBoxBool : public TGroupBoxPref
\r
95 __fastcall TGroupBoxBool( TComponent* Owner, module_config_t *p_config );
\r
97 TCheckBox *CheckBox;
\r
98 void __fastcall CheckBoxClick( TObject *Sender );
\r
100 //---------------------------------------------------------------------------
\r
101 class TPreferencesDlg : public TForm
\r
103 __published: // IDE-managed Components
\r
104 TPageControl *PageControlPref;
\r
105 TButton *ButtonApply;
\r
106 TButton *ButtonSave;
\r
108 TButton *ButtonCancel;
\r
109 void __fastcall FormShow( TObject *Sender );
\r
110 void __fastcall FormHide( TObject *Sender );
\r
111 void __fastcall ButtonOkClick( TObject *Sender );
\r
112 void __fastcall ButtonApplyClick( TObject *Sender );
\r
113 void __fastcall ButtonSaveClick( TObject *Sender );
\r
114 void __fastcall ButtonCancelClick( TObject *Sender );
\r
115 void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
\r
116 private: // User declarations
\r
117 public: // User declarations
\r
118 __fastcall TPreferencesDlg( TComponent* Owner );
\r
119 void __fastcall CreateConfigDialog( char *psz_module_name );
\r
120 void __fastcall SaveValue( module_config_t *p_config );
\r
122 //---------------------------------------------------------------------------
\r