From ede51c528e5cebc7f1930d5c9da541e7d11c0138 Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Fri, 7 Feb 2014 23:58:09 +0100 Subject: Conditional -> GUIObject and make all gui objects children of GUIObject Signed-off-by: Vojtech Bocek Change-Id: Ic0a7d6354dabe5919b83942f2f1aa0715625e522 --- gui/slider.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gui/slider.cpp') diff --git a/gui/slider.cpp b/gui/slider.cpp index af0c542de..692676561 100644 --- a/gui/slider.cpp +++ b/gui/slider.cpp @@ -27,7 +27,7 @@ extern "C" { #include "rapidxml.hpp" #include "objects.hpp" -GUISlider::GUISlider(xml_node<>* node) +GUISlider::GUISlider(xml_node<>* node) : GUIObject(node) { xml_attribute<>* attr; xml_node<>* child; @@ -93,6 +93,9 @@ GUISlider::~GUISlider() int GUISlider::Render(void) { + if(!isConditionTrue()) + return 0; + if (!sSlider || !sSlider->GetResource()) return -1; @@ -113,6 +116,9 @@ int GUISlider::Render(void) int GUISlider::Update(void) { + if(!isConditionTrue()) + return 0; + if (sUpdate) return 2; return 0; @@ -120,6 +126,9 @@ int GUISlider::Update(void) int GUISlider::NotifyTouch(TOUCH_STATE state, int x, int y) { + if(!isConditionTrue()) + return -1; + static bool dragging = false; switch (state) -- cgit v1.2.3