From c8286b052764d60df5cfdd8f837463012a7586dc Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Fri, 13 Nov 2015 13:12:13 -0600 Subject: add scroll-select layout - tested for each edge case and generic case --- Layout/LayoutScrollSelect.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Layout/LayoutScrollSelect.h (limited to 'Layout/LayoutScrollSelect.h') 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 + +typedef std::vector 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 -- cgit v1.2.3