32 #include "scene/main/node.h" 33 #include "scene/resources/theme.h" 34 #include "scene/main/timer.h" 35 #include "scene/2d/canvas_item.h" 50 OBJ_CATEGORY(
"GUI Nodes");
71 SIZE_EXPAND_FILL=SIZE_EXPAND|SIZE_FILL
101 if (p_a->get_canvas_layer()==p_b->get_canvas_layer())
102 return p_b->is_greater_than(p_a);
104 return p_a->get_canvas_layer() < p_b->get_canvas_layer();
114 AnchorType anchor[4];
115 FocusMode focus_mode;
125 bool pending_min_size_update;
126 Point2 custom_minimum_size;
133 bool modal_exclusive;
137 CursorShape default_cursor;
145 ObjectID modal_prev_focus_owner;
161 void _window_find_focus_neighbour(
const Vector2& p_dir,
Node *p_at,
const Point2* p_points ,
float p_min,
float &r_closest_dist,
Control **r_closest);
162 Control *_get_focus_neighbour(Margin p_margin,
int p_count=0);
165 float _get_parent_range(
int p_idx)
const;
166 float _get_range(
int p_idx)
const;
167 float _s2a(
float p_val, AnchorType p_anchor,
float p_range)
const;
168 float _a2s(
float p_val, AnchorType p_anchor,
float p_range)
const;
169 void _propagate_theme_changed(
Control *p_owner);
171 void _change_notify_margins();
172 void _update_minimum_size();
174 void _update_scroll();
175 void _resize(
const Size2& p_size);
177 void _size_changed();
178 String _get_tooltip()
const;
181 void _set_rotation_deg(
float p_degrees);
182 float _get_rotation_deg()
const;
185 void _modal_stack_remove();
186 void _modal_set_prev_focus_owner(ObjectID p_prev);
196 void _notification(
int p_notification);
199 static void _bind_methods();
209 NOTIFICATION_RESIZED=40,
210 NOTIFICATION_MOUSE_ENTER=41,
211 NOTIFICATION_MOUSE_EXIT=42,
212 NOTIFICATION_FOCUS_ENTER=43,
213 NOTIFICATION_FOCUS_EXIT=44,
214 NOTIFICATION_THEME_CHANGED=45,
215 NOTIFICATION_MODAL_CLOSE=46,
220 virtual Variant edit_get_state()
const;
221 virtual void edit_set_state(
const Variant& p_state);
222 virtual void edit_set_rect(
const Rect2& p_edit_rect);
223 virtual Size2 edit_get_minimum_size()
const;
227 virtual Size2 get_minimum_size()
const;
228 virtual Size2 get_combined_minimum_size()
const;
229 virtual bool has_point(
const Point2& p_point)
const;
230 virtual bool clips_input()
const;
232 virtual bool can_drop_data(
const Point2& p_point,
const Variant& p_data)
const;
233 virtual void drop_data(
const Point2& p_point,
const Variant& p_data);
234 void set_drag_preview(
Control *p_control);
237 void set_custom_minimum_size(
const Size2& p_custom);
238 Size2 get_custom_minimum_size()
const;
240 bool is_window_modal_on_top()
const;
242 Control *get_parent_control()
const;
248 void set_anchor(Margin p_margin,AnchorType p_anchor);
249 void set_anchor_and_margin(Margin p_margin,AnchorType p_anchor,
float p_pos);
251 AnchorType get_anchor(Margin p_margin)
const;
253 void set_margin(Margin p_margin,
float p_value);
255 void set_begin(
const Point2& p_point);
256 void set_end(
const Point2& p_point);
260 float get_margin(Margin p_margin)
const;
264 void set_pos(
const Point2& p_point);
265 void set_size(
const Size2& p_size);
266 void set_global_pos(
const Point2& p_point);
269 Point2 get_global_pos()
const;
270 Size2 get_size()
const;
271 Rect2 get_rect()
const;
272 Rect2 get_global_rect()
const;
275 void set_rotation(
float p_radians);
276 void set_rotation_deg(
float p_degrees);
277 float get_rotation()
const;
278 float get_rotation_deg()
const;
280 void set_scale(
const Vector2& p_scale);
284 void set_area_as_parent_rect(
int p_margin=0);
286 void show_modal(
bool p_exclusive=
false);
291 void set_h_size_flags(
int p_flags);
292 int get_h_size_flags()
const;
294 void set_v_size_flags(
int p_flags);
295 int get_v_size_flags()
const;
297 void set_stretch_ratio(
float p_ratio);
298 float get_stretch_ratio()
const;
300 void minimum_size_changed();
304 void set_focus_mode(FocusMode p_focus_mode);
305 FocusMode get_focus_mode()
const;
306 bool has_focus()
const;
308 void release_focus();
310 Control *find_next_valid_focus()
const;
311 Control *find_prev_valid_focus()
const;
313 void set_focus_neighbour(Margin p_margin,
const NodePath &p_neighbour);
314 NodePath get_focus_neighbour(Margin p_margin)
const;
316 Control *get_focus_owner()
const;
318 void set_ignore_mouse(
bool p_ignore);
319 bool is_ignoring_mouse()
const;
321 void set_stop_mouse(
bool p_stop);
322 bool is_stopping_mouse()
const;
330 void add_color_override(
const StringName& p_name,
const Color& p_color);
331 void add_constant_override(
const StringName& p_name,
int p_constant);
349 void set_tooltip(
const String& p_tooltip);
354 void set_default_cursor_shape(CursorShape p_shape);
355 CursorShape get_default_cursor_shape()
const;
356 virtual CursorShape get_cursor_shape(
const Point2& p_pos=
Point2i())
const;
358 virtual Rect2 get_item_rect()
const;
359 virtual Matrix32 get_transform()
const;
361 bool is_toplevel_control()
const;
363 Size2 get_parent_area_size()
const;
365 void grab_click_focus();
367 void warp_mouse(
const Point2& p_to_pos);
369 virtual bool is_text_field()
const;
371 Control *get_root_parent_control()
const;
378 VARIANT_ENUM_CAST(Control::AnchorType);
379 VARIANT_ENUM_CAST(Control::FocusMode);
380 VARIANT_ENUM_CAST(Control::SizeFlags);
381 VARIANT_ENUM_CAST(Control::CursorShape);
Definition: viewport.h:75
Definition: string_db.h:150
Definition: math_2d.h:369
Definition: math_2d.h:204
Definition: string_db.h:48
Rect2 get_window_rect() const
use with care, as it blocks waiting for the visual server
Definition: control.cpp:1396
Definition: canvas_item.h:87
Definition: hash_map.h:84
Definition: math_2d.h:554