/**
@class wxAppConsole
- @wxheader{app.h}
This class is essential for writing console-only or hybrid apps without
- having to define wxUSE_GUI=0.
+ having to define @c wxUSE_GUI=0.
+
+ It is used to:
+ @li set and get application-wide properties (see wxAppConsole::CreateTraits
+ and wxAppConsole::SetXXX functions)
+ @li implement the windowing system message or event loop: events in fact are
+ supported even in console-mode applications (see wxAppConsole::HandleEvent
+ and wxAppConsole::ProcessPendingEvents);
+ @li initiate application processing via wxApp::OnInit;
+ @li allow default processing of events not handled by other
+ objects in the application (see wxAppConsole::FilterEvent)
+ @li implement Apple-specific event handlers (see wxAppConsole::MacXXX functions)
- @todo MORE INFO
+ You should use the macro IMPLEMENT_APP(appClass) in your application
+ implementation file to tell wxWidgets how to create an instance of your
+ application class.
+
+ 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.
@library{wxbase}
@category{appmanagement}
- @see @ref overview_app
+ @see @ref overview_app, wxApp, wxAppTraits, wxEventLoopBase
*/
class wxAppConsole : public wxEvtHandler
{
/**
Returns the user-readable application name.
- The difference between this string and the one returned by GetAppName() is that
- this one is meant to be shown to the user and so should be used for the window
- titles, page headers and so on while the other one should be only used internally,
- e.g. for the file names or configuration file keys.
- By default, returns the same string as GetAppName().
+ The difference between this string and the one returned by GetAppName()
+ is that this one is meant to be shown to the user and so should be used
+ for the window titles, page headers and so on while the other one
+ should be only used internally, e.g. for the file names or
+ configuration file keys. By default, returns the application name as
+ returned by GetAppName() capitalized using wxString::Capitalize().
@since 2.9.0
*/
/**
Returns the one and only global application object.
- Usually ::wxTheApp is usead instead.
+ Usually wxTheApp is used instead.
@see SetInstance()
*/
*/
static bool IsMainLoopRunning();
+ /**
+ Returns @true if called from inside Yield().
+ */
+ bool IsYielding() const;
+
+ /**
+ Process all pending events; it is necessary to call this function to
+ process posted events.
+
+ This happens during each event loop iteration in GUI mode but if there is
+ no main loop, it may be also called directly.
+ */
+ virtual void ProcessPendingEvents();
+
/**
Called in response of an "open-application" Apple event.
Override this to create a new document in your app.
virtual bool Pending();
/**
- Set the application name to be used in the user-visible places such as window
- titles. See GetAppDisplayName() for more about the differences between the
+ Set the application name to be used in the user-visible places such as
+ window titles.
+
+ See GetAppDisplayName() for more about the differences between the
display name and name.
+
+ Notice that if this function is called, the name is used as is, without
+ any capitalization as done by default by GetAppDisplayName().
*/
void SetAppDisplayName(const wxString& name);
user to perform actions which are not compatible with the current task.
Disabling menu items or whole menus during processing can avoid unwanted
reentrance of code: see ::wxSafeYield for a better function.
+ You can avoid unwanted reentrancies also using IsYielding().
Note that Yield() will not flush the message logs. This is intentional as
calling Yield() is usually done to quickly update the screen and popping up
/**
@class wxApp
- @wxheader{app.h}
- The wxApp class represents the application itself. It is used to:
+ The wxApp class represents the application itself when @c wxUSE_GUI=1.
- @li set and get application-wide properties;
- @li implement the windowing system message or event loop;
- @li initiate application processing via wxApp::OnInit;
- @li allow default processing of events not handled by other
- objects in the application.
+ In addition to the features provided by wxAppConsole it keeps track of
+ the <em>top window</em> (see SetTopWindow()) and adds support for
+ video modes (see SetVideoMode()).
- You should use the macro IMPLEMENT_APP(appClass) in your application
- implementation file to tell wxWidgets how to create an instance of your
- application class.
-
- 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.
+ In general, application-wide settings for GUI-only apps are accessible
+ from wxApp (or from wxSystemSettings or wxSystemOptions classes).
@library{wxbase}
@category{appmanagement}
- @see @ref overview_app
+ @see @ref overview_app, wxAppTraits, wxEventLoopBase, wxSystemSettings
*/
class wxApp : public wxAppConsole
{
*/
virtual ~wxApp();
+ /**
+ Get display mode that is used use. This is only used in framebuffer
+ wxWin ports (such as wxMGL or wxDFB).
+ */
+ virtual wxVideoMode GetDisplayMode() const;
+
/**
Returns @true if the application will exit when the top-level frame is deleted.
*/
bool GetExitOnFrameDelete() const;
+ /**
+ Return the layout direction for the current locale or @c wxLayout_Default
+ if it's unknown.
+ */
+ virtual wxLayoutDirection GetLayoutDirection() const;
+
/**
Returns @true if the application will use the best visual on systems that support
different visuals, @false otherwise.
/**
Returns a pointer to the top window.
- @remarks If the top window hasn't been set using SetTopWindow(),
- this function will find the first top-level window
- (frame or dialog) and return that.
+ @remarks
+ If the top window hasn't been set using SetTopWindow(), this function
+ will find the first top-level window (frame or dialog or instance of
+ wxTopLevelWindow) from the internal top level window list and return that.
@see SetTopWindow()
*/
*/
virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
+ /**
+ Set display mode to use. This is only used in framebuffer wxWin
+ ports (such as wxMGL or wxDFB). This method should be called from
+ wxApp::OnInitGui.
+ */
+ virtual bool SetDisplayMode(const wxVideoMode& info);
+
/**
Allows the programmer to specify whether the application will exit when the
top-level frame is deleted.
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.
+ 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 (or better, any wxTopLevelWindow) in its top-level
+ window list, when it needs to use the top window.
+ If you previously called SetTopWindow() and now you need to restore this
+ automatic behaviour you can call @code wxApp::SetTopWindow(NULL) @endcode.
@param window
The new top window.
// ============================================================================
-/** @ingroup group_funcmacro_rtti */
+/** @addtogroup group_funcmacro_rtti */
//@{
/**
- This is used in headers to create a forward declaration of the wxGetApp()
+ This is used in headers to create a forward declaration of the ::wxGetApp()
function implemented by IMPLEMENT_APP().
It creates the declaration <tt>className& wxGetApp()</tt>.
-/** @ingroup group_funcmacro_appinitterm */
+/** @addtogroup group_funcmacro_appinitterm */
//@{
/**
bool wxYield();
/**
- This function is similar to wxYield, except that it disables the user input to
- all program windows before calling wxYield and re-enables it again
- afterwards. If @a win is not @NULL, this window will remain enabled,
+ This function is similar to wxYield(), except that it disables the user
+ input to all program windows before calling wxYield() and re-enables it
+ again afterwards. If @a win is not @NULL, this window will remain enabled,
allowing the implementation of some limited user interaction.
Returns the result of the call to ::wxYield.
-/** @ingroup group_funcmacro_procctrl */
+/** @addtogroup group_funcmacro_procctrl */
//@{
/**