115 lines
4.0 KiB
Plaintext
115 lines
4.0 KiB
Plaintext
#ifndef _CWINDOW_HPP_
|
|
#define _CWINDOW_HPP_
|
|
|
|
/*** SDL Header Files ***/
|
|
#include <SDL.h>
|
|
|
|
/*** Custom Header Files ***/
|
|
#include "GUIHelpers/cObject.hpp"
|
|
#include "GUIHelpers/Enums.hpp"
|
|
#include "GUIHelpers/GUIUtility.hpp"
|
|
|
|
/*** DLL Header File ***/
|
|
#include "dllExport.h"
|
|
|
|
/*** Custom Header Files ***/
|
|
#include "../UtilityEngine/cString.hpp"
|
|
|
|
using UtilityEngine::cString;
|
|
|
|
namespace GUIEngine {
|
|
class EXPORT_FROM_MYDLL cWindow : public GUIHelpers::cObject
|
|
{
|
|
public:
|
|
static const UtilityEngine::cString sNAME; /*= "windows";*/
|
|
static GUIHelpers::Position sPOSITION; /*= Position(0, 0);*/
|
|
static GUIHelpers::Size sSIZE; /*= Size(0, 0);*/
|
|
static GUIHelpers::Padding sPADDING; /*= Padding(5, 5, 5, 5);*/
|
|
static GUIHelpers::RGBA sCOLOUR; /*= { 100, 100, 100, 255 };*/
|
|
|
|
static GUIHelpers::eAlign sALIGN; /*= GUIHelpers::eAlign::CENTER;*/
|
|
static GUIHelpers::eLayout sLAYOUT; /*= FILL_PARENT*/
|
|
static GUIHelpers::eOrientation sORIENTATION; /*= GUIHelpers::eOrientation::NONE;*/
|
|
|
|
static unsigned long int sDebug; /*= 0;*/
|
|
|
|
protected:
|
|
cWindow( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, 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 );
|
|
virtual ~cWindow();
|
|
|
|
virtual void Create(cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, 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);
|
|
|
|
public:
|
|
///Functions
|
|
virtual void Display();
|
|
|
|
const bool Inside( const MathEngine::iVector2& location ) const;
|
|
|
|
void AddChild( cWindow* obj );
|
|
|
|
void RemoveChild( cWindow* obj );
|
|
|
|
///Sets
|
|
void setOrientation( const GUIHelpers::eOrientation& orientation = sORIENTATION );
|
|
void setAlign( const GUIHelpers::eAlign& align = sALIGN );
|
|
void setLayout( const GUIHelpers::eLayout& layout = sLAYOUT );
|
|
void setPosition( const GUIHelpers::Position& pos = sPOSITION );
|
|
void setSize( const GUIHelpers::Size& size = sSIZE );
|
|
void setPadding(const GUIHelpers::Padding& padding = sPADDING);
|
|
void setContentSize( const GUIHelpers::Size& content );
|
|
void setName( const cString& name = sNAME );
|
|
|
|
void setParent( cWindow* parent );
|
|
|
|
///Gets
|
|
const GUIHelpers::eOrientation& getOrientation() const;
|
|
const GUIHelpers::eAlign& getAlign() const;
|
|
const GUIHelpers::eLayout& getLayout() const;
|
|
const GUIHelpers::Position& getPosition() const;
|
|
const GUIHelpers::Size& getSize() const;
|
|
const GUIHelpers::Padding& getPadding() const;
|
|
const GUIHelpers::Size& getContentSize() const;
|
|
const cString& getName() const;
|
|
|
|
cWindow* getParent();
|
|
|
|
virtual const GUIHelpers::eType getType() const;
|
|
|
|
virtual void Resize();
|
|
virtual void RebuildLayout(const GUIHelpers::eLayout& layout);
|
|
|
|
virtual void RePos();
|
|
virtual void RebuildPos();
|
|
|
|
virtual const GUIHelpers::RGBA getDebugColour() const;
|
|
|
|
protected:
|
|
std::vector<cWindow*>& getChildren();
|
|
|
|
private:
|
|
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout );
|
|
|
|
void AddSize(int x, int y, GUIHelpers::Size& mySize) const;
|
|
|
|
void DebugDisplay() const;
|
|
|
|
private:
|
|
GUIHelpers::eOrientation m_orientation;// = GUIHelper::eOrientation::NONE;
|
|
GUIHelpers::eAlign m_align;// = GUIHelper::eAlign::CENTER;
|
|
GUIHelpers::eLayout m_layout;// = GUIHelper::eLayout::FILL_PARENT;
|
|
GUIHelpers::Position m_pos;// = POSITION;
|
|
GUIHelpers::Size m_size;// = SIZE;
|
|
GUIHelpers::Padding m_padding;// = PADDING;
|
|
GUIHelpers::Size m_content;// = m_size;
|
|
cString m_name;// = NAME;
|
|
|
|
std::vector<cWindow*> m_children;
|
|
cWindow* mp_parent;// = nullptr;
|
|
};/// END CLASS DEFINITION cBoxSizer
|
|
}/// END NAMESPACE DEFINITION GUIEngine
|
|
#endif/// END IFNDEF _CBOXSIZER_HPP_
|