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
34 //---------------------------------------------------------------------------
\r
35 class TGroupBoxPref : public TGroupBox
\r
38 __fastcall TGroupBoxPref( TComponent* Owner, module_config_t *p_config_arg );
\r
39 module_config_t *p_config;
\r
40 virtual void __fastcall UpdateChanges();
\r
41 TListView * __fastcall CreateListView( TWinControl *Parent,
\r
42 int Left, int Width, int Top, int Height, TViewStyle ViewStyle );
\r
43 TButton * __fastcall CreateButton( TWinControl *Parent,
\r
44 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
45 TCheckBox * __fastcall CreateCheckBox( TWinControl *Parent,
\r
46 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
47 TLabel * __fastcall CreateLabel( TWinControl *Parent,
\r
48 int Left, int Width, int Top, int Height, AnsiString Caption,
\r
50 TEdit * __fastcall CreateEdit( TWinControl *Parent,
\r
51 int Left, int Width, int Top, int Height, AnsiString Text );
\r
52 TCSpinEdit * __fastcall CreateSpinEdit( TWinControl *Parent,
\r
53 int Left, int Width, int Top, int Height,
\r
54 long Min, long Max, long Value );
\r
56 //---------------------------------------------------------------------------
\r
57 class TGroupBoxPlugin : public TGroupBoxPref
\r
60 __fastcall TGroupBoxPlugin( TComponent* Owner, module_config_t *p_config );
\r
61 TListView *ListView;
\r
62 TButton *ButtonConfig;
\r
63 TButton *ButtonSelect;
\r
66 TLabel *LabelSelected;
\r
68 module_t *ModuleSelected;
\r
69 void __fastcall UpdateChanges();
\r
70 void __fastcall ListViewSelectItem( TObject *Sender, TListItem *Item,
\r
72 void __fastcall ButtonSelectClick( TObject *Sender );
\r
73 void __fastcall ButtonConfigClick( TObject *Sender );
\r
75 //---------------------------------------------------------------------------
\r
76 class TGroupBoxString : public TGroupBoxPref
\r
79 __fastcall TGroupBoxString( TComponent* Owner, module_config_t *p_config );
\r
82 void __fastcall UpdateChanges();
\r
84 //---------------------------------------------------------------------------
\r
85 class TGroupBoxInteger : public TGroupBoxPref
\r
88 __fastcall TGroupBoxInteger( TComponent* Owner, module_config_t *p_config );
\r
90 TCSpinEdit *SpinEdit;
\r
91 void __fastcall UpdateChanges();
\r
93 //---------------------------------------------------------------------------
\r
94 class TGroupBoxBool : public TGroupBoxPref
\r
97 __fastcall TGroupBoxBool( TComponent* Owner, module_config_t *p_config );
\r
99 TCheckBox *CheckBox;
\r
100 void __fastcall UpdateChanges();
\r
102 //---------------------------------------------------------------------------
\r
103 class TPreferencesDlg : public TForm
\r
105 __published: // IDE-managed Components
\r
106 TPageControl *PageControlPref;
\r
107 TButton *ButtonApply;
\r
108 TButton *ButtonSave;
\r
110 TButton *ButtonCancel;
\r
111 void __fastcall FormShow( TObject *Sender );
\r
112 void __fastcall FormHide( TObject *Sender );
\r
113 void __fastcall ButtonOkClick( TObject *Sender );
\r
114 void __fastcall ButtonApplyClick( TObject *Sender );
\r
115 void __fastcall ButtonSaveClick( TObject *Sender );
\r
116 void __fastcall ButtonCancelClick( TObject *Sender );
\r
117 void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
\r
118 private: // User declarations
\r
119 public: // User declarations
\r
120 __fastcall TPreferencesDlg( TComponent* Owner );
\r
121 void __fastcall CreateConfigDialog( char *psz_module_name );
\r
122 void __fastcall SaveValue( module_config_t *p_config );
\r
124 //---------------------------------------------------------------------------
\r