Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Widgets/ContainerWidget.h@13:6714534e7974, 2016-05-21 (annotated)
- Committer:
- duncanFrance
- Date:
- Sat May 21 14:40:09 2016 +0000
- Revision:
- 13:6714534e7974
- Parent:
- 12:63db16fea709
Cleaned up SpinnerWidget; Started on SpinnerDialog - will extract Dialog later
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
duncanFrance | 5:b7ce5721a0b5 | 1 | #ifndef SIMPLEGUI_CONTAINER_WIDGET_H |
duncanFrance | 5:b7ce5721a0b5 | 2 | #define SIMPLEGUI_CONTAINER_WIDGET_H |
duncanFrance | 5:b7ce5721a0b5 | 3 | |
duncanFrance | 5:b7ce5721a0b5 | 4 | #include "Widget.h" |
duncanFrance | 12:63db16fea709 | 5 | #include "Window.h" |
duncanFrance | 5:b7ce5721a0b5 | 6 | |
duncanFrance | 5:b7ce5721a0b5 | 7 | /** |
duncanFrance | 5:b7ce5721a0b5 | 8 | * Simple container hold widgets side-by-side and draws a border |
duncanFrance | 5:b7ce5721a0b5 | 9 | * It will expand as needed to hold the widgets |
duncanFrance | 5:b7ce5721a0b5 | 10 | **/ |
duncanFrance | 12:63db16fea709 | 11 | class ContainerWidget : public Window |
duncanFrance | 5:b7ce5721a0b5 | 12 | { |
duncanFrance | 5:b7ce5721a0b5 | 13 | |
duncanFrance | 5:b7ce5721a0b5 | 14 | public: |
duncanFrance | 5:b7ce5721a0b5 | 15 | |
duncanFrance | 13:6714534e7974 | 16 | enum Layout { VERTICAL_LEFT, VERTICAL_RIGHT, VERTICAL_CENTER, HORIZONTAL, FIXED }; |
duncanFrance | 5:b7ce5721a0b5 | 17 | |
duncanFrance | 12:63db16fea709 | 18 | ContainerWidget(GraphicsContext *context); |
duncanFrance | 12:63db16fea709 | 19 | |
duncanFrance | 12:63db16fea709 | 20 | /** |
duncanFrance | 12:63db16fea709 | 21 | * Overrides |
duncanFrance | 12:63db16fea709 | 22 | **/ |
duncanFrance | 12:63db16fea709 | 23 | virtual void setSize(int width, int height); |
duncanFrance | 13:6714534e7974 | 24 | virtual void attach(Widget *child); |
duncanFrance | 5:b7ce5721a0b5 | 25 | |
duncanFrance | 12:63db16fea709 | 26 | void setLayout(Layout l); |
duncanFrance | 5:b7ce5721a0b5 | 27 | |
duncanFrance | 5:b7ce5721a0b5 | 28 | protected: |
duncanFrance | 5:b7ce5721a0b5 | 29 | |
duncanFrance | 12:63db16fea709 | 30 | int _minWidth, _minHeight; |
duncanFrance | 12:63db16fea709 | 31 | Layout _layout; |
duncanFrance | 12:63db16fea709 | 32 | |
duncanFrance | 12:63db16fea709 | 33 | /** |
duncanFrance | 12:63db16fea709 | 34 | * Override |
duncanFrance | 12:63db16fea709 | 35 | **/ |
duncanFrance | 12:63db16fea709 | 36 | virtual void _adjust(); |
duncanFrance | 9:616a9686d5db | 37 | |
duncanFrance | 5:b7ce5721a0b5 | 38 | }; |
duncanFrance | 5:b7ce5721a0b5 | 39 | |
duncanFrance | 5:b7ce5721a0b5 | 40 | #endif |