TurtleBrains  0.3.1
High quality, portable, C++ framework for rapid 2D game development.
tb_realtime_application.h
1 
9 #ifndef _TurtleBrains_RealtimeApplication_h_
10 #define _TurtleBrains_RealtimeApplication_h_
11 
12 #include "../core/tb_noncopyable.h"
13 #include "../core/tb_types.h"
14 #include "tb_application_handler_interface.h"
15 
16 namespace TurtleBrains
17 {
18  namespace Application
19  {
20 
21  class ApplicationDialog;
22  class ApplicationMenu;
23  class ApplicationStatus;
24 
25 //--------------------------------------------------------------------------------------------------------------------//
26 
31  extern const bool kResultOkay;
32 
37  extern const bool kResultCancel;
38 
44  {
45  public:
46 
58  explicit RealtimeApplication(ApplicationHandlerInterface& applicationHandler);
59 
64 
69  void Open(void);
70 
78  void Run(void);
79 
80  //
81  // @details Stops processing messages from the operating system and causes Run to exit. This allows
82  // cleanup to occur before Close() destroys the renderer context and window.
83  //
84  // TODO: TIM: Implementation: This needs to be slightly refactored / reimplemented.
85  //
86  //void Stop(void);
87 
92  void Close(void);
93 
101  void SetWindowMenu(const ApplicationMenu& menu);
102 
107  void SetContextMenu(const ApplicationMenu& menu);
108 
113  void SetWindowStatus(const ApplicationStatus& status);
114 
118  void SetWindowTitle(const tbCore::tbString& windowTitle);
119 
127  void OpenDialog(const ApplicationDialog& dialog);
128 
135  void CloseDialog(const ApplicationDialog& dialog);
136 
146  bool OkayMessageBox(const tbCore::tbString& title, const tbCore::tbString& message);
147 
158  bool OkayCancelMessageBox(const tbCore::tbString& title, const tbCore::tbString& message);
159 
169  bool OpenFileDialog(tbCore::tbString& fileToOpen, const tbCore::tbString& fileExtension);
170 
180  bool SaveFileDialog(tbCore::tbString& fileToSave, const tbCore::tbString& fileExtension);
181 
182  private:
183  ApplicationHandlerInterface& mApplicationHandler;
184  };
185 
186  }; /* namespace Application */
187 }; /* namespace TurtleBrains */
188 
190 
191 #endif /* _TurtleBrains_RealtimeApplication_h_ */
void SetContextMenu(const ApplicationMenu &menu)
bool OkayCancelMessageBox(const tbCore::tbString &title, const tbCore::tbString &message)
bool OpenFileDialog(tbCore::tbString &fileToOpen, const tbCore::tbString &fileExtension)
Definition: tb_noncopyable.h:22
Here is some information about the primary namespace.
Definition: tb_application_dialog.h:21
void CloseDialog(const ApplicationDialog &dialog)
void SetWindowMenu(const ApplicationMenu &menu)
void SetWindowStatus(const ApplicationStatus &status)
bool OkayMessageBox(const tbCore::tbString &title, const tbCore::tbString &message)
Contains classes, functions and constants to create Applications, Menus, Dialogs with native controls...
Definition: tb_application_dialog.h:23
Handle events from the application/window and actions from the user of your application by deriving a...
Definition: tb_application_handler_interface.h:31
Definition: tb_realtime_application.h:43
RealtimeApplication(ApplicationHandlerInterface &applicationHandler)
bool SaveFileDialog(tbCore::tbString &fileToSave, const tbCore::tbString &fileExtension)
To create simple but powerful menu to be used in an applications or game development tools...
Definition: tb_application_menu.h:65
void OpenDialog(const ApplicationDialog &dialog)
Create a customized status bar area to feed the user status information.
Definition: tb_application_status.h:50
Create a customized dialog prompt with simple controls.
Definition: tb_application_dialog.h:89
void SetWindowTitle(const tbCore::tbString &windowTitle)
std::string tbString
Definition: tb_string.h:335