-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added template for creating new GUI Object classes
- Loading branch information
1 parent
f8a3a4a
commit 7853d20
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#ifndef SSGUI_TEMPLATE_GUI_OBJECT_HPP | ||
#define SSGUI_TEMPLATE_GUI_OBJECT_HPP | ||
|
||
#include "ssGUI/GUIObjectClasses/Widget.hpp" | ||
|
||
//namespace: ssGUI | ||
namespace ssGUI | ||
{ | ||
/*class: TemplateGUIObject | ||
A template GUI Object. Use this to create new GUI Object Classes. | ||
Variables & Constructor: | ||
============================== C++ ============================== | ||
protected: | ||
================================================================= | ||
============================== C++ ============================== | ||
TemplateGUIObject::TemplateGUIObject() | ||
{ | ||
} | ||
================================================================= | ||
*/ | ||
class TemplateGUIObject : public Widget | ||
{ | ||
private: | ||
TemplateGUIObject& operator=(TemplateGUIObject const& other) = default; | ||
|
||
protected: | ||
TemplateGUIObject(TemplateGUIObject const& other); | ||
|
||
virtual void ConstructRenderInfo() override; | ||
|
||
public: | ||
static const std::string ListenerKey; | ||
|
||
TemplateGUIObject(); | ||
virtual ~TemplateGUIObject() override; | ||
|
||
//function: GetType | ||
//See <Widget::GetType> | ||
virtual ssGUI::Enums::GUIObjectType GetType() const override; | ||
|
||
//function: Clone | ||
//See <Widget::Clone> | ||
virtual TemplateGUIObject* Clone(bool cloneChildren) override; | ||
|
||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "ssGUI/GUIObjectClasses/TemplateGUIObject.hpp" | ||
|
||
namespace ssGUI | ||
{ | ||
TemplateGUIObject::TemplateGUIObject(TemplateGUIObject const& other) : Widget(other) | ||
{ | ||
} | ||
|
||
void TemplateGUIObject::ConstructRenderInfo() | ||
{ | ||
} | ||
|
||
const std::string TemplateGUIObject::ListenerKey = "Template GUI Object"; | ||
|
||
TemplateGUIObject::TemplateGUIObject() | ||
{ | ||
} | ||
|
||
TemplateGUIObject::~TemplateGUIObject() | ||
{ | ||
|
||
} | ||
|
||
ssGUI::Enums::GUIObjectType TemplateGUIObject::GetType() const | ||
{ | ||
return ssGUI::Enums::GUIObjectType::WIDGET; | ||
} | ||
|
||
TemplateGUIObject* TemplateGUIObject::Clone(bool cloneChildren) | ||
{ | ||
ssGUI_LOG_FUNC(); | ||
TemplateGUIObject* temp = new TemplateGUIObject(*this); | ||
CloneExtensionsAndEventCallbacks(temp); | ||
|
||
if(cloneChildren) | ||
{ | ||
if(CloneChildren(this, temp) == nullptr) | ||
return nullptr; | ||
} | ||
|
||
return temp; | ||
} | ||
} |