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