ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Menus/UI/UI.h

Committer:
el17ajf
Date:
2019-04-03
Revision:
17:cc448ab7266f
Parent:
16:3f84f2d7b910
Child:
21:62d2b5b73160

File content as of revision 17:cc448ab7266f:

class UI {
public:
    UI();
    ~UI();
    
    void reset();
    void clear();
    
    void drawTitle(const char * text);
    void drawLabel(const char * text);
    bool drawAndCheckButton(const char * text);

    void selectNextButton();
    void selectPreviousButton();
    void pressButton();
    void newLine();

private:
    const int PADDING_X = 3;
    const int PADDING_Y = 3;
    const int LINE_PADDING = 3;
    int nextYPos;
    int nextY();
    int buttonCurrentlySelected;
    int buttonCurrentlyDrawing;
    bool buttonPressedFrame;
};