2003-11-03 17:22:45 +01:00
|
|
|
/*
|
|
|
|
GUI Object - Button
|
|
|
|
by Gustav Larsson
|
|
|
|
gee@pyro.nu
|
|
|
|
|
|
|
|
--Overview--
|
|
|
|
|
|
|
|
GUI Object representing a simple button
|
|
|
|
|
|
|
|
--More info--
|
|
|
|
|
|
|
|
Check GUI.h
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CButton_H
|
|
|
|
#define CButton_H
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Includes / Compiler directives
|
|
|
|
//--------------------------------------------------------
|
|
|
|
#include "GUI.h"
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Macros
|
|
|
|
//--------------------------------------------------------
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Types
|
|
|
|
//--------------------------------------------------------
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Declarations
|
|
|
|
//--------------------------------------------------------
|
|
|
|
|
2003-11-18 11:00:57 +01:00
|
|
|
/**
|
|
|
|
* Button Settings
|
|
|
|
*/
|
2003-11-03 17:22:45 +01:00
|
|
|
struct SButtonSettings
|
|
|
|
{
|
|
|
|
bool m_Disabled;
|
|
|
|
CStr m_Font;
|
|
|
|
CStr m_Sprite;
|
|
|
|
CStr m_SpriteDisabled;
|
|
|
|
CStr m_SpriteOver;
|
|
|
|
CStr m_SpritePressed;
|
|
|
|
EAlign m_TextAlign;
|
|
|
|
CColor m_TextColor;
|
|
|
|
CColor m_TextColorDisabled;
|
|
|
|
CColor m_TextColorOver;
|
|
|
|
CColor m_TextColorPressed;
|
|
|
|
EValign m_TextValign;
|
|
|
|
CStr m_ToolTip;
|
|
|
|
CStr m_ToolTipStyle;
|
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2003-11-18 11:00:57 +01:00
|
|
|
/**
|
|
|
|
* @author Gustav Larsson
|
|
|
|
*
|
|
|
|
* Button
|
|
|
|
*
|
2003-11-24 03:18:41 +01:00
|
|
|
* @see IGUIObject
|
|
|
|
* @see IGUISettingsObject
|
|
|
|
* @see IGUIButtonBehavior
|
2003-11-18 11:00:57 +01:00
|
|
|
* @see SButtonSettings
|
|
|
|
*/
|
2003-11-24 03:18:41 +01:00
|
|
|
class CButton : public IGUISettingsObject<SButtonSettings>, public IGUIButtonBehavior
|
2003-11-03 17:22:45 +01:00
|
|
|
{
|
|
|
|
GUI_OBJECT(CButton)
|
|
|
|
|
|
|
|
public:
|
|
|
|
CButton();
|
|
|
|
virtual ~CButton();
|
|
|
|
|
2003-11-18 11:00:57 +01:00
|
|
|
/**
|
|
|
|
* Since we're doing multiple inheritance, this is to avoid error message
|
|
|
|
*
|
|
|
|
* @return Settings infos
|
|
|
|
*/
|
2003-11-24 03:18:41 +01:00
|
|
|
virtual map_Settings GetSettingsInfo() const { return IGUISettingsObject<SButtonSettings>::m_SettingsInfo; }
|
2003-11-03 17:22:45 +01:00
|
|
|
|
2003-11-25 04:21:11 +01:00
|
|
|
virtual void ResetStates() { IGUIButtonBehavior::ResetStates(); }
|
|
|
|
|
2003-11-18 11:00:57 +01:00
|
|
|
/**
|
|
|
|
* Handle Messages
|
|
|
|
*
|
|
|
|
* @param Message GUI Message
|
|
|
|
*/
|
2003-11-03 17:22:45 +01:00
|
|
|
virtual void HandleMessage(const EGUIMessage &Message);
|
|
|
|
|
2003-11-18 11:00:57 +01:00
|
|
|
/**
|
|
|
|
* Draws the Button
|
|
|
|
*/
|
2003-11-03 17:22:45 +01:00
|
|
|
virtual void Draw();
|
|
|
|
};
|
|
|
|
|
2003-11-24 18:13:37 +01:00
|
|
|
#endif
|