yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
ui_events.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_EVENTS_UI_EVENTS_H_
2#define YAZE_APP_EDITOR_EVENTS_UI_EVENTS_H_
3
5#include <string>
6
7namespace yaze::editor {
8
9struct StatusUpdateEvent : public Event {
10 enum class Type {
11 Cursor,
13 Zoom,
14 Mode,
15 Message,
16 Clear
17 };
18
20 std::string text; // For Mode, Message
21 int x = 0, y = 0; // For Cursor
22 int count = 0, width = 0, height = 0; // For Selection
23 float zoom = 1.0f; // For Zoom
24 std::string key; // For Custom Segments
25
26 // Helpers for construction
27 static StatusUpdateEvent Cursor(int x, int y, const std::string& label = "Pos") {
30 e.x = x; e.y = y;
31 e.text = label;
32 return e;
33 }
34
35 static StatusUpdateEvent Selection(int count, int width = 0, int height = 0) {
38 e.count = count;
39 e.width = width;
40 e.height = height;
41 return e;
42 }
43
46 e.type = Type::Clear;
47 return e;
48 }
49};
50
51struct PanelToggleEvent : public Event {
52 std::string panel_id;
53 bool visible;
54};
55
56} // namespace yaze::editor
57
58#endif // YAZE_APP_EDITOR_EVENTS_UI_EVENTS_H_
Editors are the view controllers for the application.
Definition agent_chat.cc:23
static StatusUpdateEvent Selection(int count, int width=0, int height=0)
Definition ui_events.h:35
static StatusUpdateEvent ClearAll()
Definition ui_events.h:44
static StatusUpdateEvent Cursor(int x, int y, const std::string &label="Pos")
Definition ui_events.h:27