@@ -34,6 +34,15 @@ bool CheckBox::isChecked()
return _checked;
}
+void CheckBox::setChecked(bool checked)
+{
+ if (_checked != checked)
+ {
+ _checked = checked;
+ notifyListeners(Control::Listener::VALUE_CHANGED);
+ }
+}
+
void CheckBox::setImageSize(float width, float height)
{
_imageSize.set(width, height);
@@ -37,6 +37,8 @@ public:
*/
bool isChecked();
+ void setChecked(bool checked);
/**
* Set the size to draw the checkbox icon.
*
@@ -130,6 +130,12 @@ bool Slider::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contac
_dirty = true;
+ if (evt == Touch::TOUCH_RELEASE)
+ _state = NORMAL;
+ break;
return Control::touchEvent(evt, x, y, contactIndex);
@@ -44,9 +44,7 @@ namespace gameplay
void VerticalLayout::update(const Container* container)
// Need border, padding.
- //Theme::Style* style = container->getStyle();
Theme::Border border = container->getBorder(container->getState());
- //Theme::Padding padding = style->getPadding();
Theme::Padding padding = container->getPadding();
float yPosition = 0;