]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
bad606fa | 2 | // Name: wx/settings.h |
7516ed26 | 3 | // Purpose: wxSystemSettings class |
c801d85f KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_SETTINGS_H_BASE_ |
13 | #define _WX_SETTINGS_H_BASE_ | |
c801d85f | 14 | |
bad606fa VZ |
15 | #include "wx/colour.h" |
16 | #include "wx/font.h" | |
17 | ||
b5dbe15d | 18 | class WXDLLIMPEXP_FWD_CORE wxWindow; |
86a2f722 | 19 | |
bad606fa VZ |
20 | // possible values for wxSystemSettings::GetFont() parameter |
21 | // | |
22 | // NB: wxMSW assumes that they have the same values as the parameters of | |
23 | // Windows GetStockObject() API, don't change the values! | |
24 | enum wxSystemFont | |
25 | { | |
26 | wxSYS_OEM_FIXED_FONT = 10, | |
27 | wxSYS_ANSI_FIXED_FONT, | |
28 | wxSYS_ANSI_VAR_FONT, | |
29 | wxSYS_SYSTEM_FONT, | |
30 | wxSYS_DEVICE_DEFAULT_FONT, | |
a4d291f0 FM |
31 | |
32 | // don't use: MSDN says that this is a stock object provided only | |
33 | // for compatibility with 16-bit Windows versions earlier than 3.0! | |
bad606fa | 34 | wxSYS_SYSTEM_FIXED_FONT, |
a4d291f0 | 35 | |
3cb99894 | 36 | wxSYS_DEFAULT_GUI_FONT, |
d09dd96e VZ |
37 | |
38 | // this was just a temporary aberration, do not use it any more | |
39 | wxSYS_ICONTITLE_FONT = wxSYS_DEFAULT_GUI_FONT | |
bad606fa VZ |
40 | }; |
41 | ||
42 | // possible values for wxSystemSettings::GetColour() parameter | |
43 | // | |
44 | // NB: wxMSW assumes that they have the same values as the parameters of | |
45 | // Windows GetSysColor() API, don't change the values! | |
46 | enum wxSystemColour | |
47 | { | |
48 | wxSYS_COLOUR_SCROLLBAR, | |
a4d291f0 | 49 | wxSYS_COLOUR_DESKTOP, |
bad606fa VZ |
50 | wxSYS_COLOUR_ACTIVECAPTION, |
51 | wxSYS_COLOUR_INACTIVECAPTION, | |
52 | wxSYS_COLOUR_MENU, | |
53 | wxSYS_COLOUR_WINDOW, | |
54 | wxSYS_COLOUR_WINDOWFRAME, | |
55 | wxSYS_COLOUR_MENUTEXT, | |
56 | wxSYS_COLOUR_WINDOWTEXT, | |
57 | wxSYS_COLOUR_CAPTIONTEXT, | |
58 | wxSYS_COLOUR_ACTIVEBORDER, | |
59 | wxSYS_COLOUR_INACTIVEBORDER, | |
60 | wxSYS_COLOUR_APPWORKSPACE, | |
61 | wxSYS_COLOUR_HIGHLIGHT, | |
62 | wxSYS_COLOUR_HIGHLIGHTTEXT, | |
63 | wxSYS_COLOUR_BTNFACE, | |
64 | wxSYS_COLOUR_BTNSHADOW, | |
65 | wxSYS_COLOUR_GRAYTEXT, | |
66 | wxSYS_COLOUR_BTNTEXT, | |
67 | wxSYS_COLOUR_INACTIVECAPTIONTEXT, | |
68 | wxSYS_COLOUR_BTNHIGHLIGHT, | |
69 | wxSYS_COLOUR_3DDKSHADOW, | |
70 | wxSYS_COLOUR_3DLIGHT, | |
71 | wxSYS_COLOUR_INFOTEXT, | |
72 | wxSYS_COLOUR_INFOBK, | |
73 | wxSYS_COLOUR_LISTBOX, | |
7d6d3bf3 VZ |
74 | wxSYS_COLOUR_HOTLIGHT, |
75 | wxSYS_COLOUR_GRADIENTACTIVECAPTION, | |
76 | wxSYS_COLOUR_GRADIENTINACTIVECAPTION, | |
77 | wxSYS_COLOUR_MENUHILIGHT, | |
78 | wxSYS_COLOUR_MENUBAR, | |
9f2968ad | 79 | wxSYS_COLOUR_LISTBOXTEXT, |
bad606fa | 80 | |
a4d291f0 FM |
81 | // synonyms |
82 | wxSYS_COLOUR_BACKGROUND = wxSYS_COLOUR_DESKTOP, | |
83 | wxSYS_COLOUR_3DFACE = wxSYS_COLOUR_BTNFACE, | |
84 | wxSYS_COLOUR_3DSHADOW = wxSYS_COLOUR_BTNSHADOW, | |
85 | wxSYS_COLOUR_BTNHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
86 | wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
87 | wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
88 | wxSYS_COLOUR_FRAMEBK = wxSYS_COLOUR_BTNFACE, | |
89 | ||
7d6d3bf3 | 90 | wxSYS_COLOUR_MAX |
bad606fa VZ |
91 | }; |
92 | ||
9b0b5ba7 | 93 | // possible values for wxSystemSettings::GetMetric() index parameter |
7516ed26 VZ |
94 | // |
95 | // NB: update the conversion table in msw/settings.cpp if you change the values | |
96 | // of the elements of this enum | |
bad606fa VZ |
97 | enum wxSystemMetric |
98 | { | |
99 | wxSYS_MOUSE_BUTTONS = 1, | |
100 | wxSYS_BORDER_X, | |
101 | wxSYS_BORDER_Y, | |
102 | wxSYS_CURSOR_X, | |
103 | wxSYS_CURSOR_Y, | |
104 | wxSYS_DCLICK_X, | |
105 | wxSYS_DCLICK_Y, | |
106 | wxSYS_DRAG_X, | |
107 | wxSYS_DRAG_Y, | |
108 | wxSYS_EDGE_X, | |
109 | wxSYS_EDGE_Y, | |
110 | wxSYS_HSCROLL_ARROW_X, | |
111 | wxSYS_HSCROLL_ARROW_Y, | |
112 | wxSYS_HTHUMB_X, | |
113 | wxSYS_ICON_X, | |
114 | wxSYS_ICON_Y, | |
115 | wxSYS_ICONSPACING_X, | |
116 | wxSYS_ICONSPACING_Y, | |
117 | wxSYS_WINDOWMIN_X, | |
118 | wxSYS_WINDOWMIN_Y, | |
119 | wxSYS_SCREEN_X, | |
120 | wxSYS_SCREEN_Y, | |
121 | wxSYS_FRAMESIZE_X, | |
122 | wxSYS_FRAMESIZE_Y, | |
123 | wxSYS_SMALLICON_X, | |
124 | wxSYS_SMALLICON_Y, | |
125 | wxSYS_HSCROLL_Y, | |
126 | wxSYS_VSCROLL_X, | |
127 | wxSYS_VSCROLL_ARROW_X, | |
128 | wxSYS_VSCROLL_ARROW_Y, | |
129 | wxSYS_VTHUMB_Y, | |
130 | wxSYS_CAPTION_Y, | |
131 | wxSYS_MENU_Y, | |
132 | wxSYS_NETWORK_PRESENT, | |
133 | wxSYS_PENWINDOWS_PRESENT, | |
134 | wxSYS_SHOW_SOUNDS, | |
5595181f VZ |
135 | wxSYS_SWAP_BUTTONS, |
136 | wxSYS_DCLICK_MSEC | |
bad606fa VZ |
137 | }; |
138 | ||
139 | // possible values for wxSystemSettings::HasFeature() parameter | |
140 | enum wxSystemFeature | |
141 | { | |
142 | wxSYS_CAN_DRAW_FRAME_DECORATIONS = 1, | |
ddec9f1e JS |
143 | wxSYS_CAN_ICONIZE_FRAME, |
144 | wxSYS_TABLET_PRESENT | |
bad606fa VZ |
145 | }; |
146 | ||
c15521c6 | 147 | // values for different screen designs |
41fecb44 | 148 | enum wxSystemScreenType |
c15521c6 RR |
149 | { |
150 | wxSYS_SCREEN_NONE = 0, // not yet defined | |
41fecb44 VS |
151 | |
152 | wxSYS_SCREEN_TINY, // < | |
c15521c6 | 153 | wxSYS_SCREEN_PDA, // >= 320x240 |
41fecb44 VS |
154 | wxSYS_SCREEN_SMALL, // >= 640x480 |
155 | wxSYS_SCREEN_DESKTOP // >= 800x600 | |
c15521c6 RR |
156 | }; |
157 | ||
bad606fa | 158 | // ---------------------------------------------------------------------------- |
7516ed26 | 159 | // wxSystemSettingsNative: defines the API for wxSystemSettings class |
bad606fa VZ |
160 | // ---------------------------------------------------------------------------- |
161 | ||
162 | // this is a namespace rather than a class: it has only non virtual static | |
163 | // functions | |
164 | // | |
165 | // also note that the methods are implemented in the platform-specific source | |
166 | // files (i.e. this is not a real base class as we can't override its virtual | |
167 | // functions because it doesn't have any) | |
4f89dbc4 | 168 | |
53a2db12 | 169 | class WXDLLIMPEXP_CORE wxSystemSettingsNative |
bad606fa VZ |
170 | { |
171 | public: | |
172 | // get a standard system colour | |
173 | static wxColour GetColour(wxSystemColour index); | |
174 | ||
175 | // get a standard system font | |
176 | static wxFont GetFont(wxSystemFont index); | |
177 | ||
178 | // get a system-dependent metric | |
9b0b5ba7 | 179 | static int GetMetric(wxSystemMetric index, wxWindow * win = NULL); |
bad606fa VZ |
180 | |
181 | // return true if the port has certain feature | |
182 | static bool HasFeature(wxSystemFeature index); | |
bad606fa VZ |
183 | }; |
184 | ||
185 | // ---------------------------------------------------------------------------- | |
186 | // include the declaration of the real platform-dependent class | |
187 | // ---------------------------------------------------------------------------- | |
253293c1 | 188 | |
53a2db12 | 189 | class WXDLLIMPEXP_CORE wxSystemSettings : public wxSystemSettingsNative |
7516ed26 VZ |
190 | { |
191 | public: | |
192 | #ifdef __WXUNIVERSAL__ | |
193 | // in wxUniversal we want to use the theme standard colours instead of the | |
ec157c8f | 194 | // system ones, otherwise wxSystemSettings is just the same as |
7516ed26 VZ |
195 | // wxSystemSettingsNative |
196 | static wxColour GetColour(wxSystemColour index); | |
d2f3b085 VS |
197 | |
198 | // some metrics are toolkit-dependent and provided by wxUniv, some are | |
199 | // lowlevel | |
200 | static int GetMetric(wxSystemMetric index, wxWindow *win = NULL); | |
7516ed26 | 201 | #endif // __WXUNIVERSAL__ |
925fe73a | 202 | |
c15521c6 RR |
203 | // Get system screen design (desktop, pda, ..) used for |
204 | // laying out various dialogs. | |
41fecb44 | 205 | static wxSystemScreenType GetScreenType(); |
64bea2bf | 206 | |
c15521c6 | 207 | // Override default. |
41fecb44 | 208 | static void SetScreenType( wxSystemScreenType screen ); |
64bea2bf | 209 | |
c15521c6 | 210 | // Value |
41fecb44 | 211 | static wxSystemScreenType ms_screen; |
c15521c6 | 212 | |
7516ed26 VZ |
213 | }; |
214 | ||
c801d85f | 215 | #endif |
34138703 | 216 | // _WX_SETTINGS_H_BASE_ |
c801d85f | 217 |