TurtleBrains  0.3.1
High quality, portable, C++ framework for rapid 2D game development.
TurtleBrains::Application::ApplicationHandlerInterface Class Referenceabstract

Handle events from the application/window and actions from the user of your application by deriving an an object from ApplicationHandlerInterface. More...

#include <tb_application_handler_interface.h>

Public Member Functions

virtual ~ApplicationHandlerInterface (void)=0
virtual void OnWindowOpen (void)
virtual void OnWindowClose (void)
virtual void OnBecomeActive (void)
virtual void OnBecomeInactive (void)
virtual void OnRealtimeUpdate (void)
virtual void OnMenuAction (const MenuIdentifier &menu, const MenuItemIdentifier &menuItem)
virtual void OnDialogAction (const DialogIdentifier &dialog, const DialogControlIdentifier &dialogControl)
virtual void CollectWindowProperties (WindowProperties &windowProperties)

Detailed Description

The RealtimeApplication takes an ApplicationHandlerInterface object that will handle window events and changes including actions the user of your application takes with menus and dialogs. This is similar to the AppDelegate object in Cocoa or WndProc function in Win32.

Most classes in the Application area are up for a complete redesign of the public facing interface.

Constructor & Destructor Documentation

virtual TurtleBrains::Application::ApplicationHandlerInterface::~ApplicationHandlerInterface ( void  )
pure virtual

Destroys the ApplicationHandlerInterface object and cleans up any resources created or used during the lifetime of the object.

Member Function Documentation

virtual void TurtleBrains::Application::ApplicationHandlerInterface::CollectWindowProperties ( WindowProperties windowProperties)

Invoked to retrieve the size, and properties of the Real-time OpenGL window during the creation of the window.

windowPropertiesA reference to the properties of the window, filled out by you. The default settings are initialized beforehand, so if you want a default sized window, there is no need to do anything!
virtual void TurtleBrains::Application::ApplicationHandlerInterface::OnBecomeActive ( void  )

Invoked each time the window gains or regains focus.

virtual void TurtleBrains::Application::ApplicationHandlerInterface::OnBecomeInactive ( void  )

Invoked each time the window loses focus to another application.

virtual void TurtleBrains::Application::ApplicationHandlerInterface::OnDialogAction ( const DialogIdentifier dialog,
const DialogControlIdentifier dialogControl 

Invoked each time the user interacts with a dialog control of an active dialog object. For more information about how this is invoked, see documentation on the ApplicationDialog functions that add a dialog control.

See also
ApplicationDialog::AddButtonControl(), ApplicationDialog::AddCheckboxControl(), ApplicationDialog::AddDropdownControl(), ApplicationDialog::AddTextControl()
dialogThe identifier of the dialog object that was interacted with to be distinguished between one dialog and the next within your application.
dialogControlThe dialog control that was interacted with, this action usually means the user clicked on the control (button, checkbox) but in some cases the action is reported when the user navigates to a different control (text) or selected a new option (dropdown).
virtual void TurtleBrains::Application::ApplicationHandlerInterface::OnMenuAction ( const MenuIdentifier menu,
const MenuItemIdentifier menuItem 

Invoked each time the user clicks a menu item from a Window Menu or Context menu.

menuThe identifier of the menu object that was interacted with to be distinguished between one menu and the next within your application.
menuItemThe menu item that was clicked by the user for the given menu.
virtual void TurtleBrains::Application::ApplicationHandlerInterface::OnRealtimeUpdate ( void  )

Invoked once for each frame of a real-time application. This is invoked very often and generally as quickly as possible.

virtual void TurtleBrains::Application::ApplicationHandlerInterface::OnWindowClose ( void  )

Invoked only once just before the window is destroyed, there is no way to cancel the window from closing once this is called.

virtual void TurtleBrains::Application::ApplicationHandlerInterface::OnWindowOpen ( void  )

Invoked only once while the window is being created, just before it is shown so that a window menu, status bar, or other portions can be setup and added to the window.