diff options
author | Mike Fiore <mfiore@multitech.com> | 2015-11-13 13:12:13 -0600 |
---|---|---|
committer | Mike Fiore <mfiore@multitech.com> | 2015-11-13 13:12:13 -0600 |
commit | c8286b052764d60df5cfdd8f837463012a7586dc (patch) | |
tree | 15915dafc2648e8b7442619ae5aefeb903a25da4 /Layout/LayoutScrollSelect.h | |
parent | 7016673d4b4a7d7c7f66612aa6a269397bbc9487 (diff) | |
download | mtdot-box-evb-factory-firmware-c8286b052764d60df5cfdd8f837463012a7586dc.tar.gz mtdot-box-evb-factory-firmware-c8286b052764d60df5cfdd8f837463012a7586dc.tar.bz2 mtdot-box-evb-factory-firmware-c8286b052764d60df5cfdd8f837463012a7586dc.zip |
add scroll-select layout - tested for each edge case and generic case
Diffstat (limited to 'Layout/LayoutScrollSelect.h')
-rw-r--r-- | Layout/LayoutScrollSelect.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Layout/LayoutScrollSelect.h b/Layout/LayoutScrollSelect.h new file mode 100644 index 0000000..4811ae5 --- /dev/null +++ b/Layout/LayoutScrollSelect.h @@ -0,0 +1,40 @@ +#ifndef __LAYOUTSCROLLSELECT_H__ +#define __LAYOUTSCROLLSELECT_H__ + +#include "Layout.h" +#include <vector> + +typedef std::vector<std::string> Items; + +class LayoutScrollSelect : public Layout { + public: + LayoutScrollSelect(DOGS102* lcd, Items items, std::string info1 = "", std::string info2 = ""); + ~LayoutScrollSelect(); + + void display(); + + void scroll(); + std::string select(); + + private: + void increment(size_t& index); + void decrement(size_t& index); + + Label _lSw1; + Label _lSw2; + Label _lInfo1; + Label _lInfo2; + Label _lCursor; + + Field _fItem1; + Field _fItem2; + Field _fItem3; + Field _fItem4; + Field _fItem5; + + Items _items; + size_t _selected; + size_t _size; +}; + +#endif |