-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcurses-menu.h
63 lines (51 loc) · 1.1 KB
/
curses-menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef CURSES_MENU_H_
#define CURSES_MENU_H_
#include <menu.h>
#include <string>
#include <vector>
#include "utils.h"
using std::string;
using std::vector;
class Menu {
public:
Menu(const string& name, int xloc);
~Menu();
void AddMenuItem(const string& item);
void Display();
string SelectedItem();
void StopDisplaying();
vector<string> Items() { return item_strings_; }
int Location() { return xloc_; }
string Name() { return name_; }
MENU* MenuObject() { return menu_; }
private:
ITEM** items_;
MENU* menu_;
WINDOW* frill_window_;
WINDOW* text_window_;
vector<string> item_strings_;
int xloc_;
string name_;
int fg_color_;
int bg_color_;
bool displaying_;
};
class MenuBar {
public:
MenuBar();
~MenuBar();
void DrawMenuBar();
Menu* AddMenu(const string& menu_name);
void ShowCurrentMenu();
void HideCurrentMenu();
void SendEventToMenu(int c);
void ShowNextMenu();
void ShowPreviousMenu();
string SelectedItem();
private:
int space_between_menus_;
vector<Menu*> menus_;
int current_menu_;
int current_loc_;
};
#endif // CURSES_MENU_H_