Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GUIScreen.h
Go to the documentation of this file.
1 // Copyright (C) 2010-2014 Dylan Blair
3 //
4 // email: dblair@alumni.cs.utexas.edu
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 
21 #ifndef GUISCREEN_H
22 #define GUISCREEN_H
23 
24 #include "GUtils.h"
25 
26 #include <OIS.h>
27 
28 #include <CEGUIFont.h>
29 #include <CEGUIImageset.h>
30 #include <CEGUISystem.h>
31 #include <CEGUILogger.h>
32 #include <CEGUISchemeManager.h>
33 #include <CEGUIWindowManager.h>
34 #include <CEGUIWindow.h>
35 #include <elements/CEGUICheckbox.h>
36 #include <elements/CEGUIRadioButton.h>
37 #include <elements/CEGUIComboDropList.h>
38 #include <elements/CEGUICombobox.h>
39 #include <elements/CEGUIEditbox.h>
40 #include <elements/CEGUIListbox.h>
41 #include <elements/CEGUIListboxTextItem.h>
42 #include <elements/CEGUIPushButton.h>
43 #include <elements/CEGUIScrollbar.h>
44 #include <elements/CEGUISlider.h>
45 #include <elements/CEGUISpinner.h>
46 #include <elements/CEGUITooltip.h>
47 
48 namespace OpenSkyNet {
49  namespace Graphics {
50  CEGUI::Rect getTextArea(const CEGUI::Window* textWindow_);
51 
58  void wrapText(CEGUI::Window* textWindow_, const std::string& text_, bool doSetText_, std::string& renderableText_, std::string& leftoverText_);
59 
60  class UI;
61 
63  class UIScreen {
64  public:
65  UIScreen(UI* app_, const std::string& fileName_);
66 
67  virtual void load();
68 
69  virtual void unload();
70 
71  virtual void reload();
72 
73  virtual ~UIScreen() {}
74 
75  inline CEGUI::Window* getGUISheet() {
76  if (!_window) load();
77  return _window;
78  }
79 
80  virtual void switchMouseMode() {}
81 
82  virtual bool update(float dt_);
83 
84  virtual bool keyPressed(const OIS::KeyEvent& arg_) { return false; }
85  virtual bool keyReleased(const OIS::KeyEvent& arg_) { return false; }
86 
87  virtual void pushScreen(UIScreen* screen_);
88  virtual void popScreen(bool doUnload_=true);
90  protected:
91  UI* _app;
92  std::string _fileName;
93  CEGUI::Window* _window;
95 
96  virtual void setupEventHandlers() {}
97  };
98  }
99 }
100 
101 #endif //GUISCREEN_H
CEGUI::Window * getGUISheet()
Definition: GUIScreen.h:75
virtual void reload()
Definition: GUIScreen.cpp:81
virtual bool keyReleased(const OIS::KeyEvent &arg_)
Definition: GUIScreen.h:85
virtual void unload()
Definition: GUIScreen.cpp:74
void wrapText(CEGUI::Window *textWindow_, const std::string &text_, bool doSetText_, std::string &renderableText_, std::string &leftoverText_)
UI * _app
Definition: GUIScreen.h:91
UIScreen(UI *app_, const std::string &fileName_)
Definition: GUIScreen.cpp:64
CEGUI::Rect getTextArea(const CEGUI::Window *textWindow_)
Definition: GUIScreen.cpp:13
virtual void popScreen(bool doUnload_=true)
Definition: GUIScreen.cpp:104
virtual ~UIScreen()
Definition: GUIScreen.h:73
CEGUI::Window * _window
Definition: GUIScreen.h:93
std::string _fileName
Definition: GUIScreen.h:92
virtual bool update(float dt_)
Definition: GUIScreen.cpp:92
void popAndUnloadScreenNextUpdate()
Definition: GUIScreen.h:89
bool _popAndUnloadScreenNextUpdate
Definition: GUIScreen.h:94
virtual void load()
Definition: GUIScreen.cpp:66
Definition: GUIScreen.h:63
virtual void setupEventHandlers()
Definition: GUIScreen.h:96
virtual bool keyPressed(const OIS::KeyEvent &arg_)
Definition: GUIScreen.h:84
virtual void switchMouseMode()
Definition: GUIScreen.h:80
Definition: GUI.h:82
virtual void pushScreen(UIScreen *screen_)
Definition: GUIScreen.cpp:103