]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/sysopt.h
Convert wxFSW_EVENT_{WARNING,ERROR} to string correctly.
[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
d13b34d3 49 the fallback code, especially if using DC caching. By default, MaskBlt will be
4701dc09
FM
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 119 Tells wxListCtrl to use the generic control even when it is capable of
d13b34d3 120 using the native control instead. Also known 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.
13390af4
SC
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).
4701dc09
FM
128 @endFlagTable
129
130
4701dc09
FM
131 @section sysopt_motif Motif
132
133 @beginFlagTable
134 @flag{motif.largebuttons}
135 If 1, uses a bigger default size for wxButtons.
136 @endFlagTable
137
138
139 The compile-time option to include or exclude this functionality is wxUSE_SYSTEM_OPTIONS.
7c913512 140
23324ae1 141 @library{wxbase}
3c99e2fd 142 @category{cfg}
7c913512 143
ec5984e3 144 @see wxSystemSettings
23324ae1
FM
145*/
146class wxSystemOptions : public wxObject
147{
148public:
149 /**
4701dc09
FM
150 Default constructor.
151
152 You don't need to create an instance of wxSystemOptions since all
153 of its functions are static.
23324ae1
FM
154 */
155 wxSystemOptions();
156
157 /**
4701dc09 158 Gets an option. The function is case-insensitive to @a name.
23324ae1 159 Returns empty string if the option hasn't been set.
3c4f71cc 160
4701dc09 161 @see SetOption(), GetOptionInt(), HasOption()
23324ae1 162 */
adaaa686 163 static wxString GetOption(const wxString& name);
23324ae1
FM
164
165 /**
4701dc09 166 Gets an option as an integer. The function is case-insensitive to @a name.
23324ae1 167 If the option hasn't been set, this function returns 0.
3c4f71cc 168
4701dc09 169 @see SetOption(), GetOption(), HasOption()
23324ae1 170 */
adaaa686 171 static int GetOptionInt(const wxString& name);
23324ae1
FM
172
173 /**
4701dc09
FM
174 Returns @true if the given option is present.
175 The function is case-insensitive to @a name.
3c4f71cc 176
4701dc09 177 @see SetOption(), GetOption(), GetOptionInt()
23324ae1 178 */
adaaa686 179 static bool HasOption(const wxString& name);
23324ae1
FM
180
181 /**
4701dc09
FM
182 Returns @true if the option with the given @a name had been set to 0 value.
183
184 This is mostly useful for boolean options for which you can't use
23324ae1
FM
185 @c GetOptionInt(name) == 0 as this would also be @true if the option
186 hadn't been set at all.
187 */
adaaa686 188 static bool IsFalse(const wxString& name);
23324ae1
FM
189
190 //@{
191 /**
4701dc09 192 Sets an option. The function is case-insensitive to @a name.
23324ae1 193 */
bb7cd767
VZ
194 static void SetOption(const wxString& name, const wxString& value);
195 static void SetOption(const wxString& name, int value);
23324ae1
FM
196 //@}
197};
e54c96f1 198