]>
git.saurik.com Git - wxWidgets.git/blob - interface/apptrait.h
1c6771eef9b70584361cf87377367dee27e53867
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxAppTraits
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 The @b wxAppTraits class defines various configurable aspects of a wxApp.
14 You can access it using wxApp::GetTraits function and you can
15 create your own wxAppTraits overriding the
16 wxApp::CreateTraits function.
18 By default, wxWidgets creates a @c wxConsoleAppTraits object for console
20 (i.e. those applications linked against wxBase library only - see the
21 @ref overview_librarieslist "Libraries list" page) and a @c wxGUIAppTraits
28 @see @ref overview_wxappoverview "wxApp overview", wxApp
34 Called by wxWidgets to create the default configuration object for the
35 application. The default version creates a registry-based
36 wxRegConfig() class under MSW and
37 wxFileConfig under all other platforms. The
38 wxApp wxApp::GetAppName and
39 wxApp::GetVendorName methods are used to determine the
40 registry key or file name.
42 virtual wxConfigBase
* CreateConfig();
45 Creates the global font mapper object used for encodings/charset mapping.
47 virtual wxFontMapper
* CreateFontMapper();
50 Creates the default log target for the application.
52 virtual wxLog
* CreateLogTarget();
55 Creates the global object used for printing out messages.
57 virtual wxMessageOutput
* CreateMessageOutput();
60 Returns the renderer to use for drawing the generic controls (return value may
62 in which case the default renderer for the current platform is used);
63 this is used in GUI mode only and always returns @NULL in console.
64 NOTE: returned pointer will be deleted by the caller.
66 virtual wxRendererNative
* CreateRenderer();
69 This method returns the name of the desktop environment currently
70 running in a Unix desktop. Currently only "KDE" or "GNOME" are
71 supported and the code uses the X11 session protocol vendor name
72 to figure out, which desktop environment is running. The method
73 returns an empty string otherwise and on all other platforms.
75 virtual wxString
GetDesktopEnvironment() const;
78 Returns the wxStandardPaths object for the application.
79 It's normally the same for wxBase and wxGUI except in the case of wxMac and
82 virtual wxStandardPaths
GetStandardPaths();
85 Returns the wxWidgets port ID used by the running program and eventually
86 fills the given pointers with the values of the major and minor digits
87 of the native toolkit currently used.
88 The version numbers returned are thus detected at run-time and not compile-time
89 (except when this is not possible e.g. wxMotif).
90 E.g. if your program is using wxGTK port this function will return wxPORT_GTK
92 put in given pointers the versions of the GTK library in use.
93 See wxPlatformInfo for more details.
95 virtual wxPortId
GetToolkitVersion(int* major
= NULL
,
99 Returns @true if @c fprintf(stderr) goes somewhere, @false otherwise.
101 virtual bool HasStderr();
104 Returns @true if the library was built as wxUniversal. Always returns
105 @false for wxBase-only apps.
107 bool IsUsingUniversalWidgets() const;
110 Shows the assert dialog with the specified message in GUI mode or just prints
111 the string to stderr in console mode.
112 Returns @true to suppress subsequent asserts, @false to continue as before.
114 virtual bool ShowAssertDialog(const wxString
& msg
);