Classes | |
class | wxAppConsole |
This class is essential for writing console-only or hybrid apps without having to define wxUSE_GUI=0 . More... | |
class | wxApp |
The wxApp class represents the application itself when wxUSE_GUI=1 . More... | |
Macros | |
#define | wxDECLARE_APP(className) |
This is used in headers to create a forward declaration of the wxGetApp() function implemented by wxIMPLEMENT_APP(). | |
#define | wxIMPLEMENT_APP(className) |
This is used in the application class implementation file to make the application class known to wxWidgets for dynamic construction. | |
#define | wxDISABLE_DEBUG_SUPPORT() |
Use this macro to disable all debugging code in release build when not using wxIMPLEMENT_APP(). | |
Functions | |
wxAppDerivedClass & | wxGetApp () |
This function doesn't exist in wxWidgets but it is created by using the wxIMPLEMENT_APP() macro. | |
bool | wxHandleFatalExceptions (bool doIt=true) |
If doIt is true, the fatal exceptions (also known as general protection faults under Windows or segmentation violations in the Unix world) will be caught and passed to wxApp::OnFatalException. | |
bool | wxInitialize () |
This function is used in wxBase only and only if you don't create wxApp object at all. | |
void | wxUninitialize () |
This function is for use in console (wxBase) programs only. | |
void | wxWakeUpIdle () |
This function wakes up the (internal and platform dependent) idle system, i.e. | |
bool | wxYield () |
Calls wxAppConsole::Yield. | |
bool | wxSafeYield (wxWindow *win=NULL, bool onlyIfNeeded=false) |
Calls wxApp::SafeYield. | |
int | wxEntry (int &argc, wxChar **argv) |
This function initializes wxWidgets in a platform-dependent way. | |
int | wxEntry (HINSTANCE hInstance, HINSTANCE hPrevInstance=NULL, char *pCmdLine=NULL, int nCmdShow=SW_SHOWNORMAL) |
See wxEntry(int&,wxChar**) for more info about this function. | |
void | wxExit () |
Exits application after calling wxApp::OnExit. | |
Variables | |
wxApp * | wxTheApp |
The global pointer to the singleton wxApp object. | |
#define wxDECLARE_APP | ( | className | ) |
This is used in headers to create a forward declaration of the wxGetApp() function implemented by wxIMPLEMENT_APP().
It creates the declaration className& wxGetApp()
(requires a final semicolon).
Include file:
#include <wx/app.h>
Example:
#define wxDISABLE_DEBUG_SUPPORT | ( | ) |
Use this macro to disable all debugging code in release build when not using wxIMPLEMENT_APP().
Currently this macro disables assert checking and debug and trace level logging messages in release build (i.e. when NDEBUG
is defined). It is used by wxIMPLEMENT_APP() macro so you only need to use it explicitly if you don't use this macro but initialize wxWidgets directly (e.g. calls wxEntry() or wxEntryStart() itself).
If you do not want to disable debugging code even in release build of your application, you can use wxSetDefaultAssertHandler() and wxLog::SetLogLevel() with wxLOG_Max
parameter to enable assertions and debug logging respectively.
Include file:
#include <wx/app.h>
#define wxIMPLEMENT_APP | ( | className | ) |
This is used in the application class implementation file to make the application class known to wxWidgets for dynamic construction.
Note that this macro requires a final semicolon.
Include file:
#include <wx/app.h>
Example:
int wxEntry | ( | HINSTANCE | hInstance, |
HINSTANCE | hPrevInstance = NULL , |
||
char * | pCmdLine = NULL , |
||
int | nCmdShow = SW_SHOWNORMAL |
||
) |
See wxEntry(int&,wxChar**) for more info about this function.
Notice that under Windows CE platform, and only there, the type of pCmdLine is wchar_t
*, otherwise it is char
*, even in Unicode build.
Include file:
#include <wx/app.h>
int wxEntry | ( | int & | argc, |
wxChar ** | argv | ||
) |
This function initializes wxWidgets in a platform-dependent way.
Use this if you are not using the default wxWidgets entry code (e.g. main or WinMain).
For example, you can initialize wxWidgets from an Microsoft Foundation Classes (MFC) application using this function.
Include file:
#include <wx/app.h>
void wxExit | ( | ) |
Exits application after calling wxApp::OnExit.
Should only be used in an emergency: normally the top-level frame should be deleted (after deleting all other frames) to terminate the application. See wxCloseEvent and wxApp.
Include file:
#include <wx/app.h>
wxAppDerivedClass & wxGetApp | ( | ) |
This function doesn't exist in wxWidgets but it is created by using the wxIMPLEMENT_APP() macro.
Thus, before using it anywhere but in the same module where this macro is used, you must make it available using wxDECLARE_APP().
The advantage of using this function compared to directly using the global wxTheApp pointer is that the latter is of type wxApp* and so wouldn't allow you to access the functions specific to your application class but not present in wxApp while wxGetApp() returns the object of the right type.
Include file:
#include <wx/app.h>
bool wxHandleFatalExceptions | ( | bool | doIt = true | ) |
If doIt is true, the fatal exceptions (also known as general protection faults under Windows or segmentation violations in the Unix world) will be caught and passed to wxApp::OnFatalException.
By default, i.e. before this function is called, they will be handled in the normal way which usually just means that the application will be terminated. Calling wxHandleFatalExceptions() with doIt equal to false will restore this default behaviour.
Notice that this function is only available if wxUSE_ON_FATAL_EXCEPTION
is 1 and under Windows platform this requires a compiler with support for SEH (structured exception handling) which currently means only Microsoft Visual C++ or a recent Borland C++ version.
Include file:
#include <wx/app.h>
bool wxInitialize | ( | ) |
This function is used in wxBase only and only if you don't create wxApp object at all.
In this case you must call it from your main()
function before calling any other wxWidgets functions.
If the function returns false the initialization could not be performed, in this case the library cannot be used and wxUninitialize() shouldn't be called neither.
This function may be called several times but wxUninitialize() must be called for each successful call to this function.
Include file:
#include <wx/app.h>
bool wxSafeYield | ( | wxWindow * | win = NULL , |
bool | onlyIfNeeded = false |
||
) |
void wxUninitialize | ( | ) |
This function is for use in console (wxBase) programs only.
It must be called once for each previous successful call to wxInitialize().
Include file:
#include <wx/app.h>
void wxWakeUpIdle | ( | ) |
This function wakes up the (internal and platform dependent) idle system, i.e.
it will force the system to send an idle event even if the system currently is idle and thus would not send any idle event until after some other event would get sent. This is also useful for sending events between two threads and is used by the corresponding functions wxPostEvent() and wxEvtHandler::AddPendingEvent().
Include file:
#include <wx/app.h>
bool wxYield | ( | ) |
Calls wxAppConsole::Yield.
Include file:
#include <wx/app.h>
wxApp* wxTheApp |
The global pointer to the singleton wxApp object.