summaryrefslogtreecommitdiffstats
path: root/Project/Element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project/Element.cpp')
-rw-r--r--Project/Element.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/Project/Element.cpp b/Project/Element.cpp
index 4de5ebd..53eaa26 100644
--- a/Project/Element.cpp
+++ b/Project/Element.cpp
@@ -300,15 +300,15 @@ void Element::SetOnline(bool online)
void Element::GeneralMenuItens(wxMenu& menu)
{
wxMenuItem* clockItem = new wxMenuItem(&menu, ID_ROTATE_CLOCK, _("Rotate clockwise"));
- clockItem->SetBitmap(wxImage("data\\images\\menu\\rotateClock16.png"));
+ clockItem->SetBitmap(wxImage("..\\data\\images\\menu\\rotateClock16.png"));
menu.Append(clockItem);
wxMenuItem* counterClockItem = new wxMenuItem(&menu, ID_ROTATE_COUNTERCLOCK, _("Rotate counter-clockwise"));
- counterClockItem->SetBitmap(wxImage("data\\images\\menu\\rotateCounterClock16.png"));
+ counterClockItem->SetBitmap(wxImage("..\\data\\images\\menu\\rotateCounterClock16.png"));
menu.Append(counterClockItem);
wxMenuItem* deleteItem = new wxMenuItem(&menu, ID_DELETE, _("Delete"));
- deleteItem->SetBitmap(wxImage("data\\images\\menu\\delete16.png"));
+ deleteItem->SetBitmap(wxImage("..\\data\\images\\menu\\delete16.png"));
menu.Append(deleteItem);
}
@@ -456,6 +456,23 @@ void Element::ReplaceParent(Element* oldParent, Element* newParent)
}
}
+void Element::AddChild(Element* child) { m_childList.push_back(child); }
+
+void Element::RemoveChild(Element* child)
+{
+ for(auto it = m_childList.begin(); it != m_childList.end(); ++it) {
+ Element* element = *it;
+ if(element == child) m_childList.erase(it--);
+ }
+}
+
+void Element::ReplaceChild(Element* oldChild, Element* newChild)
+{
+ for(int i = 0; i < (int)m_childList.size(); i++) {
+ if(m_childList[i] == oldChild) m_childList[i] = newChild;
+ }
+}
+
void OpenGLColour::SetRGBA(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
{
rgba[0] = red;