Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::GUIInterface Class Reference

#include <GUIInterface.h>

+ Inheritance diagram for Divide::GUIInterface:

Public Types

using GUIMap = hashMap< U64, std::pair< GUIElement *, bool > >
 
using ButtonCallback = DELEGATE< void, I64 >
 

Public Member Functions

 GUIInterface (GUI &context)
 
virtual ~GUIInterface ()
 
void onLanguageChange (std::string_view newLanguage)
 
GUIgetParentContext () noexcept
 
const GUIgetParentContext () const noexcept
 
template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * getGUIElement (const U64 elementName) const
 Get a pointer to an element by name/id.
 
template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * getGUIElement (const I64 elementID) const
 
virtual GUITextaddText (const char *name, const RelativePosition2D &position, const string &font, const UColour4 &colour, const string &text, bool multiLine=false, U8 fontSize=16u)
 
virtual GUITextmodifyText (const char *name, const string &text, bool multiLine)
 
virtual GUIMessageBoxaddMsgBox (const char *name, const string &title, const string &message, vec2< I32 > offsetFromCentre=vec2< I32 >(0))
 
virtual GUIButtonaddButton (const char *name, const string &text, const RelativePosition2D &offset, const RelativeScale2D &size, const string &rootSheetID="")
 
virtual GUIFlashaddFlash (const char *name, const RelativePosition2D &position, const RelativeScale2D &size)
 
virtual CEGUI::Window * createWindow (const CEGUI::String &type, const CEGUI::String &name)
 
virtual CEGUI::Window * loadWindowFromLayoutFile (const char *layoutFileName)
 
virtual bool unloadWindow (CEGUI::Window *&window)
 

Protected Member Functions

void addElement (U64 id, GUIElement *element)
 
virtual GUIElementgetGUIElementImpl (U64 elementName, GUIType type) const
 
virtual GUIElementgetGUIElementImpl (I64 elementID, GUIType type) const
 

Protected Attributes

GUI_context
 
std::array< GUIMap, to_base(GUIType::COUNT)> _guiElements
 

Detailed Description

Definition at line 51 of file GUIInterface.h.

Member Typedef Documentation

◆ ButtonCallback

Definition at line 54 of file GUIInterface.h.

◆ GUIMap

using Divide::GUIInterface::GUIMap = hashMap<U64, std::pair<GUIElement*, bool> >

Definition at line 53 of file GUIInterface.h.

Constructor & Destructor Documentation

◆ GUIInterface()

Divide::GUIInterface::GUIInterface ( GUI context)
explicit

Definition at line 22 of file GUIInterface.cpp.

◆ ~GUIInterface()

Divide::GUIInterface::~GUIInterface ( )
virtual

Definition at line 30 of file GUIInterface.cpp.

Member Function Documentation

◆ addButton()

GUIButton * Divide::GUIInterface::addButton ( const char *  name,
const string text,
const RelativePosition2D offset,
const RelativeScale2D size,
const string rootSheetID = "" 
)
virtual

Definition at line 113 of file GUIInterface.cpp.

◆ addElement()

void Divide::GUIInterface::addElement ( U64  id,
GUIElement element 
)
protected

Definition at line 46 of file GUIInterface.cpp.

◆ addFlash()

GUIFlash * Divide::GUIInterface::addFlash ( const char *  name,
const RelativePosition2D position,
const RelativeScale2D size 
)
virtual

Definition at line 190 of file GUIInterface.cpp.

◆ addMsgBox()

GUIMessageBox * Divide::GUIInterface::addMsgBox ( const char *  name,
const string title,
const string message,
vec2< I32 offsetFromCentre = vec2<I32>(0) 
)
virtual

Definition at line 148 of file GUIInterface.cpp.

◆ addText()

GUIText * Divide::GUIInterface::addText ( const char *  name,
const RelativePosition2D position,
const string font,
const UColour4 colour,
const string text,
bool  multiLine = false,
U8  fontSize = 16u 
)
virtual

Definition at line 166 of file GUIInterface.cpp.

◆ createWindow()

CEGUI::Window * Divide::GUIInterface::createWindow ( const CEGUI::String &  type,
const CEGUI::String &  name 
)
virtual

Definition at line 219 of file GUIInterface.cpp.

◆ getGUIElement() [1/2]

template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * Divide::GUIInterface::getGUIElement ( const I64  elementID) const
inline

Definition at line 71 of file GUIInterface.h.

◆ getGUIElement() [2/2]

template<typename T >
requires std::is_base_of_v<GUIElement, T>
T * Divide::GUIInterface::getGUIElement ( const U64  elementName) const
inline

Get a pointer to an element by name/id.

Definition at line 66 of file GUIInterface.h.

◆ getGUIElementImpl() [1/2]

GUIElement * Divide::GUIInterface::getGUIElementImpl ( I64  elementID,
GUIType  type 
) const
protectedvirtual

Definition at line 84 of file GUIInterface.cpp.

◆ getGUIElementImpl() [2/2]

GUIElement * Divide::GUIInterface::getGUIElementImpl ( U64  elementName,
GUIType  type 
) const
protectedvirtual

Definition at line 65 of file GUIInterface.cpp.

◆ getParentContext() [1/2]

const GUI & Divide::GUIInterface::getParentContext ( ) const
inlinenoexcept

Definition at line 63 of file GUIInterface.h.

◆ getParentContext() [2/2]

GUI & Divide::GUIInterface::getParentContext ( )
inlinenoexcept

Definition at line 62 of file GUIInterface.h.

◆ loadWindowFromLayoutFile()

CEGUI::Window * Divide::GUIInterface::loadWindowFromLayoutFile ( const char *  layoutFileName)
virtual

Definition at line 228 of file GUIInterface.cpp.

◆ modifyText()

GUIText * Divide::GUIInterface::modifyText ( const char *  name,
const string text,
bool  multiLine 
)
virtual

Definition at line 202 of file GUIInterface.cpp.

◆ onLanguageChange()

void Divide::GUIInterface::onLanguageChange ( std::string_view  newLanguage)

Definition at line 43 of file GUIInterface.cpp.

◆ unloadWindow()

bool Divide::GUIInterface::unloadWindow ( CEGUI::Window *&  window)
virtual

Definition at line 237 of file GUIInterface.cpp.

Member Data Documentation

◆ _context

GUI* Divide::GUIInterface::_context
protected

Definition at line 110 of file GUIInterface.h.

◆ _guiElements

std::array<GUIMap, to_base(GUIType::COUNT)> Divide::GUIInterface::_guiElements
protected

Definition at line 112 of file GUIInterface.h.


The documentation for this class was generated from the following files: