|
@@ -43,6 +43,7 @@ void EditorHelpSearch::popup(const String& p_term) {
|
|
|
if (p_term!="") {
|
|
|
search_box->set_text(p_term);
|
|
|
search_box->select_all();
|
|
|
+ _update_search();
|
|
|
} else
|
|
|
search_box->clear();
|
|
|
search_box->grab_focus();
|
|
@@ -70,7 +71,6 @@ void EditorHelpSearch::_sbox_input(const InputEvent& p_ie) {
|
|
|
|
|
|
void EditorHelpSearch::_update_search() {
|
|
|
|
|
|
-
|
|
|
search_options->clear();
|
|
|
search_options->set_hide_root(true);
|
|
|
|
|
@@ -249,6 +249,7 @@ void EditorHelpSearch::_confirmed() {
|
|
|
|
|
|
String mdata=ti->get_metadata(0);
|
|
|
emit_signal("go_to_help",mdata);
|
|
|
+ editor->call("_editor_select",3); // in case EditorHelpSearch beeen invoked on top of other editor window
|
|
|
// go to that
|
|
|
hide();
|
|
|
}
|
|
@@ -318,10 +319,14 @@ DocData *EditorHelp::doc=NULL;
|
|
|
|
|
|
void EditorHelp::_unhandled_key_input(const InputEvent& p_ev) {
|
|
|
|
|
|
- if (is_visible() && p_ev.key.mod.control && p_ev.key.scancode==KEY_F) {
|
|
|
+ if (!is_visible())
|
|
|
+ return;
|
|
|
+ if ( p_ev.key.mod.control && p_ev.key.scancode==KEY_F) {
|
|
|
|
|
|
search->grab_focus();
|
|
|
search->select_all();
|
|
|
+ } else if (p_ev.key.mod.shift && p_ev.key.scancode==KEY_F1) {
|
|
|
+ class_search->popup();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -454,9 +459,11 @@ void EditorHelp::_scroll_changed(double p_scroll) {
|
|
|
history[p].scroll=p_scroll;
|
|
|
}
|
|
|
|
|
|
-void EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_vscr) {
|
|
|
+Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_vscr) {
|
|
|
|
|
|
- ERR_FAIL_COND(!doc->class_list.has(p_class));
|
|
|
+ //ERR_FAIL_COND(!doc->class_list.has(p_class));
|
|
|
+ if (!doc->class_list.has(p_class))
|
|
|
+ return ERR_DOES_NOT_EXIST;
|
|
|
|
|
|
|
|
|
if (tree_item_map.has(p_class)) {
|
|
@@ -470,7 +477,7 @@ void EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_vs
|
|
|
description_line=0;
|
|
|
|
|
|
if (p_class==edited_class->get_text())
|
|
|
- return; //already there
|
|
|
+ return OK; //already there
|
|
|
|
|
|
scroll_locked=true;
|
|
|
|
|
@@ -858,13 +865,16 @@ void EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_vs
|
|
|
|
|
|
scroll_locked=false;
|
|
|
|
|
|
+ return OK;
|
|
|
}
|
|
|
|
|
|
-void EditorHelp::_request_help(const String& p_string) {
|
|
|
-
|
|
|
- _goto_desc(p_string);
|
|
|
-
|
|
|
-
|
|
|
+void EditorHelp::_request_help(const String& p_string) {
|
|
|
+ Error err = _goto_desc(p_string);
|
|
|
+ if (err==OK) {
|
|
|
+ editor->call("_editor_select",3);
|
|
|
+ } else {
|
|
|
+ class_search->popup(p_string);
|
|
|
+ }
|
|
|
//100 palabras
|
|
|
}
|
|
|
|