-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.h
executable file
·38 lines (28 loc) · 851 Bytes
/
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
#ifndef MENU_H
#define MENU_H
#include <functional>
#include <memory>
#include <QGraphicsScene>
#include <QPixmap>
#include <QGraphicsPixmapItem>
#include <QGraphicsTextItem>
#include <QRectF>
#include <QFontDatabase>
#include <QString>
#include "button.h"
class Menu : public QGraphicsScene
{
public:
Menu(const char background_path[], const char title_text[]="",
const char confirm_text[]="START", const char cancel_text[]="EXIT",
std::function<void()> start_callback=NULL, std::function<void()> exit_callback=NULL);
public:
static std::string font_family;
private:
std::unique_ptr<QPixmap> image_;
std::unique_ptr<QGraphicsPixmapItem> background_;
std::unique_ptr<QGraphicsTextItem> title_;
std::unique_ptr<Button> confirm_button_;
std::unique_ptr<Button> cancel_button_;
};
#endif // MENU_H