TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_realtime_application.hpp
1 
9 #ifndef TurtleBrains_RealtimeApplication_hpp
10 #define TurtleBrains_RealtimeApplication_hpp
11 
12 #include <turtle_brains/core/tb_noncopyable.hpp>
13 #include <turtle_brains/core/tb_types.hpp>
14 #include <turtle_brains/application/tb_application_handler_interface.hpp>
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:
57  explicit RealtimeApplication(ApplicationHandlerInterface& applicationHandler);
58 
62  virtual ~RealtimeApplication(void);
63 
68  void Open(void);
69 
77  void Run(void);
78 
79  //
80  // @details Stops processing messages from the operating system and causes Run to exit. This allows
81  // cleanup to occur before Close() destroys the renderer context and window.
82  //
83  // TODO: TIM: Implementation: This needs to be slightly refactored / reimplemented.
84  //
85  //void Stop(void);
86 
91  void Close(void);
92 
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 
124 
132  void SetWindowProperties(const WindowProperties& windowProperties);
133 
140  void ShowMouseCursor(bool showMouse);
141 
149  void OpenDialog(const ApplicationDialog& dialog);
150 
157  void CloseDialog(const ApplicationDialog& dialog);
158 
168  bool OkayMessageBox(const tbCore::tbString& title, const tbCore::tbString& message);
169 
180  bool OkayCancelMessageBox(const tbCore::tbString& title, const tbCore::tbString& message);
181 
195  bool OpenFileDialog(tbCore::tbString& fileToOpen, const tbCore::tbString& fileExtension);
196 
210  bool SaveFileDialog(tbCore::tbString& fileToSave, const tbCore::tbString& fileExtension);
211 
212  private:
213  ApplicationHandlerInterface& mApplicationHandler;
214  };
215 
216  }; /* namespace Application */
217 }; /* namespace TurtleBrains */
218 
220 
221 #endif /* TurtleBrains_RealtimeApplication_hpp */
void SetWindowProperties(const WindowProperties &windowProperties)
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.hpp:22
Here is some information about the primary namespace.
Definition: tb_application_dialog.hpp: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.hpp:23
Definition: tb_application_window.hpp:29
Handle events from the application/window and actions from the user of your application by deriving a...
Definition: tb_application_handler_interface.hpp:32
Definition: tb_realtime_application.hpp: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.hpp:65
void OpenDialog(const ApplicationDialog &dialog)
Create a customized status bar area to feed the user status information.
Definition: tb_application_status.hpp:50
Create a customized dialog prompt with simple controls.
Definition: tb_application_dialog.hpp:89
void SetWindowTitle(const tbCore::tbString &windowTitle)
std::string tbString
Definition: tb_string.hpp:335