2009-04-18 19:00:33 +02:00
|
|
|
/* Copyright (C) 2009 Wildfire Games.
|
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2003-11-03 17:22:45 +01:00
|
|
|
/*
|
|
|
|
GUI Object - Button
|
|
|
|
|
|
|
|
--Overview--
|
|
|
|
|
|
|
|
GUI Object representing a simple button
|
|
|
|
|
|
|
|
--More info--
|
|
|
|
|
|
|
|
Check GUI.h
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#ifndef INCLUDED_CBUTTON
|
|
|
|
#define INCLUDED_CBUTTON
|
2003-11-03 17:22:45 +01:00
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Includes / Compiler directives
|
|
|
|
//--------------------------------------------------------
|
|
|
|
#include "GUI.h"
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Macros
|
|
|
|
//--------------------------------------------------------
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Types
|
|
|
|
//--------------------------------------------------------
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
// Declarations
|
|
|
|
//--------------------------------------------------------
|
|
|
|
|
2003-11-18 11:00:57 +01:00
|
|
|
/**
|
|
|
|
* Button
|
|
|
|
*
|
2003-11-24 03:18:41 +01:00
|
|
|
* @see IGUIObject
|
|
|
|
* @see IGUIButtonBehavior
|
2003-11-18 11:00:57 +01:00
|
|
|
*/
|
2004-05-29 06:06:50 +02:00
|
|
|
class CButton : public IGUIButtonBehavior, public IGUITextOwner
|
2003-11-03 17:22:45 +01:00
|
|
|
{
|
|
|
|
GUI_OBJECT(CButton)
|
|
|
|
|
|
|
|
public:
|
|
|
|
CButton();
|
|
|
|
virtual ~CButton();
|
|
|
|
|
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-12-27 07:26:03 +01:00
|
|
|
virtual void HandleMessage(const SGUIMessage &Message);
|
2003-11-03 17:22:45 +01:00
|
|
|
|
2003-11-18 11:00:57 +01:00
|
|
|
/**
|
|
|
|
* Draws the Button
|
|
|
|
*/
|
2003-11-03 17:22:45 +01:00
|
|
|
virtual void Draw();
|
2004-05-29 06:06:50 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
* Sets up text, should be called every time changes has been
|
|
|
|
* made that can change the visual.
|
|
|
|
*/
|
|
|
|
void SetupText();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Placement of text.
|
|
|
|
*/
|
|
|
|
CPos m_TextPos;
|
2003-11-03 17:22:45 +01:00
|
|
|
};
|
|
|
|
|
2003-11-24 18:13:37 +01:00
|
|
|
#endif
|