1 | /**************************************************************************/ |
2 | /* menu_bar.h */ |
3 | /**************************************************************************/ |
4 | /* This file is part of: */ |
5 | /* GODOT ENGINE */ |
6 | /* https://godotengine.org */ |
7 | /**************************************************************************/ |
8 | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
9 | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
10 | /* */ |
11 | /* Permission is hereby granted, free of charge, to any person obtaining */ |
12 | /* a copy of this software and associated documentation files (the */ |
13 | /* "Software"), to deal in the Software without restriction, including */ |
14 | /* without limitation the rights to use, copy, modify, merge, publish, */ |
15 | /* distribute, sublicense, and/or sell copies of the Software, and to */ |
16 | /* permit persons to whom the Software is furnished to do so, subject to */ |
17 | /* the following conditions: */ |
18 | /* */ |
19 | /* The above copyright notice and this permission notice shall be */ |
20 | /* included in all copies or substantial portions of the Software. */ |
21 | /* */ |
22 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
23 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
24 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
25 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
26 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
27 | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
28 | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
29 | /**************************************************************************/ |
30 | |
31 | #ifndef MENU_BAR_H |
32 | #define |
33 | |
34 | #include "scene/gui/button.h" |
35 | #include "scene/gui/popup_menu.h" |
36 | |
37 | class : public Control { |
38 | GDCLASS(MenuBar, Control); |
39 | |
40 | Mutex ; |
41 | |
42 | bool = true; |
43 | bool = false; |
44 | bool = true; |
45 | bool = false; |
46 | int = -1; |
47 | |
48 | String ; |
49 | TextDirection = TEXT_DIRECTION_AUTO; |
50 | |
51 | struct { |
52 | String ; |
53 | String ; |
54 | |
55 | Ref<TextLine> ; |
56 | bool = false; |
57 | bool = false; |
58 | |
59 | (const String &p_name) { |
60 | name = p_name; |
61 | text_buf.instantiate(); |
62 | } |
63 | |
64 | () { |
65 | text_buf.instantiate(); |
66 | } |
67 | }; |
68 | Vector<Menu> ; |
69 | HashSet<String> ; |
70 | |
71 | int = -1; |
72 | int = -1; |
73 | int = -1; |
74 | |
75 | Vector2i ; |
76 | Vector2i ; |
77 | ObjectID ; |
78 | |
79 | struct { |
80 | Ref<StyleBox> ; |
81 | Ref<StyleBox> ; |
82 | Ref<StyleBox> ; |
83 | Ref<StyleBox> ; |
84 | Ref<StyleBox> ; |
85 | Ref<StyleBox> ; |
86 | Ref<StyleBox> ; |
87 | Ref<StyleBox> ; |
88 | Ref<StyleBox> ; |
89 | Ref<StyleBox> ; |
90 | |
91 | Ref<Font> ; |
92 | int = 0; |
93 | int = 0; |
94 | Color ; |
95 | |
96 | Color ; |
97 | Color ; |
98 | Color ; |
99 | Color ; |
100 | Color ; |
101 | Color ; |
102 | |
103 | int = 0; |
104 | } ; |
105 | |
106 | int (const Point2 &p_point) const; |
107 | Rect2 (int p_index) const; |
108 | void (int p_index); |
109 | |
110 | void (Menu &); |
111 | void (); |
112 | Vector<PopupMenu *> () const; |
113 | int (PopupMenu *p_child) const; |
114 | |
115 | void (int p_index, bool p_focus_item = false); |
116 | void (bool p_visible); |
117 | void (const String &, PopupMenu *p_child); |
118 | void (); |
119 | void (); |
120 | |
121 | protected: |
122 | virtual void (const Ref<InputEvent> &p_event) override; |
123 | |
124 | void (int p_what); |
125 | virtual void (Node *p_child) override; |
126 | virtual void (Node *p_child) override; |
127 | virtual void (Node *p_child) override; |
128 | static void (); |
129 | |
130 | public: |
131 | virtual void (const Ref<InputEvent> &p_event) override; |
132 | |
133 | void (bool p_enabled); |
134 | bool (); |
135 | void (bool p_disabled); |
136 | |
137 | void (bool p_enabled); |
138 | bool () const; |
139 | |
140 | bool () const; |
141 | |
142 | virtual Size2 () const override; |
143 | |
144 | int () const; |
145 | |
146 | void (TextDirection p_text_direction); |
147 | TextDirection () const; |
148 | |
149 | void (const String &p_language); |
150 | String () const; |
151 | |
152 | void (int p_index); |
153 | int () const; |
154 | |
155 | void (bool p_enabled); |
156 | bool () const; |
157 | |
158 | void (int , const String &p_title); |
159 | String (int ) const; |
160 | |
161 | void (int , const String &p_tooltip); |
162 | String (int ) const; |
163 | |
164 | void (int , bool p_disabled); |
165 | bool (int ) const; |
166 | |
167 | void (int , bool p_hidden); |
168 | bool (int ) const; |
169 | |
170 | PopupMenu *(int ) const; |
171 | |
172 | virtual String (const Point2 &p_pos) const override; |
173 | |
174 | (); |
175 | (); |
176 | }; |
177 | |
178 | #endif // MENU_BAR_H |
179 | |