1 /*****************************************************************************
\r
2 * preferences.h: the "Preferences" dialog box
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2002-2003 VideoLAN
\r
6 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
\r
7 * Boris Dores <babal@via.ecp.fr>
\r
9 * This program is free software; you can redistribute it and/or modify
\r
10 * it under the terms of the GNU General Public License as published by
\r
11 * the Free Software Foundation; either version 2 of the License, or
\r
12 * (at your option) any later version.
\r
14 * This program is distributed in the hope that it will be useful,
\r
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
17 * GNU General Public License for more details.
\r
19 * You should have received a copy of the GNU General Public License
\r
20 * along with this program; if not, write to the Free Software
\r
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
22 *****************************************************************************/
\r
24 #ifndef preferencesH
\r
25 #define preferencesH
\r
26 //---------------------------------------------------------------------------
\r
27 #include <Classes.hpp>
\r
28 #include <Controls.hpp>
\r
29 #include <StdCtrls.hpp>
\r
30 #include <Forms.hpp>
\r
31 #include <Buttons.hpp>
\r
32 #include <ComCtrls.hpp>
\r
33 #include <CheckLst.hpp>
\r
34 #include <ExtCtrls.hpp>
\r
36 //---------------------------------------------------------------------------
\r
37 /* A TCheckListBox that automatically disposes any TObject
\r
38 associated with the string items */
\r
39 class TCleanCheckListBox : public TCheckListBox
\r
42 __fastcall TCleanCheckListBox( Classes::TComponent* AOwner )
\r
43 : TCheckListBox( AOwner ) {};
\r
44 virtual __fastcall ~TCleanCheckListBox();
\r
46 //---------------------------------------------------------------------------
\r
47 /* A THintWindow with a limited width */
\r
48 class TNarrowHintWindow : public THintWindow
\r
51 virtual void __fastcall ActivateHint( const Windows::TRect &Rect,
\r
52 const System::AnsiString AHint );
\r
54 //---------------------------------------------------------------------------
\r
55 /* Just a wrapper to embed an AnsiString into a TObject */
\r
56 class TObjectString : public TObject
\r
61 __fastcall TObjectString( char * String );
\r
62 AnsiString __fastcall String();
\r
64 //---------------------------------------------------------------------------
\r
65 class TPanelPref : public TPanel
\r
68 __fastcall TPanelPref( TComponent* Owner, module_config_t *_p_config,
\r
69 intf_thread_t *_p_intf );
\r
70 virtual void __fastcall UpdateChanges() = 0;
\r
72 module_config_t * p_config;
\r
73 intf_thread_t * p_intf;
\r
74 TCleanCheckListBox * __fastcall CreateCleanCheckListBox(TWinControl *Parent,
\r
75 int Left, int Width, int Top, int Height );
\r
76 TButton * __fastcall CreateButton( TWinControl *Parent,
\r
77 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
78 TCheckBox * __fastcall CreateCheckBox( TWinControl *Parent,
\r
79 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
80 TLabel * __fastcall CreateLabel( TWinControl *Parent,
\r
81 int Left, int Width, int Top, int Height, AnsiString Caption,
\r
83 TEdit * __fastcall CreateEdit( TWinControl *Parent,
\r
84 int Left, int Width, int Top, int Height, AnsiString Text );
\r
85 TCSpinEdit * __fastcall CreateSpinEdit( TWinControl *Parent,
\r
86 int Left, int Width, int Top, int Height,
\r
87 long Min, long Max, long Value );
\r
89 //---------------------------------------------------------------------------
\r
90 class TPanelPlugin : public TPanelPref
\r
93 __fastcall TPanelPlugin( TComponent* Owner, module_config_t *p_config,
\r
94 intf_thread_t *_p_intf, bool b_multi_plugins );
\r
95 bool b_multi_plugins;
\r
96 TCleanCheckListBox *CleanCheckListBox;
\r
97 TButton *ButtonConfig;
\r
99 TButton *ButtonDown;
\r
101 module_t *ModuleSelected;
\r
102 virtual void __fastcall TPanelPlugin::SetValue ( AnsiString Values );
\r
103 virtual void __fastcall UpdateChanges();
\r
104 void __fastcall CheckListBoxClick( TObject *Sender );
\r
105 void __fastcall CheckListBoxClickCheck( TObject *Sender );
\r
106 void __fastcall ButtonConfigClick( TObject *Sender );
\r
107 void __fastcall ButtonUpClick( TObject *Sender );
\r
108 void __fastcall ButtonDownClick( TObject *Sender );
\r
110 //---------------------------------------------------------------------------
\r
111 class TPanelString : public TPanelPref
\r
114 __fastcall TPanelString( TComponent* Owner, module_config_t *p_config,
\r
115 intf_thread_t *_p_intf );
\r
118 virtual void __fastcall UpdateChanges();
\r
120 //---------------------------------------------------------------------------
\r
121 class TPanelInteger : public TPanelPref
\r
124 __fastcall TPanelInteger( TComponent* Owner, module_config_t *p_config,
\r
125 intf_thread_t *_p_intf );
\r
127 TCSpinEdit *SpinEdit;
\r
128 virtual void __fastcall UpdateChanges();
\r
130 //---------------------------------------------------------------------------
\r
131 class TPanelFloat : public TPanelPref
\r
134 __fastcall TPanelFloat( TComponent* Owner, module_config_t *p_config,
\r
135 intf_thread_t *_p_intf );
\r
138 virtual void __fastcall UpdateChanges();
\r
140 //---------------------------------------------------------------------------
\r
141 class TPanelBool : public TPanelPref
\r
144 __fastcall TPanelBool( TComponent* Owner, module_config_t *p_config,
\r
145 intf_thread_t *_p_intf );
\r
146 TCheckBox *CheckBox;
\r
147 virtual void __fastcall UpdateChanges();
\r
149 //---------------------------------------------------------------------------
\r
150 class TPreferencesDlg : public TForm
\r
152 __published: // IDE-managed Components
\r
153 TPageControl *PageControlPref;
\r
154 TButton *ButtonApply;
\r
155 TButton *ButtonSave;
\r
157 TButton *ButtonCancel;
\r
158 void __fastcall ButtonOkClick( TObject *Sender );
\r
159 void __fastcall ButtonApplyClick( TObject *Sender );
\r
160 void __fastcall ButtonSaveClick( TObject *Sender );
\r
161 void __fastcall ButtonCancelClick( TObject *Sender );
\r
162 void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
\r
163 private: // User declarations
\r
164 intf_thread_t *p_intf;
\r
165 public: // User declarations
\r
166 __fastcall TPreferencesDlg( TComponent* Owner, intf_thread_t *_p_intf );
\r
167 void __fastcall CreateConfigDialog( char *psz_module_name );
\r
169 //---------------------------------------------------------------------------
\r