]>
Commit | Line | Data |
---|---|---|
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
2 | %% Name: apptraits.tex | |
3 | %% Purpose: wxAppTraits | |
4 | %% Author: Francesco Montorsi | |
5 | %% Modified by: | |
6 | %% Created: 5-7-2006 | |
7 | %% RCS-ID: $Id$ | |
8 | %% Copyright: (c) wxWidgets Team | |
9 | %% License: wxWindows license | |
10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | ||
12 | \section{\class{wxAppTraits}}\label{wxapptraits} | |
13 | ||
14 | The {\bf wxAppTraits} class defines various configurable aspects of a \helpref{wxApp}{wxapp}. | |
15 | You can access it using \helpref{wxApp::GetTraits}{wxappgettraits} function and you can | |
16 | create your own \helpref{wxAppTraits}{wxapptraits} overriding the | |
17 | \helpref{wxApp::CreateTraits}{wxappcreatetraits} function. | |
18 | ||
19 | By default, wxWidgets creates a {\tt wxConsoleAppTraits} object for console applications | |
20 | (i.e. those applications linked against wxBase library only - see the | |
21 | \helpref{Libraries list}{librarieslist} page) and a {\tt wxGUIAppTraits} object for GUI | |
22 | applications. | |
23 | ||
24 | \wxheading{Derived from} | |
25 | ||
26 | None | |
27 | ||
28 | \wxheading{Include files} | |
29 | ||
30 | <wx/apptrait.h> | |
31 | ||
32 | \wxheading{See also} | |
33 | ||
34 | \helpref{wxApp overview}{wxappoverview}, \helpref{wxApp}{wxapp} | |
35 | ||
36 | \latexignore{\rtfignore{\wxheading{Members}}} | |
37 | ||
38 | ||
39 | \membersection{wxAppTraits::CreateConfig}\label{wxapptraitscreateconfig} | |
40 | ||
41 | \func{virtual wxConfigBase *}{CreateConfig}{\void} | |
42 | ||
43 | Called by wxWidgets to create the default configuration object for the | |
44 | application. The default version creates a registry-based | |
45 | \helpref{wxRegConfig}{wxconfigbase} class under MSW and | |
46 | \helpref{wxFileConfig}{wxfileconfig} under all other platforms. The | |
47 | \helpref{wxApp}{wxapp} \helpref{GetAppName()}{wxappgetappname} and | |
48 | \helpref{GetVendorName()}{wxappgetvendorname} methods are used to determine the | |
49 | registry key or file name. | |
50 | ||
51 | ||
52 | \membersection{wxAppTraits::CreateFontMapper}\label{wxapptraitscreatefontmapper} | |
53 | ||
54 | \func{virtual wxFontMapper *}{CreateFontMapper}{\void} | |
55 | ||
56 | Creates the global font mapper object used for encodings/charset mapping. | |
57 | ||
58 | ||
59 | ||
60 | \membersection{wxAppTraits::CreateLogTarget}\label{wxapptraitscreatelogtarget} | |
61 | ||
62 | \func{virtual wxLog *}{CreateLogTarget}{\void} | |
63 | ||
64 | Creates the default log target for the application. | |
65 | ||
66 | ||
67 | \membersection{wxAppTraits::CreateMessageOutput}\label{wxapptraitscreatemessageoutput} | |
68 | ||
69 | \func{virtual wxMessageOutput *}{CreateMessageOutput}{\void} | |
70 | ||
71 | Creates the global object used for printing out messages. | |
72 | ||
73 | ||
74 | \membersection{wxAppTraits::CreateRenderer}\label{wxapptraitscreaterenderer} | |
75 | ||
76 | \func{virtual wxRendererNative *}{CreateRenderer}{\void} | |
77 | ||
78 | Returns the renderer to use for drawing the generic controls (return value may be \NULL | |
79 | in which case the default renderer for the current platform is used); | |
80 | this is used in GUI mode only and always returns \NULL in console. | |
81 | ||
82 | NOTE: returned pointer will be deleted by the caller. | |
83 | ||
84 | \membersection{wxAppTraits::GetDesktopEnvironment}\label{wxapptraitsgetdesktopenvironment} | |
85 | ||
86 | \constfunc{virtual wxString}{GetDesktopEnvironment}{\void} | |
87 | ||
88 | This method returns the name of the desktop environment currently | |
89 | running in a Unix desktop. Currently only "KDE" or "GNOME" are | |
90 | supported and the code uses the X11 session protocol vendor name | |
91 | to figure out, which desktop environment is running. The method | |
92 | returns an empty string otherwise and on all other platforms. | |
93 | ||
94 | \membersection{wxAppTraits::GetStandardPaths}\label{wxapptraitsgetstandardpaths} | |
95 | ||
96 | \func{virtual wxStandardPaths \&}{GetStandardPaths}{\void} | |
97 | ||
98 | Returns the wxStandardPaths object for the application. | |
99 | It's normally the same for wxBase and wxGUI except in the case of wxMac and wxCocoa. | |
100 | ||
101 | \membersection{wxAppTraits::GetToolkitVersion}\label{wxapptraitsgettoolkitversion} | |
102 | ||
103 | \func{virtual wxPortId}{GetToolkitVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}} | |
104 | ||
105 | Returns the wxWidgets port ID used by the running program and eventually | |
106 | fills the given pointers with the values of the major and minor digits | |
107 | of the native toolkit currently used. | |
108 | The version numbers returned are thus detected at run-time and not compile-time | |
109 | (except when this is not possible e.g. wxMotif). | |
110 | ||
111 | E.g. if your program is using wxGTK port this function will return wxPORT\_GTK and | |
112 | put in given pointers the versions of the GTK library in use. | |
113 | ||
114 | See \helpref{wxPlatformInfo}{wxplatforminfo} for more details. | |
115 | ||
116 | ||
117 | \membersection{wxAppTraits::HasStderr}\label{wxapptraitshasstderr} | |
118 | ||
119 | \func{virtual bool}{HasStderr}{\void} | |
120 | ||
121 | Returns \true if {\tt fprintf(stderr)} goes somewhere, \false otherwise. | |
122 | ||
123 | ||
124 | \membersection{wxAppTraits::IsUsingUniversalWidgets}\label{wxapptraitsisusinguniversalwidgets} | |
125 | ||
126 | \constfunc{bool}{IsUsingUniversalWidgets}{\void} | |
127 | ||
128 | Returns \true if the library was built as wxUniversal. Always returns | |
129 | \false for wxBase-only apps. | |
130 | ||
131 | ||
132 | \membersection{wxAppTraits::ShowAssertDialog}\label{wxapptraitsshowassertdialog} | |
133 | ||
134 | \func{virtual bool}{ShowAssertDialog}{\param{const wxString \&}{ msg}} | |
135 | ||
136 | Shows the assert dialog with the specified message in GUI mode or just prints | |
137 | the string to stderr in console mode. | |
138 | ||
139 | Returns \true to suppress subsequent asserts, \false to continue as before. | |
140 |