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
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_arg );
\r
69 module_config_t *p_config;
\r
70 virtual void __fastcall UpdateChanges() = 0;
\r
71 TCleanCheckListBox * __fastcall CreateCleanCheckListBox( TWinControl *Parent,
\r
72 int Left, int Width, int Top, int Height );
\r
73 TButton * __fastcall CreateButton( TWinControl *Parent,
\r
74 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
75 TCheckBox * __fastcall CreateCheckBox( TWinControl *Parent,
\r
76 int Left, int Width, int Top, int Height, AnsiString Caption );
\r
77 TLabel * __fastcall CreateLabel( TWinControl *Parent,
\r
78 int Left, int Width, int Top, int Height, AnsiString Caption,
\r
80 TEdit * __fastcall CreateEdit( TWinControl *Parent,
\r
81 int Left, int Width, int Top, int Height, AnsiString Text );
\r
82 TCSpinEdit * __fastcall CreateSpinEdit( TWinControl *Parent,
\r
83 int Left, int Width, int Top, int Height,
\r
84 long Min, long Max, long Value );
\r
86 //---------------------------------------------------------------------------
\r
87 class TPanelPlugin : public TPanelPref
\r
90 __fastcall TPanelPlugin( TComponent* Owner, module_config_t *p_config,
\r
91 intf_thread_t *_p_intf );
\r
92 TCleanCheckListBox *CleanCheckListBox;
\r
93 TButton *ButtonConfig;
\r
95 module_t *ModuleSelected;
\r
96 virtual void __fastcall UpdateChanges();
\r
97 void __fastcall CheckListBoxClick( TObject *Sender );
\r
98 void __fastcall CheckListBoxClickCheck( TObject *Sender );
\r
99 void __fastcall ButtonConfigClick( TObject *Sender );
\r
101 intf_thread_t *p_intf;
\r
103 //---------------------------------------------------------------------------
\r
104 class TPanelString : public TPanelPref
\r
107 __fastcall TPanelString( TComponent* Owner, module_config_t *p_config );
\r
110 virtual void __fastcall UpdateChanges();
\r
112 //---------------------------------------------------------------------------
\r
113 class TPanelInteger : public TPanelPref
\r
116 __fastcall TPanelInteger( TComponent* Owner, module_config_t *p_config );
\r
118 TCSpinEdit *SpinEdit;
\r
119 virtual void __fastcall UpdateChanges();
\r
121 //---------------------------------------------------------------------------
\r
122 class TPanelFloat : public TPanelPref
\r
125 __fastcall TPanelFloat( TComponent* Owner, module_config_t *p_config );
\r
128 virtual void __fastcall UpdateChanges();
\r
130 //---------------------------------------------------------------------------
\r
131 class TPanelBool : public TPanelPref
\r
134 __fastcall TPanelBool( TComponent* Owner, module_config_t *p_config );
\r
135 TCheckBox *CheckBox;
\r
136 virtual void __fastcall UpdateChanges();
\r
138 //---------------------------------------------------------------------------
\r
139 class TPreferencesDlg : public TForm
\r
141 __published: // IDE-managed Components
\r
142 TPageControl *PageControlPref;
\r
143 TButton *ButtonApply;
\r
144 TButton *ButtonSave;
\r
146 TButton *ButtonCancel;
\r
147 void __fastcall ButtonOkClick( TObject *Sender );
\r
148 void __fastcall ButtonApplyClick( TObject *Sender );
\r
149 void __fastcall ButtonSaveClick( TObject *Sender );
\r
150 void __fastcall ButtonCancelClick( TObject *Sender );
\r
151 void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
\r
152 private: // User declarations
\r
153 intf_thread_t *p_intf;
\r
154 public: // User declarations
\r
155 __fastcall TPreferencesDlg( TComponent* Owner, intf_thread_t *_p_intf );
\r
156 void __fastcall CreateConfigDialog( char *psz_module_name );
\r
157 void __fastcall SaveValue( module_config_t *p_config );
\r
159 //---------------------------------------------------------------------------
\r