wxapptraitsthe wxapptraits class defines various configurable aspects of a wxapp. you can access it using wxapp::gettraits function and you can create your own wxapptraits overriding the wxapp::createtraits function. by default, wxwidgets creates a wxconsoleapptraits object for console applications (i.e. those applications linked against wxbase library only - see the libraries list page) and a wxguiapptraits object for gui applications. derived from none include files <wx/apptrait.h> see also members
wxapptraits::createfontmapper
wxapptraits::createfontmappervirtual wxfontmapper * createfontmapper() creates the global font mapper object used for encodings/charset mapping.
wxapptraits::createlogtargetvirtual wxlog * createlogtarget() creates the default log target for the application.
wxapptraits::createmessageoutputvirtual wxmessageoutput * createmessageoutput() creates the global object used for printing out messages.
wxapptraits::createrenderervirtual wxrenderernative * createrenderer() returns the renderer to use for drawing the generic controls (return value may be null in which case the default renderer for the current platform is used); this is used in gui mode only and always returns null in console. note: returned pointer will be deleted by the caller.
wxapptraits::getdesktopenvironmentvirtual wxstring getdesktopenvironment() const this method returns the name of the desktop environment currently running in a unix desktop. currently only "kde" or "gnome" are supported and the code uses the x11 session protocol vendor name to figure out, which desktop environment is running. the method returns an empty string otherwise and on all other platforms.
wxapptraits::getstandardpathsvirtual wxstandardpaths & getstandardpaths() returns the wxstandardpaths object for the application. it's normally the same for wxbase and wxgui except in the case of wxmac and wxcocoa.
wxapptraits::gettoolkitversionvirtual wxportid gettoolkitversion(int *major = null, int *minor = null) returns the wxwidgets port id used by the running program and eventually fills the given pointers with the values of the major and minor digits of the native toolkit currently used. the version numbers returned are thus detected at run-time and not compile-time (except when this is not possible e.g. wxmotif). e.g. if your program is using wxgtk port this function will return wxport_gtk and put in given pointers the versions of the gtk library in use. see wxplatforminfo for more details.
wxapptraits::hasstderrvirtual bool hasstderr() returns true if fprintf(stderr) goes somewhere, false otherwise.
wxapptraits::isusinguniversalwidgetsbool isusinguniversalwidgets() const returns true if the library was built as wxuniversal. always returns false for wxbase-only apps.
wxapptraits::showassertdialogvirtual bool showassertdialog(const wxstring & msg) shows the assert dialog with the specified message in gui mode or just prints the string to stderr in console mode. returns true to suppress subsequent asserts, false to continue as before.
|