#include <wx/app.h>

Use DECLARE_APP(appClass) in a header file if you want the wxGetApp function (which returns a reference to your application object) to be visible to other files.
Public Member Functions | |
| wxApp () | |
| virtual | ~wxApp () |
| bool | GetExitOnFrameDelete () const |
| bool | GetUseBestVisual () const |
| virtual wxWindow * | GetTopWindow () const |
| virtual bool | IsActive () const |
| bool | ProcessMessage (WXMSG *msg) |
| virtual bool | SendIdleEvents (wxWindow *win, wxIdleEvent &event) |
| void | SetExitOnFrameDelete (bool flag) |
| virtual bool | SetNativeTheme (const wxString &theme) |
| void | SetTopWindow (wxWindow *window) |
| void | SetUseBestVisual (bool flag, bool forceTrueColour=false) |
Static Public Member Functions | |
| static void | SetInstance (wxAppConsole *app) |
| wxApp::wxApp | ( | ) |
Constructor. Called implicitly with a definition of a wxApp object.
| virtual wxApp::~wxApp | ( | ) | [virtual] |
Destructor. Will be called implicitly on program exit if the wxApp object is created on the stack.
| bool wxApp::GetExitOnFrameDelete | ( | ) | const |
Returns true if the application will exit when the top-level frame is deleted.
| bool wxApp::GetUseBestVisual | ( | ) | const |
Returns true if the application will use the best visual on systems that support different visuals, false otherwise.
| virtual wxWindow* wxApp::GetTopWindow | ( | ) | const [virtual] |
Returns a pointer to the top window.
| virtual bool wxApp::IsActive | ( | ) | const [virtual] |
Returns true if the application is active, i.e. if one of its windows is currently in the foreground.
If this function returns false and you need to attract users attention to the application, you may use wxTopLevelWindow::RequestUserAttention to do it.
| bool wxApp::ProcessMessage | ( | WXMSG * | msg | ) |
Windows-only function for processing a message. This function is called from the main message loop, checking for windows that may wish to process it.
The function returns true if the message was processed, false otherwise. If you use wxWidgets with another class library with its own message loop, you should make sure that this function is called to allow wxWidgets to receive messages. For example, to allow co-existence with the Microsoft Foundation Classes, override the PreTranslateMessage function:
// Provide wxWidgets message loop compatibility BOOL CTheApp::PreTranslateMessage(MSG *msg) { if (wxTheApp && wxTheApp->ProcessMessage((WXMSW *)msg)) return true; else return CWinApp::PreTranslateMessage(msg); }
| virtual bool wxApp::SendIdleEvents | ( | wxWindow * | win, | |
| wxIdleEvent & | event | |||
| ) | [virtual] |
Sends idle events to a window and its children. Please note that this function is internal to wxWidgets and shouldn't be used by user code.
| void wxApp::SetExitOnFrameDelete | ( | bool | flag | ) |
Allows the programmer to specify whether the application will exit when the top-level frame is deleted.
| flag | If true (the default), the application will exit when the top-level frame is deleted. If false, the application will continue to run. |
| static void wxApp::SetInstance | ( | wxAppConsole * | app | ) | [static] |
Allows external code to modify global wxTheApp, but you should really know what you're doing if you call it.
| app | Replacement for the global application object. |
Reimplemented from wxAppConsole.
| virtual bool wxApp::SetNativeTheme | ( | const wxString & | theme | ) | [virtual] |
Allows runtime switching of the UI environment theme.
Currently implemented for wxGTK2-only. Return true if theme was successfully changed.
| theme | The name of the new theme or an absolute path to a gtkrc-theme-file |
| void wxApp::SetTopWindow | ( | wxWindow * | window | ) |
Sets the 'top' window. You can call this from within OnInit() to let wxWidgets know which is the main window. You don't have to set the top window; it is only a convenience so that (for example) certain dialogs without parents can use a specific window as the top window. If no top window is specified by the application, wxWidgets just uses the first frame or dialog in its top-level window list, when it needs to use the top window.
| window | The new top window. |
| void wxApp::SetUseBestVisual | ( | bool | flag, | |
| bool | forceTrueColour = false | |||
| ) |
Allows the programmer to specify whether the application will use the best visual on systems that support several visual on the same display. This is typically the case under Solaris and IRIX, where the default visual is only 8-bit whereas certain applications are supposed to run in TrueColour mode.
Note that this function has to be called in the constructor of the wxApp instance and won't have any effect when called later on. This function currently only has effect under GTK.
| flag | If true, the app will use the best visual. | |
| forceTrueColour | If true then the application will try to force using a TrueColour visual and abort the app if none is found. |
|
[ top ] |