MGUI::APP_MAIN Class Reference

Base class for main application instance. More...

#include <mgui/appmain.h>

Inheritance diagram for MGUI::APP_MAIN:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 APP_MAIN ()
virtual ~APP_MAIN ()=0
const char * GetCmdParm (int idx) const
int GetCmdParmCount () const
void RemoveCmdParm (int idx)

Static Public Member Functions

static void AddQueuedDelegate (DELEGATE_VOID_NOPARMS delegate)
static void EnableQueueDelegates (bool enable=true)
static void Exit ()
static APP_BASEGetBaseInstance ()
static ICONID GetDefaultIconID ()
static APP_MAINGetMainInstance ()
static void ProcessPendingEvent ()
static void ProcessPendingEvents ()
static void RemoveQueuedDelegate (DELEGATE_VOID_NOPARMS delegate)

Private Member Functions

virtual void v_ExitInstance ()
virtual bool v_InitInstance ()

Detailed Description

Base class for main application instance.

A class must be derived from APP_MAIN and a single instance must be declared at file (static global) scope in the main application module. Only one instance of this class may be defined per executable. See also: APP_BASE.


Constructor & Destructor Documentation

MGUI::APP_MAIN::APP_MAIN (  ) 

Constructor.

virtual MGUI::APP_MAIN::~APP_MAIN (  )  [pure virtual]

Destructor.


Member Function Documentation

static void MGUI::APP_MAIN::AddQueuedDelegate ( DELEGATE_VOID_NOPARMS  delegate  )  [static]

Add queued delegate, which will be called from main thread in main loop.

If delegate is already in queue it will not be added again. Can be called from worker thread.

static void MGUI::APP_MAIN::EnableQueueDelegates ( bool  enable = true  )  [static]

Enabled queued delegates - may only be called from main thread.

static void MGUI::APP_MAIN::Exit (  )  [inline, static]

Terminate the event loop and exit application normally.

static APP_BASE* MGUI::APP_MAIN::GetBaseInstance (  )  [inline, static]

Get reference to the single APP_BASE instance for this executable.

const char* MGUI::APP_MAIN::GetCmdParm ( int  idx  )  const [inline]

Get command-line parameter for specified index.

Parameters:
idx Command parameter index
int MGUI::APP_MAIN::GetCmdParmCount (  )  const [inline]

Get number of command-line parameters.

static ICONID MGUI::APP_MAIN::GetDefaultIconID (  )  [static]

Get the default icon for MGUI::SHELLs.

static APP_MAIN* MGUI::APP_MAIN::GetMainInstance (  )  [inline, static]

Get reference to the single APP_MAIN instance for this executable.

static void MGUI::APP_MAIN::ProcessPendingEvent (  )  [static]

Process single event if any is pending and return.

This function should be used in long-running code where no status information is being displayed but event processing is desired. This function should be used sparingly.

static void MGUI::APP_MAIN::ProcessPendingEvents (  )  [static]

Process all pending events (if any) and return.

This function can be used to force display to "catch" up with changes before returning to user control. This function should be used sparingly.

void MGUI::APP_MAIN::RemoveCmdParm ( int  idx  ) 

Remove command-line parameter at specified index.

Note, idx must be > 0 as first entry cannot be removed.

static void MGUI::APP_MAIN::RemoveQueuedDelegate ( DELEGATE_VOID_NOPARMS  delegate  )  [static]

Remove queued delegate.

virtual void MGUI::APP_MAIN::v_ExitInstance (  )  [private, virtual]

Called just prior to application exit.

May be overridden to clean up allocated instance resource.

virtual bool MGUI::APP_MAIN::v_InitInstance (  )  [private, virtual]

Called at application startup.

Normally overridden if multiple 'processes' are built into a single executable. In this case the command line parameters may be processed to determine which process to invoke and call a function or method to create a static instance of a derived APP_BASE class for that process.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:35:26 2012 for TNTsdk 2012 by  doxygen 1.6.1