]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/sysopt.h
No docs yet, just the bare interace so we can get XML for Phoenix.
[wxWidgets.git] / interface / wx / sysopt.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: sysopt.h
e54c96f1 3// Purpose: interface of wxSystemOptions
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
526954c5 6// Licence: wxWindows licence
23324ae1
FM
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxSystemOptions
7c913512 11
23324ae1
FM
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.
7c913512 16
aa0af8ce
VZ
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
4701dc09
FM
29 These options are currently recognised by wxWidgets:
30
4d1ea475
VZ
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
4701dc09
FM
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.
ec5984e3
FM
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.
4701dc09
FM
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.
e0a5cfb0 118 @flag{mac.listctrl.always_use_generic}
4701dc09
FM
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.
e0a5cfb0 121 @flag{mac.textcontrol-use-spell-checker}
6a0f372c
FM
122 This option only has effect for Mac OS X 10.4 and higher.
123 If 1 activates the spell checking in wxTextCtrl.
4701dc09
FM
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.
7c913512 146
23324ae1 147 @library{wxbase}
3c99e2fd 148 @category{cfg}
7c913512 149
ec5984e3 150 @see wxSystemSettings
23324ae1
FM
151*/
152class wxSystemOptions : public wxObject
153{
154public:
155 /**
4701dc09
FM
156 Default constructor.
157
158 You don't need to create an instance of wxSystemOptions since all
159 of its functions are static.
23324ae1
FM
160 */
161 wxSystemOptions();
162
163 /**
4701dc09 164 Gets an option. The function is case-insensitive to @a name.
23324ae1 165 Returns empty string if the option hasn't been set.
3c4f71cc 166
4701dc09 167 @see SetOption(), GetOptionInt(), HasOption()
23324ae1 168 */
adaaa686 169 static wxString GetOption(const wxString& name);
23324ae1
FM
170
171 /**
4701dc09 172 Gets an option as an integer. The function is case-insensitive to @a name.
23324ae1 173 If the option hasn't been set, this function returns 0.
3c4f71cc 174
4701dc09 175 @see SetOption(), GetOption(), HasOption()
23324ae1 176 */
adaaa686 177 static int GetOptionInt(const wxString& name);
23324ae1
FM
178
179 /**
4701dc09
FM
180 Returns @true if the given option is present.
181 The function is case-insensitive to @a name.
3c4f71cc 182
4701dc09 183 @see SetOption(), GetOption(), GetOptionInt()
23324ae1 184 */
adaaa686 185 static bool HasOption(const wxString& name);
23324ae1
FM
186
187 /**
4701dc09
FM
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
23324ae1
FM
191 @c GetOptionInt(name) == 0 as this would also be @true if the option
192 hadn't been set at all.
193 */
adaaa686 194 static bool IsFalse(const wxString& name);
23324ae1
FM
195
196 //@{
197 /**
4701dc09 198 Sets an option. The function is case-insensitive to @a name.
23324ae1 199 */
bb7cd767
VZ
200 static void SetOption(const wxString& name, const wxString& value);
201 static void SetOption(const wxString& name, int value);
23324ae1
FM
202 //@}
203};
e54c96f1 204