69 lines
2.1 KiB
C++
69 lines
2.1 KiB
C++
#ifndef _CBUTTON_HPP_
|
|
#define _CBUTTON_HPP_
|
|
|
|
/*** SDL Header Files ***/
|
|
#include <SDL.h>
|
|
|
|
/*** Custom Header Files ***/
|
|
#include "cWindow.hpp"
|
|
|
|
#include "GUIHelpers/Enums.hpp"
|
|
#include "GUIHelpers/GUIUtility.hpp"
|
|
#include "../VideoEngine/cSprite.hpp"
|
|
#include "../VideoEngine/cImage.hpp"
|
|
#include "../MathEngine/iVector/iVector2.hpp"
|
|
|
|
/*** DLL Header File ***/
|
|
#include "dllExport.h"
|
|
|
|
/*** Custom Header Files ***/
|
|
#include "cLayout.hpp"
|
|
#include "../UtilityEngine/cString.hpp"
|
|
#include "GUIEventEngine/cButtonEvent.hpp"
|
|
|
|
using UtilityEngine::cString;
|
|
|
|
namespace GUIEngine {
|
|
class EXPORT_FROM_MYDLL cButton : public cLayout, public GUIEventEngine::cButtonEvent
|
|
{
|
|
public:
|
|
static const cString sNAME; /*= "button";*/
|
|
|
|
cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign align = sALIGN, const GUIHelpers::eLayout layout = sLAYOUT,
|
|
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
|
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
|
|
virtual ~cButton();
|
|
|
|
/// Functions
|
|
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign align = sALIGN, const GUIHelpers::eLayout layout = sLAYOUT,
|
|
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
|
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
|
|
|
|
virtual void Display();
|
|
|
|
virtual void Press();
|
|
|
|
virtual void OnLButtonUp();
|
|
|
|
/// Sets
|
|
|
|
/// Gets
|
|
virtual const GUIHelpers::eType getType() const;
|
|
virtual const GUIHelpers::RGBA& getDebugColour() const;
|
|
|
|
private:
|
|
void GenerateImage();
|
|
void GenerateTexture();
|
|
|
|
private:
|
|
/// Variables
|
|
VideoEngine::cSprite m_sprite;
|
|
|
|
VideoEngine::cImage* mp_texture;/// = nullptr
|
|
VideoEngine::cImage* mp_texturePress;/// = nullptr
|
|
|
|
/// Pointer to the image that will be displayed on the button.
|
|
VideoEngine::cImage** mpp_image;/// = nullptr
|
|
};/// END CLASS DEFINITION cButton
|
|
}/// END NAMESPACE DEFINITION GUIEngine
|
|
#endif/// END IFNDEF _CBUTTON_HPP_
|