From 479a67a731be5a5e8035ea7acce0344c7c605814 Mon Sep 17 00:00:00 2001 From: Zaba999 Date: Mon, 10 Sep 2012 23:29:38 +0200 Subject: Merge with changes from Zaba999 fork. --- src/ui/control.h | 138 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 65 deletions(-) (limited to 'src/ui/control.h') diff --git a/src/ui/control.h b/src/ui/control.h index 0a12ff1..c3a35f4 100644 --- a/src/ui/control.h +++ b/src/ui/control.h @@ -19,19 +19,24 @@ #pragma once -#include "old/text.h" -#include "common/struct.h" +//#include "old/text.h" +#include "graphics/engine/text.h" +//#include "common/struct.h" #include "common/event.h" +namespace Gfx { +class CEngine; +class CParticle; +}; class CInstanceManager; class CEvent; -class CD3DEngine; +//class Gfx::CEngine; class CRobotMain; -class CParticule; -class CSound; - +//class Gfx::CParticle; +class CSoundInterface; +namespace Ui { enum ControlState { STATE_ENABLE = (1<<0), // active @@ -58,42 +63,43 @@ enum ControlState class CControl { public: - CControl(CInstanceManager* iMan); +// CControl(CInstanceManager* iMan); + CControl (); virtual ~CControl(); - virtual bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - - virtual bool EventProcess(const Event &event); - - virtual void SetPos(Math::Point pos); - virtual Math::Point RetPos(); - virtual void SetDim(Math::Point dim); - virtual Math::Point RetDim(); - virtual bool SetState(int state, bool bState); - virtual bool SetState(int state); - virtual bool ClearState(int state); - virtual bool TestState(int state); - virtual int RetState(); - virtual void SetIcon(int icon); - virtual int RetIcon(); - virtual void SetName(char* name, bool bTooltip=true); - virtual char* RetName(); - virtual void SetJustif(int mode); - virtual int RetJustif(); - virtual void SetFontSize(float size); - virtual float RetFontSize(); - virtual void SetFontStretch(float stretch); - virtual float RetFontStretch(); - virtual void SetFontType(FontType font); - virtual FontType RetFontType(); - virtual bool SetTooltip(char* name); - virtual bool GetTooltip(Math::Point pos, char* name); - virtual void SetFocus(bool bFocus); - virtual bool RetFocus(); - - virtual EventMsg RetEventMsg(); - - virtual void Draw(); + virtual bool Create(Math::Point pos, Math::Point dim, int icon, EventType eventType); + + virtual bool EventProcess(const Event &event); + + virtual void SetPos(Math::Point pos); + virtual Math::Point GetPos(); + virtual void SetDim(Math::Point dim); + virtual Math::Point GetDim(); + virtual bool SetState(int state, bool bState); + virtual bool SetState(int state); + virtual bool ClearState(int state); + virtual bool TestState(int state); + virtual int GetState(); + virtual void SetIcon(int icon); + virtual int GetIcon(); + virtual void SetName(char* name, bool bTooltip=true); + virtual char* GetName(); + virtual void SetTextAlign(Gfx::TextAlign mode); + virtual int GetTextAlign(); + virtual void SetFontSize(float size); + virtual float GetFontSize(); + virtual void SetFontStretch(float stretch); + virtual float GetFontStretch(); + virtual void SetFontType(Gfx::FontType font); + virtual Gfx::FontType GetFontType(); + virtual bool SetTooltip(const char* name); + virtual bool GetTooltip(Math::Point pos, char* name); + virtual void SetFocus(bool bFocus); + virtual bool GetFocus(); + + virtual EventType GetEventType(); + + virtual void Draw(); protected: void GlintDelete(); @@ -108,31 +114,33 @@ protected: protected: CInstanceManager* m_iMan; - CD3DEngine* m_engine; - CEvent* m_event; - CRobotMain* m_main; - CParticule* m_particule; - CSound* m_sound; - - Math::Point m_pos; // corner upper / left - Math::Point m_dim; // dimensions - int m_icon; - EventMsg m_eventMsg; // message to send when clicking - int m_state; // states (STATE_ *) - float m_fontSize; // size of the button name - float m_fontStretch; // stretch of the font - FontType m_fontType; // type of font - int m_justif; // type of justification (-1,0,1) - char m_name[100]; // name of the button - char m_tooltip[100]; // name of tooltip - bool m_bFocus; - bool m_bCapture; - - bool m_bGlint; - Math::Point m_glintCorner1; - Math::Point m_glintCorner2; - float m_glintProgress; - Math::Point m_glintMouse; + Gfx::CEngine* m_engine; + CEventQueue* m_event; + CRobotMain* m_main; + Gfx::CParticle* m_particle; + CSoundInterface* m_sound; + + Math::Point m_pos; // corner upper / left + Math::Point m_dim; // dimensions + int m_icon; + EventType m_eventType; // message to send when clicking + int m_state; // states (STATE_ *) + float m_fontSize; // size of the button name + float m_fontStretch; // stretch of the font + Gfx::FontType m_fontType; // type of font + Gfx::TextAlign m_textAlign; //type of alignment //comes in the place of m_justif +// int m_justif; // type of justification (-1,0,1) + char m_name[100]; // name of the button + char m_tooltip[100]; // name of tooltip + bool m_bFocus; + bool m_bCapture; + + bool m_bGlint; + Math::Point m_glintCorner1; + Math::Point m_glintCorner2; + float m_glintProgress; + Math::Point m_glintMouse; }; +} -- cgit v1.2.3-1-g7c22