2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: apptrait.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxAppTraits
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxAppTraits
|
|
|
|
@wxheader{apptrait.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The @b wxAppTraits class defines various configurable aspects of a wxApp.
|
2008-03-12 18:18:27 -04:00
|
|
|
You can access it using wxApp::GetTraits function and you can create your
|
|
|
|
own wxAppTraits overriding the wxApp::CreateTraits function.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
By default, wxWidgets creates a @c wxConsoleAppTraits object for console
|
2008-03-12 18:18:27 -04:00
|
|
|
applications (i.e. those applications linked against wxBase library only -
|
|
|
|
see the @ref page_libs page) and a @c wxGUIAppTraits object for GUI
|
2008-03-08 08:52:38 -05:00
|
|
|
applications.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxbase}
|
2008-03-12 18:18:27 -04:00
|
|
|
@category{appmanagement}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-12 18:18:27 -04:00
|
|
|
@see @ref overview_app, wxApp
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxAppTraits
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Called by wxWidgets to create the default configuration object for the
|
2008-03-12 18:18:27 -04:00
|
|
|
application. The default version creates a registry-based wxRegConfig
|
|
|
|
class under MSW and wxFileConfig under all other platforms.
|
|
|
|
|
|
|
|
The wxApp::GetAppName and wxApp::GetVendorName methods are used to
|
|
|
|
determine the registry key or file name.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual wxConfigBase* CreateConfig();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the global font mapper object used for encodings/charset mapping.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual wxFontMapper* CreateFontMapper();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-20 19:45:15 -04:00
|
|
|
Creates a wxLog class for the application to use for logging errors.
|
|
|
|
The default implementation returns a new wxLogGui class.
|
|
|
|
|
|
|
|
@see wxLog
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual wxLog* CreateLogTarget();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the global object used for printing out messages.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual wxMessageOutput* CreateMessageOutput();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-12 18:18:27 -04:00
|
|
|
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 the returned pointer needs to be deleted by the caller.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual wxRendererNative* CreateRenderer();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
virtual wxString GetDesktopEnvironment() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the wxStandardPaths object for the application.
|
2008-03-12 18:18:27 -04:00
|
|
|
It's normally the same for wxBase and wxGUI except in the case of wxMac
|
|
|
|
and wxCocoa.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-21 10:22:27 -04:00
|
|
|
virtual wxStandardPaths& GetStandardPaths();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
2008-03-12 18:18:27 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The version numbers returned are thus detected at run-time and not compile-time
|
|
|
|
(except when this is not possible e.g. wxMotif).
|
2008-03-12 18:18:27 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
E.g. if your program is using wxGTK port this function will return wxPORT_GTK
|
2008-03-12 18:18:27 -04:00
|
|
|
and put in given pointers the versions of the GTK library in use.
|
2008-03-08 08:52:38 -05:00
|
|
|
See wxPlatformInfo for more details.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual wxPortId GetToolkitVersion(int* major = NULL,
|
|
|
|
int* minor = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if @c fprintf(stderr) goes somewhere, @false otherwise.
|
|
|
|
*/
|
|
|
|
virtual bool HasStderr();
|
|
|
|
|
|
|
|
/**
|
2008-03-12 18:18:27 -04:00
|
|
|
Returns @true if the library was built as wxUniversal.
|
|
|
|
Always returns @false for wxBase-only apps.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsUsingUniversalWidgets() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual bool ShowAssertDialog(const wxString& msg);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|