diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 24 | ||||
-rw-r--r-- | scene/gui/graph_edit.cpp | 34 | ||||
-rw-r--r-- | scene/gui/graph_node.cpp | 8 | ||||
-rw-r--r-- | scene/gui/graph_node.h | 4 | ||||
-rw-r--r-- | scene/gui/item_list.cpp | 8 | ||||
-rw-r--r-- | scene/gui/item_list.h | 2 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 48 | ||||
-rw-r--r-- | scene/gui/line_edit.h | 4 | ||||
-rw-r--r-- | scene/gui/scroll_container.cpp | 6 | ||||
-rw-r--r-- | scene/gui/scroll_container.h | 2 | ||||
-rw-r--r-- | scene/gui/spin_box.cpp | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 6 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 30 | ||||
-rw-r--r-- | scene/gui/tree.h | 6 | ||||
-rw-r--r-- | scene/gui/video_player.cpp | 6 | ||||
-rw-r--r-- | scene/gui/video_player.h | 2 |
16 files changed, 96 insertions, 96 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 2d5b54257a..2c01a0e2d1 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -49,7 +49,7 @@ Variant Control::edit_get_state() const { Dictionary s; s["rect"] = get_rect(); - s["rot"] = get_rotation(); + s["rotation"] = get_rotation(); s["scale"] = get_scale(); Array anchors; anchors.push_back(get_anchor(MARGIN_LEFT)); @@ -66,7 +66,7 @@ void Control::edit_set_state(const Variant &p_state) { Rect2 state = s["rect"]; set_position(state.position); set_size(state.size); - set_rotation(s["rot"]); + set_rotation(s["rotation"]); set_scale(s["scale"]); Array anchors = s["anchors"]; set_anchor(MARGIN_LEFT, anchors[0]); @@ -2477,12 +2477,12 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("get_anchor", "margin"), &Control::get_anchor); ClassDB::bind_method(D_METHOD("set_margin", "margin", "offset"), &Control::set_margin); ClassDB::bind_method(D_METHOD("set_anchor_and_margin", "margin", "anchor", "offset", "push_opposite_anchor"), &Control::set_anchor_and_margin, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("set_begin", "pos"), &Control::set_begin); - ClassDB::bind_method(D_METHOD("set_end", "pos"), &Control::set_end); - ClassDB::bind_method(D_METHOD("set_position", "pos"), &Control::set_position); + ClassDB::bind_method(D_METHOD("set_begin", "position"), &Control::set_begin); + ClassDB::bind_method(D_METHOD("set_end", "position"), &Control::set_end); + ClassDB::bind_method(D_METHOD("set_position", "position"), &Control::set_position); ClassDB::bind_method(D_METHOD("set_size", "size"), &Control::set_size); ClassDB::bind_method(D_METHOD("set_custom_minimum_size", "size"), &Control::set_custom_minimum_size); - ClassDB::bind_method(D_METHOD("set_global_position", "pos"), &Control::set_global_position); + ClassDB::bind_method(D_METHOD("set_global_position", "position"), &Control::set_global_position); ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Control::set_rotation); ClassDB::bind_method(D_METHOD("set_rotation_deg", "degrees"), &Control::set_rotation_deg); // TODO: Obsolete this method (old name) properly (GH-4397) @@ -2560,12 +2560,12 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("get_v_grow_direction"), &Control::get_v_grow_direction); ClassDB::bind_method(D_METHOD("set_tooltip", "tooltip"), &Control::set_tooltip); - ClassDB::bind_method(D_METHOD("get_tooltip", "atpos"), &Control::get_tooltip, DEFVAL(Point2())); + ClassDB::bind_method(D_METHOD("get_tooltip", "at_position"), &Control::get_tooltip, DEFVAL(Point2())); ClassDB::bind_method(D_METHOD("_get_tooltip"), &Control::_get_tooltip); ClassDB::bind_method(D_METHOD("set_default_cursor_shape", "shape"), &Control::set_default_cursor_shape); ClassDB::bind_method(D_METHOD("get_default_cursor_shape"), &Control::get_default_cursor_shape); - ClassDB::bind_method(D_METHOD("get_cursor_shape", "pos"), &Control::get_cursor_shape, DEFVAL(Point2())); + ClassDB::bind_method(D_METHOD("get_cursor_shape", "position"), &Control::get_cursor_shape, DEFVAL(Point2())); ClassDB::bind_method(D_METHOD("set_focus_neighbour", "margin", "neighbour"), &Control::set_focus_neighbour); ClassDB::bind_method(D_METHOD("get_focus_neighbour", "margin"), &Control::get_focus_neighbour); @@ -2583,7 +2583,7 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("set_drag_forwarding", "target"), &Control::set_drag_forwarding); ClassDB::bind_method(D_METHOD("set_drag_preview", "control"), &Control::set_drag_preview); - ClassDB::bind_method(D_METHOD("warp_mouse", "to_pos"), &Control::warp_mouse); + ClassDB::bind_method(D_METHOD("warp_mouse", "to_position"), &Control::warp_mouse); ClassDB::bind_method(D_METHOD("minimum_size_changed"), &Control::minimum_size_changed); @@ -2593,9 +2593,9 @@ void Control::_bind_methods() { BIND_VMETHOD(MethodInfo("_gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); BIND_VMETHOD(MethodInfo(Variant::VECTOR2, "_get_minimum_size")); - BIND_VMETHOD(MethodInfo(Variant::OBJECT, "get_drag_data", PropertyInfo(Variant::VECTOR2, "pos"))); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "can_drop_data", PropertyInfo(Variant::VECTOR2, "pos"), PropertyInfo(Variant::NIL, "data"))); - BIND_VMETHOD(MethodInfo("drop_data", PropertyInfo(Variant::VECTOR2, "pos"), PropertyInfo(Variant::NIL, "data"))); + BIND_VMETHOD(MethodInfo(Variant::OBJECT, "get_drag_data", PropertyInfo(Variant::VECTOR2, "position"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "can_drop_data", PropertyInfo(Variant::VECTOR2, "position"), PropertyInfo(Variant::NIL, "data"))); + BIND_VMETHOD(MethodInfo("drop_data", PropertyInfo(Variant::VECTOR2, "position"), PropertyInfo(Variant::NIL, "data"))); ADD_GROUP("Anchor", "anchor_"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "_set_anchor", "get_anchor", MARGIN_LEFT); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 5b00aab2ef..3ffa6d57a4 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -352,14 +352,14 @@ bool GraphEdit::_filter_input(const Point2 &p_point) { for (int j = 0; j < gn->get_connection_output_count(); j++) { - Vector2 pos = gn->get_connection_output_pos(j) + gn->get_position(); + Vector2 pos = gn->get_connection_output_position(j) + gn->get_position(); if (pos.distance_to(p_point) < grab_r) return true; } for (int j = 0; j < gn->get_connection_input_count(); j++) { - Vector2 pos = gn->get_connection_input_pos(j) + gn->get_position(); + Vector2 pos = gn->get_connection_input_position(j) + gn->get_position(); if (pos.distance_to(p_point) < grab_r) { return true; } @@ -386,7 +386,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) { for (int j = 0; j < gn->get_connection_output_count(); j++) { - Vector2 pos = gn->get_connection_output_pos(j) + gn->get_position(); + Vector2 pos = gn->get_connection_output_position(j) + gn->get_position(); if (pos.distance_to(mpos) < grab_r) { if (valid_left_disconnect_types.has(gn->get_connection_output_type(j))) { @@ -433,7 +433,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) { for (int j = 0; j < gn->get_connection_input_count(); j++) { - Vector2 pos = gn->get_connection_input_pos(j) + gn->get_position(); + Vector2 pos = gn->get_connection_input_position(j) + gn->get_position(); if (pos.distance_to(mpos) < grab_r) { @@ -501,7 +501,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) { if (!connecting_out) { for (int j = 0; j < gn->get_connection_output_count(); j++) { - Vector2 pos = gn->get_connection_output_pos(j) + gn->get_position(); + Vector2 pos = gn->get_connection_output_position(j) + gn->get_position(); int type = gn->get_connection_output_type(j); if ((type == connecting_type || valid_connection_types.has(ConnType(type, connecting_type))) && pos.distance_to(mpos) < grab_r) { @@ -516,7 +516,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) { for (int j = 0; j < gn->get_connection_input_count(); j++) { - Vector2 pos = gn->get_connection_input_pos(j) + gn->get_position(); + Vector2 pos = gn->get_connection_input_position(j) + gn->get_position(); int type = gn->get_connection_input_type(j); if ((type == connecting_type || valid_connection_types.has(ConnType(type, connecting_type))) && pos.distance_to(mpos) < grab_r) { connecting_target = true; @@ -657,9 +657,9 @@ void GraphEdit::_connections_layer_draw() { continue; } - Vector2 frompos = gfrom->get_connection_output_pos(E->get().from_port) + gfrom->get_offset() * zoom; + Vector2 frompos = gfrom->get_connection_output_position(E->get().from_port) + gfrom->get_offset() * zoom; Color color = gfrom->get_connection_output_color(E->get().from_port); - Vector2 topos = gto->get_connection_input_pos(E->get().to_port) + gto->get_offset() * zoom; + Vector2 topos = gto->get_connection_input_position(E->get().to_port) + gto->get_offset() * zoom; Color tocolor = gto->get_connection_input_color(E->get().to_port); _draw_cos_line(connections_layer, frompos, topos, color, tocolor); } @@ -682,9 +682,9 @@ void GraphEdit::_top_layer_draw() { ERR_FAIL_COND(!from); Vector2 pos; if (connecting_out) - pos = from->get_connection_output_pos(connecting_index); + pos = from->get_connection_output_position(connecting_index); else - pos = from->get_connection_input_pos(connecting_index); + pos = from->get_connection_input_position(connecting_index); pos += from->get_position(); Vector2 topos; @@ -733,7 +733,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { just_selected = true; // TODO: Remove local mouse pos hack if/when InputEventMouseMotion is fixed to support floats //drag_accum+=Vector2(mm->get_relative().x,mm->get_relative().y); - drag_accum = get_local_mouse_pos() - drag_origin; + drag_accum = get_local_mouse_position() - drag_origin; for (int i = get_child_count() - 1; i >= 0; i--) { GraphNode *gn = Object::cast_to<GraphNode>(get_child(i)); if (gn && gn->is_selected()) { @@ -750,7 +750,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { } if (mm.is_valid() && box_selecting) { - box_selecting_to = get_local_mouse_pos(); + box_selecting_to = get_local_mouse_position(); box_selecting_rect = Rect2(MIN(box_selecting_from.x, box_selecting_to.x), MIN(box_selecting_from.y, box_selecting_to.y), @@ -810,7 +810,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { if (gn) { Rect2 r = gn->get_rect(); r.size *= zoom; - if (r.has_point(get_local_mouse_pos())) + if (r.has_point(get_local_mouse_position())) gn->set_selected(false); } } @@ -848,7 +848,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { if (gn_selected->is_resizing()) continue; - if (gn_selected->has_point(gn_selected->get_local_mouse_pos())) { + if (gn_selected->has_point(gn_selected->get_local_mouse_position())) { gn = gn_selected; break; } @@ -862,7 +862,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { dragging = true; drag_accum = Vector2(); - drag_origin = get_local_mouse_pos(); + drag_origin = get_local_mouse_position(); just_selected = !gn->is_selected(); if (!gn->is_selected() && !Input::get_singleton()->is_key_pressed(KEY_CONTROL)) { for (int i = 0; i < get_child_count(); i++) { @@ -888,7 +888,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { return; box_selecting = true; - box_selecting_from = get_local_mouse_pos(); + box_selecting_from = get_local_mouse_position(); if (b->get_control()) { box_selection_mode_aditive = true; previus_selected.clear(); @@ -1167,7 +1167,7 @@ void GraphEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("popup_request", PropertyInfo(Variant::VECTOR2, "p_position"))); ADD_SIGNAL(MethodInfo("duplicate_nodes_request")); ADD_SIGNAL(MethodInfo("node_selected", PropertyInfo(Variant::OBJECT, "node"))); - ADD_SIGNAL(MethodInfo("connection_to_empty", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::VECTOR2, "release_pos"))); + ADD_SIGNAL(MethodInfo("connection_to_empty", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); ADD_SIGNAL(MethodInfo("delete_nodes_request")); ADD_SIGNAL(MethodInfo("_begin_node_move")); ADD_SIGNAL(MethodInfo("_end_node_move")); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 26732e070b..7655363631 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -518,7 +518,7 @@ int GraphNode::get_connection_output_count() { return conn_output_cache.size(); } -Vector2 GraphNode::get_connection_input_pos(int p_idx) { +Vector2 GraphNode::get_connection_input_position(int p_idx) { if (connpos_dirty) _connpos_update(); @@ -548,7 +548,7 @@ Color GraphNode::get_connection_input_color(int p_idx) { return conn_input_cache[p_idx].color; } -Vector2 GraphNode::get_connection_output_pos(int p_idx) { +Vector2 GraphNode::get_connection_output_position(int p_idx) { if (connpos_dirty) _connpos_update(); @@ -690,10 +690,10 @@ void GraphNode::_bind_methods() { ClassDB::bind_method(D_METHOD("get_connection_output_count"), &GraphNode::get_connection_output_count); ClassDB::bind_method(D_METHOD("get_connection_input_count"), &GraphNode::get_connection_input_count); - ClassDB::bind_method(D_METHOD("get_connection_output_pos", "idx"), &GraphNode::get_connection_output_pos); + ClassDB::bind_method(D_METHOD("get_connection_output_position", "idx"), &GraphNode::get_connection_output_position); ClassDB::bind_method(D_METHOD("get_connection_output_type", "idx"), &GraphNode::get_connection_output_type); ClassDB::bind_method(D_METHOD("get_connection_output_color", "idx"), &GraphNode::get_connection_output_color); - ClassDB::bind_method(D_METHOD("get_connection_input_pos", "idx"), &GraphNode::get_connection_input_pos); + ClassDB::bind_method(D_METHOD("get_connection_input_position", "idx"), &GraphNode::get_connection_input_position); ClassDB::bind_method(D_METHOD("get_connection_input_type", "idx"), &GraphNode::get_connection_input_type); ClassDB::bind_method(D_METHOD("get_connection_input_color", "idx"), &GraphNode::get_connection_input_color); diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h index a606e47acd..a0840544dd 100644 --- a/scene/gui/graph_node.h +++ b/scene/gui/graph_node.h @@ -138,10 +138,10 @@ public: int get_connection_input_count(); int get_connection_output_count(); - Vector2 get_connection_input_pos(int p_idx); + Vector2 get_connection_input_position(int p_idx); int get_connection_input_type(int p_idx); Color get_connection_input_color(int p_idx); - Vector2 get_connection_output_pos(int p_idx); + Vector2 get_connection_output_position(int p_idx); int get_connection_output_type(int p_idx); Color get_connection_output_color(int p_idx); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 9a605c98f3..74cc09d0a6 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1117,7 +1117,7 @@ void ItemList::_scroll_changed(double) { update(); } -int ItemList::get_item_at_pos(const Point2 &p_pos, bool p_exact) const { +int ItemList::get_item_at_position(const Point2 &p_pos, bool p_exact) const { Vector2 pos = p_pos; Ref<StyleBox> bg = get_stylebox("bg"); @@ -1165,7 +1165,7 @@ bool ItemList::is_pos_at_end_of_items(const Point2 &p_pos) const { String ItemList::get_tooltip(const Point2 &p_pos) const { - int closest = get_item_at_pos(p_pos); + int closest = get_item_at_position(p_pos); if (closest != -1) { if (!items[closest].tooltip_enabled) { @@ -1362,7 +1362,7 @@ void ItemList::_bind_methods() { ClassDB::bind_method(D_METHOD("set_auto_height", "enable"), &ItemList::set_auto_height); ClassDB::bind_method(D_METHOD("has_auto_height"), &ItemList::has_auto_height); - ClassDB::bind_method(D_METHOD("get_item_at_pos", "pos", "exact"), &ItemList::get_item_at_pos, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_item_at_position", "position", "exact"), &ItemList::get_item_at_position, DEFVAL(false)); ClassDB::bind_method(D_METHOD("ensure_current_is_visible"), &ItemList::ensure_current_is_visible); @@ -1395,7 +1395,7 @@ void ItemList::_bind_methods() { BIND_ENUM_CONSTANT(SELECT_MULTI); ADD_SIGNAL(MethodInfo("item_selected", PropertyInfo(Variant::INT, "index"))); - ADD_SIGNAL(MethodInfo("item_rmb_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::VECTOR2, "atpos"))); + ADD_SIGNAL(MethodInfo("item_rmb_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::VECTOR2, "at_position"))); ADD_SIGNAL(MethodInfo("multi_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "selected"))); ADD_SIGNAL(MethodInfo("item_activated", PropertyInfo(Variant::INT, "index"))); diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index 673b7d8956..ccdd705325 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -199,7 +199,7 @@ public: int find_metadata(const Variant &p_metadata) const; virtual String get_tooltip(const Point2 &p_pos) const; - int get_item_at_pos(const Point2 &p_pos, bool p_exact = false) const; + int get_item_at_position(const Point2 &p_pos, bool p_exact = false) const; bool is_pos_at_end_of_items(const Point2 &p_pos) const; void set_icon_scale(real_t p_scale); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 6a5f56c78c..7493ea95a8 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -49,7 +49,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { if (b.is_valid()) { if (b->is_pressed() && b->get_button_index() == BUTTON_RIGHT) { - menu->set_position(get_global_transform().xform(get_local_mouse_pos())); + menu->set_position(get_global_transform().xform(get_local_mouse_position())); menu->set_size(Vector2(1, 1)); menu->popup(); grab_focus(); @@ -186,7 +186,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { cached_width += font->get_char_size(text[i]).width; } - set_cursor_pos(0); + set_cursor_position(0); _text_changed(); } @@ -273,7 +273,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { delete_text(cc, cursor_pos); - set_cursor_pos(cc); + set_cursor_position(cc); } else { undo_text = text; @@ -297,7 +297,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { #ifdef APPLE_STYLE_KEYS if (k->get_command()) { - set_cursor_pos(0); + set_cursor_position(0); } else if (k->get_alt()) { #else @@ -319,10 +319,10 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { cc--; } - set_cursor_pos(cc); + set_cursor_position(cc); } else { - set_cursor_pos(get_cursor_pos() - 1); + set_cursor_position(get_cursor_position() - 1); } shift_selection_check_post(k->get_shift()); @@ -341,7 +341,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { #ifdef APPLE_STYLE_KEYS if (k->get_command()) { - set_cursor_pos(text.length()); + set_cursor_position(text.length()); } else if (k->get_alt()) { #else if (k->get_alt()) { @@ -362,10 +362,10 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { cc++; } - set_cursor_pos(cc); + set_cursor_position(cc); } else { - set_cursor_pos(get_cursor_pos() + 1); + set_cursor_position(get_cursor_position() + 1); } shift_selection_check_post(k->get_shift()); @@ -418,7 +418,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { } else { undo_text = text; - set_cursor_pos(cursor_pos + 1); + set_cursor_position(cursor_pos + 1); delete_char(); } @@ -433,7 +433,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { case KEY_HOME: { shift_selection_check_pre(k->get_shift()); - set_cursor_pos(0); + set_cursor_position(0); shift_selection_check_post(k->get_shift()); } break; case KEY_KP_1: { @@ -446,7 +446,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { case KEY_END: { shift_selection_check_pre(k->get_shift()); - set_cursor_pos(text.length()); + set_cursor_position(text.length()); shift_selection_check_post(k->get_shift()); } break; @@ -546,7 +546,7 @@ void LineEdit::_notification(int p_what) { #endif case NOTIFICATION_RESIZED: { - set_cursor_pos(get_cursor_pos()); + set_cursor_position(get_cursor_position()); } break; case MainLoop::NOTIFICATION_WM_FOCUS_IN: { @@ -742,7 +742,7 @@ void LineEdit::_notification(int p_what) { draw_caret = true; } - Point2 cursor_pos = Point2(get_cursor_pos(), 1) * get_minimum_size().height; + Point2 cursor_pos = Point2(get_cursor_position(), 1) * get_minimum_size().height; OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos); OS::get_singleton()->set_ime_intermediate_text_callback(_ime_text_callback, this); @@ -806,9 +806,9 @@ void LineEdit::undo() { cached_width += font->get_char_size(text[i]).width; if (old_cursor_pos > text.length()) { - set_cursor_pos(text.length()); + set_cursor_position(text.length()); } else { - set_cursor_pos(old_cursor_pos); + set_cursor_position(old_cursor_pos); } _text_changed(); @@ -869,14 +869,14 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { ofs++; } - set_cursor_pos(ofs); + set_cursor_position(ofs); /* int new_cursor_pos=p_x; int charwidth=draw_area->get_font_char_width(' ',0); new_cursor_pos=( ( (new_cursor_pos-2)+ (charwidth/2) ) /charwidth ); if (new_cursor_pos>(int)text.length()) new_cursor_pos=text.length(); - set_cursor_pos(window_pos+new_cursor_pos); */ + set_cursor_position(window_pos+new_cursor_pos); */ } bool LineEdit::cursor_get_blink_enabled() const { @@ -929,7 +929,7 @@ void LineEdit::delete_char() { text.erase(cursor_pos - 1, 1); - set_cursor_pos(get_cursor_pos() - 1); + set_cursor_position(get_cursor_position() - 1); if (cursor_pos == window_pos) { @@ -1011,7 +1011,7 @@ float LineEdit::get_placeholder_alpha() const { return placeholder_alpha; } -void LineEdit::set_cursor_pos(int p_pos) { +void LineEdit::set_cursor_position(int p_pos) { if (p_pos > (int)text.length()) p_pos = text.length(); @@ -1065,7 +1065,7 @@ void LineEdit::set_cursor_pos(int p_pos) { update(); } -int LineEdit::get_cursor_pos() const { +int LineEdit::get_cursor_position() const { return cursor_pos; } @@ -1093,7 +1093,7 @@ void LineEdit::append_at_cursor(String p_text) { String pre = text.substr(0, cursor_pos); String post = text.substr(cursor_pos, text.length() - cursor_pos); text = pre + p_text + post; - set_cursor_pos(cursor_pos + p_text.length()); + set_cursor_position(cursor_pos + p_text.length()); } } @@ -1330,8 +1330,8 @@ void LineEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("get_placeholder"), &LineEdit::get_placeholder); ClassDB::bind_method(D_METHOD("set_placeholder_alpha", "alpha"), &LineEdit::set_placeholder_alpha); ClassDB::bind_method(D_METHOD("get_placeholder_alpha"), &LineEdit::get_placeholder_alpha); - ClassDB::bind_method(D_METHOD("set_cursor_pos", "pos"), &LineEdit::set_cursor_pos); - ClassDB::bind_method(D_METHOD("get_cursor_pos"), &LineEdit::get_cursor_pos); + ClassDB::bind_method(D_METHOD("set_cursor_position", "position"), &LineEdit::set_cursor_position); + ClassDB::bind_method(D_METHOD("get_cursor_position"), &LineEdit::get_cursor_position); ClassDB::bind_method(D_METHOD("set_expand_to_text_length", "enabled"), &LineEdit::set_expand_to_text_length); ClassDB::bind_method(D_METHOD("get_expand_to_text_length"), &LineEdit::get_expand_to_text_length); ClassDB::bind_method(D_METHOD("cursor_set_blink_enabled", "enabled"), &LineEdit::cursor_set_blink_enabled); diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 52a4a29a33..661f9b60b9 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -149,8 +149,8 @@ public: String get_placeholder() const; void set_placeholder_alpha(float p_alpha); float get_placeholder_alpha() const; - void set_cursor_pos(int p_pos); - int get_cursor_pos() const; + void set_cursor_position(int p_pos); + int get_cursor_position() const; void set_max_length(int p_max_length); int get_max_length() const; void append_at_cursor(String p_text); diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index e182e491d3..c71093b947 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -182,7 +182,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) { } } -void ScrollContainer::_update_scrollbar_pos() { +void ScrollContainer::_update_scrollbar_position() { Size2 hmin = h_scroll->get_combined_minimum_size(); Size2 vmin = v_scroll->get_combined_minimum_size(); @@ -205,7 +205,7 @@ void ScrollContainer::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - call_deferred("_update_scrollbar_pos"); + call_deferred("_update_scrollbar_position"); }; if (p_what == NOTIFICATION_SORT_CHILDREN) { @@ -448,7 +448,7 @@ void ScrollContainer::_bind_methods() { ClassDB::bind_method(D_METHOD("is_h_scroll_enabled"), &ScrollContainer::is_h_scroll_enabled); ClassDB::bind_method(D_METHOD("set_enable_v_scroll", "enable"), &ScrollContainer::set_enable_v_scroll); ClassDB::bind_method(D_METHOD("is_v_scroll_enabled"), &ScrollContainer::is_v_scroll_enabled); - ClassDB::bind_method(D_METHOD("_update_scrollbar_pos"), &ScrollContainer::_update_scrollbar_pos); + ClassDB::bind_method(D_METHOD("_update_scrollbar_position"), &ScrollContainer::_update_scrollbar_position); ClassDB::bind_method(D_METHOD("set_h_scroll", "val"), &ScrollContainer::set_h_scroll); ClassDB::bind_method(D_METHOD("get_h_scroll"), &ScrollContainer::get_h_scroll); ClassDB::bind_method(D_METHOD("set_v_scroll", "val"), &ScrollContainer::set_v_scroll); diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h index 9076be0d72..2c5d60de6c 100644 --- a/scene/gui/scroll_container.h +++ b/scene/gui/scroll_container.h @@ -70,7 +70,7 @@ protected: void _scroll_moved(float); static void _bind_methods(); - void _update_scrollbar_pos(); + void _update_scrollbar_position(); public: int get_v_scroll() const; diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index f462989f53..60b6746ae8 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -72,7 +72,7 @@ void SpinBox::_range_click_timeout() { if (!drag.enabled && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) { - bool up = get_local_mouse_pos().y < (get_size().height / 2); + bool up = get_local_mouse_position().y < (get_size().height / 2); set_value(get_value() + (up ? get_step() : -get_step())); if (range_click_timer->is_one_shot()) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index d30e0b9f25..d79ce25344 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1773,7 +1773,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { if (mb->get_button_index() == BUTTON_RIGHT && context_menu_enabled) { - menu->set_position(get_global_transform().xform(get_local_mouse_pos())); + menu->set_position(get_global_transform().xform(get_local_mouse_position())); menu->set_size(Vector2(1, 1)); menu->popup(); grab_focus(); @@ -1844,7 +1844,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { if (k->is_pressed()) { - highlighted_word = get_word_at_pos(get_local_mouse_pos()); + highlighted_word = get_word_at_pos(get_local_mouse_position()); update(); } else { @@ -3499,7 +3499,7 @@ String TextEdit::get_text() { String TextEdit::get_text_for_lookup_completion() { int row, col; - _get_mouse_pos(get_local_mouse_pos(), row, col); + _get_mouse_pos(get_local_mouse_position(), row, col); String longthing; int len = text.size(); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 1aaea98798..8d6eb0f8e2 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1528,7 +1528,7 @@ void Tree::_range_click_timeout() { if (range_item_last && !range_drag_enabled && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) { - Point2 pos = get_local_mouse_pos() - cache.bg->get_offset(); + Point2 pos = get_local_mouse_position() - cache.bg->get_offset(); if (show_column_titles) { pos.y -= _get_title_button_height(); @@ -1676,7 +1676,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_item->select(col); emit_signal("multi_selected", p_item, col, true); if (p_button == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", get_local_mouse_pos()); + emit_signal("item_rmb_selected", get_local_mouse_position()); } //p_item->selected_signal.call(col); @@ -1697,7 +1697,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool select_single_item(p_item, root, col, selected_item, &inrange); if (p_button == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", get_local_mouse_pos()); + emit_signal("item_rmb_selected", get_local_mouse_position()); } } else { @@ -1713,7 +1713,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool } if (p_button == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", get_local_mouse_pos()); + emit_signal("item_rmb_selected", get_local_mouse_position()); } } } @@ -1914,7 +1914,7 @@ void Tree::_text_editor_modal_close() { return; } - if (value_editor->has_point(value_editor->get_local_mouse_pos())) + if (value_editor->has_point(value_editor->get_local_mouse_position())) return; text_editor_enter(text_editor->get_text()); @@ -2470,7 +2470,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { if (cache.click_type == Cache::CLICK_BUTTON) { // make sure in case of wrong reference after reconstructing whole TreeItems - cache.click_item = get_item_at_pos(cache.click_pos); + cache.click_item = get_item_at_position(cache.click_pos); emit_signal("button_pressed", cache.click_item, cache.click_column, cache.click_id); } cache.click_type = Cache::CLICK_NONE; @@ -2530,7 +2530,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { } if (!root || (!root->get_children() && hide_root)) { if (b->get_button_index() == BUTTON_RIGHT && allow_rmb_select) { - emit_signal("empty_tree_rmb_selected", get_local_mouse_pos()); + emit_signal("empty_tree_rmb_selected", get_local_mouse_position()); } break; } @@ -3428,7 +3428,7 @@ TreeItem *Tree::_find_item_at_pos(TreeItem *p_item, const Point2 &p_pos, int &r_ return NULL; } -int Tree::get_column_at_pos(const Point2 &p_pos) const { +int Tree::get_column_at_position(const Point2 &p_pos) const { if (root) { @@ -3454,7 +3454,7 @@ int Tree::get_column_at_pos(const Point2 &p_pos) const { return -1; } -int Tree::get_drop_section_at_pos(const Point2 &p_pos) const { +int Tree::get_drop_section_at_position(const Point2 &p_pos) const { if (root) { @@ -3479,7 +3479,7 @@ int Tree::get_drop_section_at_pos(const Point2 &p_pos) const { return -100; } -TreeItem *Tree::get_item_at_pos(const Point2 &p_pos) const { +TreeItem *Tree::get_item_at_position(const Point2 &p_pos) const { if (root) { @@ -3652,9 +3652,9 @@ void Tree::_bind_methods() { ClassDB::bind_method(D_METHOD("get_edited_column"), &Tree::get_edited_column); ClassDB::bind_method(D_METHOD("get_custom_popup_rect"), &Tree::get_custom_popup_rect); ClassDB::bind_method(D_METHOD("get_item_area_rect", "item", "column"), &Tree::_get_item_rect, DEFVAL(-1)); - ClassDB::bind_method(D_METHOD("get_item_at_pos", "pos"), &Tree::get_item_at_pos); - ClassDB::bind_method(D_METHOD("get_column_at_pos", "pos"), &Tree::get_column_at_pos); - ClassDB::bind_method(D_METHOD("get_drop_section_at_pos", "pos"), &Tree::get_drop_section_at_pos); + ClassDB::bind_method(D_METHOD("get_item_at_position", "position"), &Tree::get_item_at_position); + ClassDB::bind_method(D_METHOD("get_column_at_position", "position"), &Tree::get_column_at_position); + ClassDB::bind_method(D_METHOD("get_drop_section_at_position", "position"), &Tree::get_drop_section_at_position); ClassDB::bind_method(D_METHOD("ensure_cursor_is_visible"), &Tree::ensure_cursor_is_visible); @@ -3680,8 +3680,8 @@ void Tree::_bind_methods() { ADD_SIGNAL(MethodInfo("item_selected")); ADD_SIGNAL(MethodInfo("cell_selected")); ADD_SIGNAL(MethodInfo("multi_selected", PropertyInfo(Variant::OBJECT, "item"), PropertyInfo(Variant::INT, "column"), PropertyInfo(Variant::BOOL, "selected"))); - ADD_SIGNAL(MethodInfo("item_rmb_selected", PropertyInfo(Variant::VECTOR2, "pos"))); - ADD_SIGNAL(MethodInfo("empty_tree_rmb_selected", PropertyInfo(Variant::VECTOR2, "pos"))); + ADD_SIGNAL(MethodInfo("item_rmb_selected", PropertyInfo(Variant::VECTOR2, "position"))); + ADD_SIGNAL(MethodInfo("empty_tree_rmb_selected", PropertyInfo(Variant::VECTOR2, "position"))); ADD_SIGNAL(MethodInfo("item_edited")); ADD_SIGNAL(MethodInfo("item_rmb_edited")); ADD_SIGNAL(MethodInfo("item_custom_button_pressed")); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 5f19558597..e723fa227b 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -525,9 +525,9 @@ protected: public: virtual String get_tooltip(const Point2 &p_pos) const; - TreeItem *get_item_at_pos(const Point2 &p_pos) const; - int get_column_at_pos(const Point2 &p_pos) const; - int get_drop_section_at_pos(const Point2 &p_pos) const; + TreeItem *get_item_at_position(const Point2 &p_pos) const; + int get_column_at_position(const Point2 &p_pos) const; + int get_drop_section_at_position(const Point2 &p_pos) const; void clear(); diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index a92155cc4f..e08d050ca7 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -278,11 +278,11 @@ String VideoPlayer::get_stream_name() const { return stream->get_name(); }; -float VideoPlayer::get_stream_pos() const { +float VideoPlayer::get_stream_position() const { if (playback.is_null()) return 0; - return playback->get_pos(); + return playback->get_position(); }; Ref<Texture> VideoPlayer::get_video_texture() { @@ -327,7 +327,7 @@ void VideoPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_stream_name"), &VideoPlayer::get_stream_name); - ClassDB::bind_method(D_METHOD("get_stream_pos"), &VideoPlayer::get_stream_pos); + ClassDB::bind_method(D_METHOD("get_stream_position"), &VideoPlayer::get_stream_position); ClassDB::bind_method(D_METHOD("set_autoplay", "enabled"), &VideoPlayer::set_autoplay); ClassDB::bind_method(D_METHOD("has_autoplay"), &VideoPlayer::has_autoplay); diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index b78f3aabe7..bea10907bb 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -92,7 +92,7 @@ public: float get_volume_db() const; String get_stream_name() const; - float get_stream_pos() const; + float get_stream_position() const; void set_autoplay(bool p_enable); bool has_autoplay() const; |