]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/sysopt.h
3f5a4157c55127d01086eda30e382bd10b923f3c
[wxWidgets.git] / interface / wx / sysopt.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: sysopt.h
3 // Purpose: interface of wxSystemOptions
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxSystemOptions
11
12 wxSystemOptions stores option/value pairs that wxWidgets itself or
13 applications can use to alter behaviour at run-time. It can be
14 used to optimize behaviour that doesn't deserve a distinct API,
15 but is still important to be able to configure.
16
17 System options can be set by the program itself using SetOption() method
18 and they also can be set from the program environment by defining an
19 environment variable @c wx_option to set the given option for all wxWidgets
20 applications or @c wx_appname_option to set it just for the application
21 with the given name (as returned by wxApp::GetAppName()). Notice that any
22 characters not allowed in the environment variables names, such as periods
23 and dashes, should be replaced with underscores. E.g. to define a system
24 option "foo-bar" you need to define the environment variable "wx_foo_bar".
25
26 The program may use system options for its own needs but they are mostly
27 used to control the behaviour of wxWidgets library itself.
28
29 These options are currently recognised by wxWidgets:
30
31 @section sysopt_all All platforms
32
33 @beginFlagTable
34 @flag{exit-on-assert}
35 If set to non-zero value, abort the program if an assertion fails. The
36 default behaviour in case of assertion failure depends on the build mode
37 and can be changed by overriding wxApp::OnAssertFailure() but setting
38 this option allows to change it without modifying the program code and
39 also applies to asserts which may happen before the wxApp object
40 creation or after its destruction.
41 @endFlagTable
42
43 @section sysopt_win Windows
44
45 @beginFlagTable
46 @flag{no-maskblt}
47 1 to never use WIN32's MaskBlt function, 0 to allow it to be used where possible.
48 Default: 0. In some circumstances the MaskBlt function can be slower than using
49 the fallback code, especially if using DC cacheing. By default, MaskBlt will be
50 used where it is implemented by the operating system and driver.
51 @flag{msw.remap}
52 If 1 (the default), wxToolBar bitmap colours will be remapped to the current
53 theme's values. Set this to 0 to disable this functionality, for example if
54 you're using more than 16 colours in your tool bitmaps.
55 @flag{msw.window.no-clip-children}
56 If 1, windows will not automatically get the WS_CLIPCHILDREN style.
57 This restores the way windows are refreshed back to the method used in
58 versions of wxWidgets earlier than 2.5.4, and for some complex window
59 hierarchies it can reduce apparent refresh delays.
60 You may still specify wxCLIP_CHILDREN for individual windows.
61 @flag{msw.notebook.themed-background}
62 If set to 0, globally disables themed backgrounds on notebook pages.
63 Note that this won't disable the theme on the actual notebook background
64 (noticeable only if there are no pages).
65 @flag{msw.staticbox.optimized-paint}
66 If set to 0, switches off optimized wxStaticBox painting.
67 Setting this to 0 causes more flicker, but allows applications to paint
68 graphics on the parent of a static box (the optimized refresh causes any
69 such drawing to disappear).
70 @flag{msw.display.directdraw}
71 If set to 1, use DirectDraw-based implementation of wxDisplay.
72 By default the standard Win32 functions are used.
73 @flag{msw.font.no-proof-quality}
74 If set to 1, use default fonts quality instead of proof quality when
75 creating fonts. With proof quality the fonts have slightly better
76 appearance but not all fonts are available in this quality,
77 e.g. the Terminal font in small sizes is not and this option may be
78 used if wider fonts selection is more important than higher quality.
79 @flag{wince.dialog.real-ok-cancel}
80 The PocketPC guidelines recommend for Ok/Cancel dialogs to use an OK button
81 located inside the caption bar and implement Cancel functionality through
82 Undo outside the dialog.
83 wxDialog::CreateButtonSizer will follow the native behaviour on WinCE but
84 it can be overridden with real wxButtons by setting the option below to 1.
85 @endFlagTable
86
87
88 @section sysopt_gtk GTK+
89
90 @beginFlagTable
91 @flag{gtk.tlw.can-set-transparent}
92 wxTopLevelWindow::CanSetTransparent() method normally tries to detect
93 automatically whether transparency for top level windows is currently
94 supported, however this may sometimes fail and this option allows to
95 override the automatic detection. Setting it to 1 makes the transparency
96 be always available (setting it can still fail, of course) and setting it
97 to 0 makes it always unavailable.
98 @flag{gtk.desktop}
99 This option can be set to override the default desktop environment
100 determination. Supported values are GNOME and KDE.
101 @flag{gtk.window.force-background-colour}
102 If 1, the backgrounds of windows with the wxBG_STYLE_COLOUR background
103 style are cleared forcibly instead of relying on the underlying GTK+
104 window colour. This works around a display problem when running
105 applications under KDE with the gtk-qt theme installed (0.6 and below).
106 @endFlagTable
107
108
109 @section sysopt_mac Mac
110
111 @beginFlagTable
112 @flag{mac.window-plain-transition}
113 If 1, uses a plainer transition when showing a window.
114 You can also use the symbol wxMAC_WINDOW_PLAIN_TRANSITION.
115 @flag{window-default-variant}
116 The default variant used by windows (cast to integer from the wxWindowVariant enum).
117 Also known as wxWINDOW_DEFAULT_VARIANT.
118 @flag{mac.listctrl.always_use_generic}
119 Tells wxListCtrl to use the generic control even when it is capable of
120 using the native control instead. Also knwon as wxMAC_ALWAYS_USE_GENERIC_LISTCTRL.
121 @flag{mac.textcontrol-use-spell-checker}
122 This option only has effect for Mac OS X 10.4 and higher.
123 If 1 activates the spell checking in wxTextCtrl.
124 @endFlagTable
125
126
127 @section sysopt_mgl MGL
128
129 @beginFlagTable
130 @flag{mgl.aa-threshold}
131 Set this integer option to point size below which fonts are not antialiased. Default: 10.
132 @flag{mgl.screen-refresh}
133 Screen refresh rate in Hz. A reasonable default is used if not specified.
134 @endFlagTable
135
136
137 @section sysopt_motif Motif
138
139 @beginFlagTable
140 @flag{motif.largebuttons}
141 If 1, uses a bigger default size for wxButtons.
142 @endFlagTable
143
144
145 The compile-time option to include or exclude this functionality is wxUSE_SYSTEM_OPTIONS.
146
147 @library{wxbase}
148 @category{cfg}
149
150 @see wxSystemSettings
151 */
152 class wxSystemOptions : public wxObject
153 {
154 public:
155 /**
156 Default constructor.
157
158 You don't need to create an instance of wxSystemOptions since all
159 of its functions are static.
160 */
161 wxSystemOptions();
162
163 /**
164 Gets an option. The function is case-insensitive to @a name.
165 Returns empty string if the option hasn't been set.
166
167 @see SetOption(), GetOptionInt(), HasOption()
168 */
169 static wxString GetOption(const wxString& name);
170
171 /**
172 Gets an option as an integer. The function is case-insensitive to @a name.
173 If the option hasn't been set, this function returns 0.
174
175 @see SetOption(), GetOption(), HasOption()
176 */
177 static int GetOptionInt(const wxString& name);
178
179 /**
180 Returns @true if the given option is present.
181 The function is case-insensitive to @a name.
182
183 @see SetOption(), GetOption(), GetOptionInt()
184 */
185 static bool HasOption(const wxString& name);
186
187 /**
188 Returns @true if the option with the given @a name had been set to 0 value.
189
190 This is mostly useful for boolean options for which you can't use
191 @c GetOptionInt(name) == 0 as this would also be @true if the option
192 hadn't been set at all.
193 */
194 static bool IsFalse(const wxString& name);
195
196 //@{
197 /**
198 Sets an option. The function is case-insensitive to @a name.
199 */
200 void SetOption(const wxString& name, const wxString& value);
201 void SetOption(const wxString& name, int value);
202 //@}
203 };
204