]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/sysopt.h
Allow wxThread::Wait() and Delete() to block, even under wxMSW.
[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 licence
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 @flag{osx.openfiledialog.always-show-types}
125 Per default a wxFileDialog with wxFD_OPEN does not show a types-popup on OSX but allows
126 the selection of files from any of the supported types. Setting this to 1 shows a wxChoice
127 for selection (if there is more than one supported filetype).
128 @endFlagTable
129
130
131 @section sysopt_mgl MGL
132
133 @beginFlagTable
134 @flag{mgl.aa-threshold}
135 Set this integer option to point size below which fonts are not antialiased. Default: 10.
136 @flag{mgl.screen-refresh}
137 Screen refresh rate in Hz. A reasonable default is used if not specified.
138 @endFlagTable
139
140
141 @section sysopt_motif Motif
142
143 @beginFlagTable
144 @flag{motif.largebuttons}
145 If 1, uses a bigger default size for wxButtons.
146 @endFlagTable
147
148
149 The compile-time option to include or exclude this functionality is wxUSE_SYSTEM_OPTIONS.
150
151 @library{wxbase}
152 @category{cfg}
153
154 @see wxSystemSettings
155 */
156 class wxSystemOptions : public wxObject
157 {
158 public:
159 /**
160 Default constructor.
161
162 You don't need to create an instance of wxSystemOptions since all
163 of its functions are static.
164 */
165 wxSystemOptions();
166
167 /**
168 Gets an option. The function is case-insensitive to @a name.
169 Returns empty string if the option hasn't been set.
170
171 @see SetOption(), GetOptionInt(), HasOption()
172 */
173 static wxString GetOption(const wxString& name);
174
175 /**
176 Gets an option as an integer. The function is case-insensitive to @a name.
177 If the option hasn't been set, this function returns 0.
178
179 @see SetOption(), GetOption(), HasOption()
180 */
181 static int GetOptionInt(const wxString& name);
182
183 /**
184 Returns @true if the given option is present.
185 The function is case-insensitive to @a name.
186
187 @see SetOption(), GetOption(), GetOptionInt()
188 */
189 static bool HasOption(const wxString& name);
190
191 /**
192 Returns @true if the option with the given @a name had been set to 0 value.
193
194 This is mostly useful for boolean options for which you can't use
195 @c GetOptionInt(name) == 0 as this would also be @true if the option
196 hadn't been set at all.
197 */
198 static bool IsFalse(const wxString& name);
199
200 //@{
201 /**
202 Sets an option. The function is case-insensitive to @a name.
203 */
204 static void SetOption(const wxString& name, const wxString& value);
205 static void SetOption(const wxString& name, int value);
206 //@}
207 };
208