![]() |
Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
|
Interface making it possible to dynamically create GUI elements. More...
#include <duckcpp/core/engine/IGUIElementFactory.hpp>
Public Member Functions | |
virtual IGUIElement * | addGUIElement (EGUI_ELEMENT_TYPE type, IGUIElement *parent=0)=0 |
adds an element to the gui environment based on its type id | |
virtual IGUIElement * | addGUIElement (const dcpp::char_kt *typeName, IGUIElement *parent=0)=0 |
adds a GUI element to the GUI Environment based on its type name | |
virtual dcpp::int32_kt | getCreatableGUIElementTypeCount () const =0 |
Get amount of GUI element types this factory is able to create. | |
virtual EGUI_ELEMENT_TYPE | getCreateableGUIElementType (dcpp::int32_kt idx) const =0 |
Get type of a creatable element type. | |
virtual const dcpp::char_kt * | getCreateableGUIElementTypeName (dcpp::int32_kt idx) const =0 |
Get type name of a creatable GUI element type by index. | |
virtual const dcpp::char_kt * | getCreateableGUIElementTypeName (EGUI_ELEMENT_TYPE type) const =0 |
returns type name of a creatable GUI element | |
![]() | |
IReferenceCounted () | |
Constructor. | |
virtual | ~IReferenceCounted () |
Destructor. | |
void | grab () const |
Grabs the object. Increments the reference counter by one. | |
bool | drop () const |
Drops the object. Decrements the reference counter by one. | |
dcpp::int32_kt | getReferenceCount () const |
Get the reference count. | |
const dcpp::char_kt * | getDebugName () const |
Returns the debug name of the object. | |
Additional Inherited Members | |
![]() | |
void | setDebugName (const dcpp::char_kt *newName) |
Sets the debug name of the object. | |
Interface making it possible to dynamically create GUI elements.
To be able to add custom elements to Duckcpp and to make it possible for the scene manager to save and load them, simply implement this interface and register it in your gui environment via IGUIEnvironment::registerGUIElementFactory. Note: When implementing your own element factory, don't call IGUIEnvironment::grab() to increase the reference counter of the environment. This is not necessary because the it will grab() the factory anyway, and otherwise cyclic references will be created.
|
pure virtual |
adds a GUI element to the GUI Environment based on its type name
typeName | Type name of the element to add. |
parent | Parent scene node of the new element, can be null to add it to the root. |
|
pure virtual |
adds an element to the gui environment based on its type id
type | Type of the element to add. |
parent | Parent scene node of the new element, can be null to add to the root. |
|
pure virtual |
Get type of a creatable element type.
idx | Index of the element type in this factory. Must be a value between 0 and getCreatableGUIElementTypeCount() |
|
pure virtual |
Get type name of a creatable GUI element type by index.
idx | Index of the type in this factory. Must be a value between 0 and getCreatableGUIElementTypeCount() |
|
pure virtual |
returns type name of a creatable GUI element
type | Type of GUI element. |