Snoke
menu.h
Go to the documentation of this file.
1 #ifndef MENU_H
2 #define MENU_H
3 #include <ncurses.h>
4 #include <cstring>
5 #include <list>
6 #include "widget.h"
7 
12 class MenuItem : public Widget
13 {
14  private:
15  int x, y, width, height;
16  const char* name;
17 
18  public:
19  void draw();
20  MenuItem(const char* name, int x, int y, int width, int height);
21 };
22 
31 class Menu : public Widget
32 {
33  private:
34  int x, y, width, height;
35 
36  public:
37  using Widget::add;
38  void add(const char* name);
39  void focus(int index);
40  void unfocus(int index);
41  void draw();
42  Menu(int x, int y, int width, int height);
43 };
44 
45 #endif
Definition: menu.h:12
Definition: menu.h:31
int x
Definition: menu.h:15
int width
Definition: menu.h:15
int y
Definition: menu.h:15
MenuItem(const char *name, int x, int y, int width, int height)
Definition: menu.cpp:14
int y
Definition: menu.h:34
int height
Definition: menu.h:15
Definition: widget.h:36
void add(Widget *child)
Definition: widget.cpp:86
const char * name
Definition: menu.h:16
void draw()
Definition: menu.cpp:6