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