diff --git a/src/program.cpp b/src/program.cpp index 72f06aa2..f9991c11 100644 --- a/src/program.cpp +++ b/src/program.cpp @@ -69,7 +69,6 @@ #include "windows/HighscoresWindow.h" #include "windows/MainMenuWindow.h" #include "windows/OptionsWindow.h" -#include "windows/Window.h" using namespace std; using namespace violet; diff --git a/src/windows/Window.h b/src/windows/Window.h index 64f38313..82c9410c 100644 --- a/src/windows/Window.h +++ b/src/windows/Window.h @@ -4,6 +4,7 @@ #include #include #include + #include "../system/graphic/text/TextObject.h" #include "../system/graphic/text/TextManager.h" #include "../system/InputHandler.h" @@ -11,18 +12,23 @@ namespace violet { class Window { -protected: + +private: float m_left, m_top, m_right, m_bottom, m_r, m_g, m_b, m_a; std::map m_elements; std::map > m_lcHandlers; std::map > m_rcHandlers; std::map > m_mvHandlers; -public: + +protected: + enum HandlerType { hdl_all = 0, hdl_click, hdl_lclick, hdl_rclick, hdl_move }; + Window(float x, float y, int w, int h, float r, float g, float b, float a); + void addElement(std::string id, TextObject* element); void addElement(std::string id, std::string text, TextManager const* manager, int x, int y, TextManager::TextHAlignFlag halign, @@ -36,6 +42,9 @@ class Window { void removeElement(std::string name, bool remainHandler); void addHandler(HandlerType hdl, std::string elementName, boost::function handler); void removeHandler(HandlerType hdl, std::string elementName); + +public: + void process(InputHandler* input); void draw(); bool CloseFlag;