TurtleBrains  0.3.1
High quality, portable, C++ framework for rapid 2D game development.
TurtleBrains::Application Namespace Reference

Contains classes, functions and constants to create Applications, Menus, Dialogs with native controls, and Message Boxes. More...

Classes

class  ApplicationDialog
 Create a customized dialog prompt with simple controls. More...
 
class  ApplicationHandlerInterface
 Handle events from the application/window and actions from the user of your application by deriving an an object from ApplicationHandlerInterface. More...
 
class  ApplicationMenu
 To create simple but powerful menu to be used in an applications or game development tools. More...
 
class  ApplicationStatus
 Create a customized status bar area to feed the user status information. More...
 
class  RealtimeApplication
 
struct  WindowProperties
 

Typedefs

typedef unsigned short DialogIdentifier
 
typedef unsigned short DialogControlIdentifier
 
typedef int DialogControlGuide
 
typedef int DialogControlSlot
 
typedef unsigned short MenuIdentifier
 
typedef unsigned short MenuItemIdentifier
 
typedef unsigned short StatusIdentifier
 
typedef unsigned short StatusItemIdentifier
 

Enumerations

enum  DialogBucketType { kSingleBucket, kDoubleBucket }
 
enum  Key {
  tbKey0, tbKey1, tbKey2, tbKey3,
  tbKey4, tbKey5, tbKey6, tbKey7,
  tbKey8, tbKey9, tbKeyA, tbKeyB,
  tbKeyC, tbKeyD, tbKeyE, tbKeyF,
  tbKeyG, tbKeyH, tbKeyI, tbKeyJ,
  tbKeyK, tbKeyL, tbKeyM, tbKeyN,
  tbKeyO, tbKeyP, tbKeyQ, tbKeyR,
  tbKeyS, tbKeyT, tbKeyU, tbKeyV,
  tbKeyW, tbKeyX, tbKeyY, tbKeyZ,
  tbKeySpace, tbKeyEscape, tbKeyEnter, tbKeyUp,
  tbKeyDown, tbKeyLeft, tbKeyRight, tbMouseLeft,
  tbMouseRight, tbMouseMiddle, tbKeyMax
}
 

Variables

const DialogControlSlot kDefaultSlot
 
const MenuItemIdentifier kInvalidMenuItemIdentifier
 
const bool kResultOkay
 
const bool kResultCancel
 

Detailed Description

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

Also known as tbApplication, the objects and functions within the namespace TurtleBrains::Application aim to create applications with menus, dialog controls and other system prompts that are native to the operating system compiled for. TODO: TIM: Documentation: Some more high-level details here...

Creating your first application

Creating an application typically takes a fair bit of effort to setup and get started. A TurtleBrains::Application::RealtimeApplication tries to minimize this effort and allow your application to run on multiple platforms.

TODO: TIM: Documentation: More information, and an example, about how to create a Hello World application.

Typedef Documentation

Expresses the horizonal position, column, of a dialog control in the dialog.

TODO: TIM: DocLink: Link to an example of control placement and sizing.

Each control added to a dialog must have a unique identifier that is used to access and modify the dialog control at any point after it is added. The DialogControlIdentifier is also used to handle the action of the dialog control being interacted with by the user. It is possible to use the same identifier for multiple controls by using ApplicationDialog::SetControlSafeForDuplication(). However identifiers that are safe for duplication cannot be accessed or modified and the action may not be reported.

Expresses the vertical position, row, of a dialog control in the dialog where 0 represents the top-most control.

TODO: TIM: DocLink: Link to an example of control placement and sizing.

The key to an application dialog lies within this identifier, the value must be unique for different dialogs in your project. The ApplicationDialog object takes the identifier and uses it to hide the messy implementation details behind the scenes. Multiple ApplicationDialog objects with the same identifier will access the settings for the same dialog even though they are different ApplicationDialog objects.

The key to an application menu lies within this identifier, the value must be unique for different menus in your project. The ApplicationMenu object takes the identifier and uses it to hide the messy implementation details behind the scenes. Multiple ApplicationMenu objects with the same identifier will access the settings for the same menu even though they are different ApplicationMenu objects.

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

Each item added to a menu must have a unique identifier that is used to access and modify the item at any point after it is added. The MenuItemIdentifier is also used to handle the action of the menu item being clicked or interacted with by the user. It is possible to use the same identifier for multiple items by using ApplicationMenu::SetItemSafeForDuplication(). However identifiers that are safe for duplication cannot be accessed or modified, and the action may not be reported.

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

The key to an application status lies within this identifier, the value must be unique for different status in your project. The ApplicationStatus object takes the identifier and uses it to hide the messy implementation details behind the scenes. Multiple ApplicationStatus objects with the same identifier will access the settings for the same status bar even though they are different ApplicationStatus objects.

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

Each item added to a status bar must have a unique identifier that is used to access and modify the item at any point after it is added. This identifier cannot be made safe for duplication.

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

Enumeration Type Documentation

The DialogBucketType chooses the width for the ApplicationDialog in number of buckets for dialog controls to be added to and placed within.

TODO: TIM: DocLink: Link to an example of control placement and sizing.

Each Key supported by the TurtleBrains input system has a unique value for checking the status of the Key. Supported keys: 0 through 9 on the top of the Keyboard, A through Z, Up, Down, Left, Right arrows, the Space, Enter and Escape keys. Left, Middle and Right mouse buttons.

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

Variable Documentation

const DialogControlSlot TurtleBrains::Application::kDefaultSlot

This slot value represents "the bottom most row" of the ApplicationDialog given a specified guide.

TODO: TIM: DocLink: Link to an example of control placement and sizing.

const MenuItemIdentifier TurtleBrains::Application::kInvalidMenuItemIdentifier

No valid MenuItem should have this identifier.

Warning
Most classes in the Application area are up for a complete redesign of the public facing interface.
const bool TurtleBrains::Application::kResultCancel

This is the value that is returned when the user presses Cancel from a MessageBox or presses escape or a canceling action on the supported system prompts/dialogs (like pressing close on the OpenFileDialog).

const bool TurtleBrains::Application::kResultOkay

This is the value that is returned when the user presses Okay from a MessageBox or presses an action button on one of the supported system prompts/dialogs (like pressing Open on the OpenFileDialog).