-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontextmenu.h
More file actions
30 lines (24 loc) · 748 Bytes
/
Copy pathcontextmenu.h
File metadata and controls
30 lines (24 loc) · 748 Bytes
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
#pragma once
#include <GLFW/glfw3.h>
#include "widget.h"
#include "button.h"
class ContextMenu : public Widget {
public:
ContextMenu(Widget* parent);
void render() override;
void position(int x, int y, int width, int height) override;
void addToMenu(icu::UnicodeString name, Button::OnClick onclick);
void addSeparaterToMenu();
void clearMenu();
void recalcButtonTexts();
int x_loc = 0;
int y_loc = 0;
bool is_visible_2 = false; // currently visible
bool is_visible_3 = false; // visible ever (ie, use context menu)
bool on_mouse_button_event(int button, int action, int mods) override;
private:
std::vector<Button*> buttons = {};
std::vector<icu::UnicodeString> buttonTexts = {};
int maxwidth = 0;
int runningypos = 0;
};