summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/line_edit.cpp2
-rw-r--r--scene/gui/option_button.cpp2
-rw-r--r--scene/gui/popup_menu.cpp6
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/gui/tree.cpp2
5 files changed, 8 insertions, 6 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index d5214a0c1a..30c04608ef 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -1361,7 +1361,7 @@ LineEdit::LineEdit() {
menu->add_item(TTR("Clear"),MENU_CLEAR);
menu->add_separator();
menu->add_item(TTR("Undo"),MENU_UNDO,KEY_MASK_CMD|KEY_Z);
- menu->connect("item_pressed",this,"menu_option");
+ menu->connect("id_pressed",this,"menu_option");
expand_to_text_length=false;
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index 010cacc14b..1b5b21ae92 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -326,7 +326,7 @@ OptionButton::OptionButton() {
popup->hide();
popup->set_as_toplevel(true);
add_child(popup);
- popup->connect("item_pressed", this,"_selected");
+ popup->connect("id_pressed", this,"_selected");
current=-1;
set_text_align(ALIGN_LEFT);
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index c28c1cc61c..34b2675c52 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -912,7 +912,8 @@ void PopupMenu::activate_item(int p_item) {
ERR_FAIL_INDEX(p_item,items.size());
ERR_FAIL_COND(items[p_item].separator);
int id = items[p_item].ID>=0?items[p_item].ID:p_item;
- emit_signal("item_pressed",id);
+ emit_signal("id_pressed",id);
+ emit_signal("index_pressed",p_item);
//hide all parent PopupMenue's
Node *next = get_parent();
@@ -1157,7 +1158,8 @@ void PopupMenu::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") );
ADD_PROPERTYNO( PropertyInfo(Variant::BOOL, "hide_on_item_selection" ), _SCS("set_hide_on_item_selection"), _SCS("is_hide_on_item_selection") );
- ADD_SIGNAL( MethodInfo("item_pressed", PropertyInfo( Variant::INT,"ID") ) );
+ ADD_SIGNAL( MethodInfo("id_pressed", PropertyInfo( Variant::INT,"ID") ) );
+ ADD_SIGNAL( MethodInfo("index_pressed", PropertyInfo( Variant::INT,"index") ) );
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 250efb7dc6..cbc0c283de 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4836,7 +4836,7 @@ TextEdit::TextEdit() {
menu->add_item(TTR("Clear"),MENU_CLEAR);
menu->add_separator();
menu->add_item(TTR("Undo"),MENU_UNDO,KEY_MASK_CMD|KEY_Z);
- menu->connect("item_pressed",this,"menu_option");
+ menu->connect("id_pressed",this,"menu_option");
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index ca0a6d4597..ba22320a22 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -3688,7 +3688,7 @@ Tree::Tree() {
v_scroll->connect("value_changed", this,"_scroll_moved");
text_editor->connect("text_entered", this,"_text_editor_enter");
text_editor->connect("modal_close", this,"_text_editor_modal_close");
- popup_menu->connect("item_pressed", this,"_popup_select");
+ popup_menu->connect("id_pressed", this,"_popup_select");
value_editor->connect("value_changed", this,"_value_editor_changed");
value_editor->set_as_toplevel(true);