Foundation classes for a basic GUI implementing simple widgets and events. (Fork for custom changes.)
Fork of SimpleGUI by
Diff: Widgets/SpinnerWidget.cpp
- Revision:
- 11:b485561aa112
- Child:
- 12:63db16fea709
diff -r e9d13e3a9d4f -r b485561aa112 Widgets/SpinnerWidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Widgets/SpinnerWidget.cpp Fri Apr 22 16:12:42 2016 +0000 @@ -0,0 +1,54 @@ +#include "SpinnerWidget.h" + +#include"resources/spinner-upArrow.bmp" +#include"resources/spinner-downArrow.bmp" + +SpinnerWidget::SpinnerWidget(GUI* gui) : ContainerWidget(gui), + _upArrow(gui), _downArrow(gui), _text(gui), _min(0), _max(0), _increment(1), _value(0) +{ + _upArrow.setBitmap(spinner_upArrow_bmp); + _upArrow.setSize(10,10); + + _downArrow.setBitmap(spinner_downArrow_bmp); + _downArrow.setSize(10,10); + + _text.setSize(gui->defaultFont()->width() * 4, gui->defaultFont()->height()); + + append(_upArrow); + append(_downArrow); + append(_text); + +} + +void SpinnerWidget::setMin(float min) +{ +} + +void SpinnerWidget::setMax(float max) +{ +} + +void SpinnerWidget::setIncrement(float increment) +{ +} + +void SpinnerWidget::setValue(float value) +{ +} + +void SpinnerWidget::getValue() +{ +} + +template<typename T> +void SpinnerWidget::onChange(T* tptr, void (T::*mptr)(SpinnerWidget*)) +{ + _onChange.attach(tptr, mptr); +} + + +void SpinnerWidget::_onUpClick() { +} + +void SpinnerWidget::_onDownClick() { +} \ No newline at end of file