]> git.saurik.com Git - wxWidgets.git/blob - include/wx/sysopt.h
Add lambda-friendly wxDialog::ShowWindowModalThenDo().
[wxWidgets.git] / include / wx / sysopt.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/sysopt.h
3 // Purpose: wxSystemOptions
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 2001-07-10
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_SYSOPT_H_
12 #define _WX_SYSOPT_H_
13
14 #include "wx/object.h"
15
16 // ----------------------------------------------------------------------------
17 // Enables an application to influence the wxWidgets implementation
18 // ----------------------------------------------------------------------------
19
20 class
21 #if wxUSE_SYSTEM_OPTIONS
22 WXDLLIMPEXP_BASE
23 #endif
24 wxSystemOptions : public wxObject
25 {
26 public:
27 wxSystemOptions() { }
28
29 // User-customizable hints to wxWidgets or associated libraries
30 // These could also be used to influence GetSystem... calls, indeed
31 // to implement SetSystemColour/Font/Metric
32
33 #if wxUSE_SYSTEM_OPTIONS
34 static void SetOption(const wxString& name, const wxString& value);
35 static void SetOption(const wxString& name, int value);
36 #endif // wxUSE_SYSTEM_OPTIONS
37 static wxString GetOption(const wxString& name);
38 static int GetOptionInt(const wxString& name);
39 static bool HasOption(const wxString& name);
40
41 static bool IsFalse(const wxString& name)
42 {
43 return HasOption(name) && GetOptionInt(name) == 0;
44 }
45 };
46
47 #if !wxUSE_SYSTEM_OPTIONS
48
49 // define inline stubs for accessors to make it possible to use wxSystemOptions
50 // in the library itself without checking for wxUSE_SYSTEM_OPTIONS all the time
51
52 /* static */ inline
53 wxString wxSystemOptions::GetOption(const wxString& WXUNUSED(name))
54 {
55 return wxEmptyString;
56 }
57
58 /* static */ inline
59 int wxSystemOptions::GetOptionInt(const wxString& WXUNUSED(name))
60 {
61 return 0;
62 }
63
64 /* static */ inline
65 bool wxSystemOptions::HasOption(const wxString& WXUNUSED(name))
66 {
67 return false;
68 }
69
70 #endif // !wxUSE_SYSTEM_OPTIONS
71
72 #endif
73 // _WX_SYSOPT_H_
74