summaryrefslogtreecommitdiff
path: root/scene/gui/popup_menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/popup_menu.cpp')
-rw-r--r--scene/gui/popup_menu.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 46aa0e5054..f3711b86b6 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -3,7 +3,7 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
@@ -168,7 +168,7 @@ void PopupMenu::_activate_submenu(int over) {
Node *n = get_node(items[over].submenu);
ERR_EXPLAIN("item subnode does not exist: " + items[over].submenu);
ERR_FAIL_COND(!n);
- Popup *pm = n->cast_to<Popup>();
+ Popup *pm = Object::cast_to<Popup>(n);
ERR_EXPLAIN("item subnode is not a Popup: " + items[over].submenu);
ERR_FAIL_COND(!pm);
if (pm->is_visible_in_tree())
@@ -187,7 +187,7 @@ void PopupMenu::_activate_submenu(int over) {
pm->set_position(pos);
pm->popup();
- PopupMenu *pum = pm->cast_to<PopupMenu>();
+ PopupMenu *pum = Object::cast_to<PopupMenu>(pm);
if (pum) {
pr.position -= pum->get_global_position();
@@ -395,7 +395,7 @@ void PopupMenu::_notification(int p_what) {
case NOTIFICATION_TRANSLATION_CHANGED: {
for (int i = 0; i < items.size(); i++) {
- items[i].xl_text = XL_MESSAGE(items[i].text);
+ items[i].xl_text = tr(items[i].text);
}
minimum_size_changed();
@@ -513,7 +513,7 @@ void PopupMenu::add_icon_item(const Ref<Texture> &p_icon, const String &p_label,
Item item;
item.icon = p_icon;
item.text = p_label;
- item.xl_text = XL_MESSAGE(p_label);
+ item.xl_text = tr(p_label);
item.accel = p_accel;
item.ID = p_ID;
items.push_back(item);
@@ -523,7 +523,7 @@ void PopupMenu::add_item(const String &p_label, int p_ID, uint32_t p_accel) {
Item item;
item.text = p_label;
- item.xl_text = XL_MESSAGE(p_label);
+ item.xl_text = tr(p_label);
item.accel = p_accel;
item.ID = p_ID;
items.push_back(item);
@@ -534,7 +534,7 @@ void PopupMenu::add_submenu_item(const String &p_label, const String &p_submenu,
Item item;
item.text = p_label;
- item.xl_text = XL_MESSAGE(p_label);
+ item.xl_text = tr(p_label);
item.ID = p_ID;
item.submenu = p_submenu;
items.push_back(item);
@@ -546,7 +546,7 @@ void PopupMenu::add_icon_check_item(const Ref<Texture> &p_icon, const String &p_
Item item;
item.icon = p_icon;
item.text = p_label;
- item.xl_text = XL_MESSAGE(p_label);
+ item.xl_text = tr(p_label);
item.accel = p_accel;
item.ID = p_ID;
item.checkable = true;
@@ -557,7 +557,7 @@ void PopupMenu::add_check_item(const String &p_label, int p_ID, uint32_t p_accel
Item item;
item.text = p_label;
- item.xl_text = XL_MESSAGE(p_label);
+ item.xl_text = tr(p_label);
item.accel = p_accel;
item.ID = p_ID;
item.checkable = true;
@@ -628,7 +628,7 @@ void PopupMenu::set_item_text(int p_idx, const String &p_text) {
ERR_FAIL_INDEX(p_idx, items.size());
items[p_idx].text = p_text;
- items[p_idx].xl_text = XL_MESSAGE(p_text);
+ items[p_idx].xl_text = tr(p_text);
update();
}
@@ -869,7 +869,7 @@ bool PopupMenu::activate_item_by_event(const Ref<InputEvent> &p_event, bool p_fo
if (!n)
continue;
- PopupMenu *pm = n->cast_to<PopupMenu>();
+ PopupMenu *pm = Object::cast_to<PopupMenu>(n);
if (!pm)
continue;
@@ -891,14 +891,14 @@ void PopupMenu::activate_item(int p_item) {
//hide all parent PopupMenue's
Node *next = get_parent();
- PopupMenu *pop = next->cast_to<PopupMenu>();
+ PopupMenu *pop = Object::cast_to<PopupMenu>(next);
while (pop) {
// We close all parents that are chained together,
// with hide_on_item_selection enabled
if ((items[p_item].checkable && hide_on_checkable_item_selection && pop->is_hide_on_checkable_item_selection()) || (!items[p_item].checkable && hide_on_item_selection && pop->is_hide_on_item_selection())) {
pop->hide();
next = next->get_parent();
- pop = next->cast_to<PopupMenu>();
+ pop = Object::cast_to<PopupMenu>(next);
} else {
// Break out of loop when the next parent has
// hide_on_item_selection disabled