1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxAppTraits
4 %% Author: Francesco Montorsi
8 %% Copyright: (c) wxWidgets Team
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxAppTraits
}}\label{wxapptraits
}
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.
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
24 \wxheading{Derived from
}
28 \wxheading{Include files
}
34 \helpref{wxBase
}{librarieslist
}
38 \helpref{wxApp overview
}{wxappoverview
},
\helpref{wxApp
}{wxapp
}
40 \latexignore{\rtfignore{\wxheading{Members
}}}
43 \membersection{wxAppTraits::CreateConfig
}\label{wxapptraitscreateconfig
}
45 \func{virtual wxConfigBase *
}{CreateConfig
}{\void}
47 Called by wxWidgets to create the default configuration object for the
48 application. The default version creates a registry-based
49 \helpref{wxRegConfig
}{wxconfigbase
} class under MSW and
50 \helpref{wxFileConfig
}{wxfileconfig
} under all other platforms. The
51 \helpref{wxApp
}{wxapp
} \helpref{GetAppName()
}{wxappgetappname
} and
52 \helpref{GetVendorName()
}{wxappgetvendorname
} methods are used to determine the
53 registry key or file name.
56 \membersection{wxAppTraits::CreateFontMapper
}\label{wxapptraitscreatefontmapper
}
58 \func{virtual wxFontMapper *
}{CreateFontMapper
}{\void}
60 Creates the global font mapper object used for encodings/charset mapping.
64 \membersection{wxAppTraits::CreateLogTarget
}\label{wxapptraitscreatelogtarget
}
66 \func{virtual wxLog *
}{CreateLogTarget
}{\void}
68 Creates the default log target for the application.
71 \membersection{wxAppTraits::CreateMessageOutput
}\label{wxapptraitscreatemessageoutput
}
73 \func{virtual wxMessageOutput *
}{CreateMessageOutput
}{\void}
75 Creates the global object used for printing out messages.
78 \membersection{wxAppTraits::CreateRenderer
}\label{wxapptraitscreaterenderer
}
80 \func{virtual wxRendererNative *
}{CreateRenderer
}{\void}
82 Returns the renderer to use for drawing the generic controls (return value may be
\NULL
83 in which case the default renderer for the current platform is used);
84 this is used in GUI mode only and always returns
\NULL in console.
86 NOTE: returned pointer will be deleted by the caller.
88 \membersection{wxAppTraits::GetDesktopEnvironment
}\label{wxapptraitsgetdesktopenvironment
}
90 \constfunc{virtual wxString
}{GetDesktopEnvironment
}{\void}
92 This method returns the name of the desktop environment currently
93 running in a Unix desktop. Currently only "KDE" or "GNOME" are
94 supported and the code uses the X11 session protocol vendor name
95 to figure out, which desktop environment is running. The method
96 returns an empty string otherwise and on all other platforms.
98 \membersection{wxAppTraits::GetStandardPaths
}\label{wxapptraitsgetstandardpaths
}
100 \func{virtual wxStandardPaths \&
}{GetStandardPaths
}{\void}
102 Returns the wxStandardPaths object for the application.
103 It's normally the same for wxBase and wxGUI except in the case of wxMac and wxCocoa.
105 \membersection{wxAppTraits::GetToolkitVersion
}\label{wxapptraitsgettoolkitversion
}
107 \func{virtual wxPortId
}{GetToolkitVersion
}{\param{int *
}{major = NULL
},
\param{int *
}{minor = NULL
}}
109 Returns the wxWidgets port ID used by the running program and eventually
110 fills the given pointers with the values of the major and minor digits
111 of the native toolkit currently used.
112 The version numbers returned are thus detected at run-time and not compile-time
113 (except when this is not possible e.g. wxMotif).
115 E.g. if your program is using wxGTK port this function will return wxPORT
\_GTK and
116 put in given pointers the versions of the GTK library in use.
118 See
\helpref{wxPlatformInfo
}{wxplatforminfo
} for more details.
121 \membersection{wxAppTraits::HasStderr
}\label{wxapptraitshasstderr
}
123 \func{virtual bool
}{HasStderr
}{\void}
125 Returns
\true if
{\tt fprintf(stderr)
} goes somewhere,
\false otherwise.
128 \membersection{wxAppTraits::IsUsingUniversalWidgets
}\label{wxapptraitsisusinguniversalwidgets
}
130 \constfunc{bool
}{IsUsingUniversalWidgets
}{\void}
132 Returns
\true if the library was built as wxUniversal. Always returns
133 \false for wxBase-only apps.
136 \membersection{wxAppTraits::ShowAssertDialog
}\label{wxapptraitsshowassertdialog
}
138 \func{virtual bool
}{ShowAssertDialog
}{\param{const wxString \&
}{ msg
}}
140 Shows the assert dialog with the specified message in GUI mode or just prints
141 the string to stderr in console mode.
143 Returns
\true to suppress subsequent asserts,
\false to continue as before.