]> git.sesse.net Git - vlc/blob - modules/gui/win32/preferences.h
- Enterely new layout for the preference window of the native win32
[vlc] / modules / gui / win32 / preferences.h
1 /*****************************************************************************\r
2  * preferences.h: the "Preferences" dialog box\r
3  *****************************************************************************\r
4  * Copyright (C) 2002 VideoLAN\r
5  *\r
6  * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>\r
7  *          Boris Dores <babal@via.ecp.fr>\r
8  *\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
13  *\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
18  *\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
23 \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
35 #include "CSPIN.h"\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
40 {\r
41 public:\r
42     __fastcall TCleanCheckListBox(Classes::TComponent* AOwner)\r
43         : TCheckListBox( AOwner ) { };\r
44     virtual __fastcall ~TCleanCheckListBox();\r
45 };\r
46 //---------------------------------------------------------------------------\r
47 /* A THintWindow with a limited width */\r
48 class TNarrowHintWindow : public THintWindow\r
49 {\r
50 public:\r
51    virtual void __fastcall ActivateHint(const Windows::TRect &Rect,\r
52        const System::AnsiString AHint);\r
53 };\r
54 //---------------------------------------------------------------------------\r
55 /* Just a wrapper to embed an AnsiString into a TObject */\r
56 class TObjectString : public TObject\r
57 {\r
58 private:\r
59     AnsiString FString;\r
60 public:\r
61     __fastcall TObjectString(char * String);\r
62     AnsiString __fastcall String();\r
63 };\r
64 //---------------------------------------------------------------------------\r
65 class TPanelPref : public TPanel\r
66 {\r
67 public:\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();\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
79             bool WordWrap );\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
85 };\r
86 //---------------------------------------------------------------------------\r
87 class TPanelPlugin : public TPanelPref\r
88 {\r
89 public:\r
90     __fastcall TPanelPlugin( TComponent* Owner, module_config_t *p_config );\r
91     TCleanCheckListBox *CleanCheckListBox;\r
92     TButton *ButtonConfig;\r
93     TLabel *Label;\r
94     module_t *ModuleSelected;\r
95     void __fastcall UpdateChanges();\r
96     void __fastcall CheckListBoxClick( TObject *Sender );\r
97     void __fastcall CheckListBoxClickCheck( TObject *Sender );\r
98     void __fastcall ButtonConfigClick( TObject *Sender );\r
99 };\r
100 //---------------------------------------------------------------------------\r
101 class TPanelString : public TPanelPref\r
102 {\r
103 public:\r
104     __fastcall TPanelString( TComponent* Owner, module_config_t *p_config );\r
105     TLabel *Label;\r
106     TEdit *Edit;\r
107     void __fastcall UpdateChanges();\r
108 };\r
109 //---------------------------------------------------------------------------\r
110 class TPanelInteger : public TPanelPref\r
111 {\r
112 public:\r
113     __fastcall TPanelInteger( TComponent* Owner, module_config_t *p_config );\r
114     TLabel *Label;\r
115     TCSpinEdit *SpinEdit;\r
116     void __fastcall UpdateChanges();\r
117 };\r
118 //---------------------------------------------------------------------------\r
119 class TPanelBool : public TPanelPref\r
120 {\r
121 public:\r
122     __fastcall TPanelBool( TComponent* Owner, module_config_t *p_config );\r
123     TCheckBox *CheckBox;\r
124     void __fastcall UpdateChanges();\r
125 };\r
126 //---------------------------------------------------------------------------\r
127 class TPreferencesDlg : public TForm\r
128 {\r
129 __published:    // IDE-managed Components\r
130     TPageControl *PageControlPref;\r
131     TButton *ButtonApply;\r
132     TButton *ButtonSave;\r
133     TButton *ButtonOK;\r
134     TButton *ButtonCancel;\r
135     void __fastcall ButtonOkClick( TObject *Sender );\r
136     void __fastcall ButtonApplyClick( TObject *Sender );\r
137     void __fastcall ButtonSaveClick( TObject *Sender );\r
138     void __fastcall ButtonCancelClick( TObject *Sender );\r
139     void __fastcall FormClose( TObject *Sender, TCloseAction &Action );\r
140 private:        // User declarations\r
141 public:         // User declarations\r
142     __fastcall TPreferencesDlg( TComponent* Owner );\r
143     void __fastcall CreateConfigDialog( char *psz_module_name );\r
144     void __fastcall SaveValue( module_config_t *p_config );\r
145 };\r
146 //---------------------------------------------------------------------------\r
147 #endif\r