Пример #1
0
EditorHelpSearch::EditorHelpSearch(EditorNode *p_editor) {

	editor=p_editor;
	VBoxContainer *vbc = memnew( VBoxContainer );
	add_child(vbc);
	set_child_rect(vbc);
	HBoxContainer *sb_hb = memnew( HBoxContainer);
	search_box = memnew( LineEdit );
	sb_hb->add_child(search_box);
	search_box->set_h_size_flags(SIZE_EXPAND_FILL);
	Button *sb = memnew( Button("Search"));
	sb->connect("pressed",this,"_update_search");
	sb_hb->add_child(sb);
	vbc->add_margin_child("Search:",sb_hb);
	search_box->connect("text_changed",this,"_text_changed");
	search_box->connect("input_event",this,"_sbox_input");
	search_options = memnew( Tree );
	vbc->add_margin_child("Matches:",search_options,true);
	get_ok()->set_text("View");
	get_ok()->set_disabled(true);
	register_text_enter(search_box);
	set_hide_on_ok(false);
	search_options->connect("item_activated",this,"_confirmed");
	set_title("Search Classes");
//	search_options->set_hide_root(true);

}
VisualScriptPropertySelector::VisualScriptPropertySelector() {

	VBoxContainer *vbc = memnew(VBoxContainer);
	add_child(vbc);
	//set_child_rect(vbc);
	search_box = memnew(LineEdit);
	vbc->add_margin_child(TTR("Search:"), search_box);
	search_box->connect("text_changed", this, "_text_changed");
	search_box->connect("gui_input", this, "_sbox_input");
	search_options = memnew(Tree);
	vbc->add_margin_child(TTR("Matches:"), search_options, true);
	get_ok()->set_text(TTR("Open"));
	get_ok()->set_disabled(true);
	register_text_enter(search_box);
	set_hide_on_ok(false);
	search_options->connect("item_activated", this, "_confirmed");
	search_options->connect("cell_selected", this, "_item_selected");
	search_options->set_hide_root(true);
	search_options->set_hide_folding(true);
	virtuals_only = false;
	seq_connect = false;
	help_bit = memnew(EditorHelpBit);
	vbc->add_margin_child(TTR("Description:"), help_bit);
	help_bit->connect("request_hide", this, "_closed");
	search_options->set_columns(3);
	search_options->set_column_expand(1, false);
	search_options->set_column_expand(2, false);
}
Пример #3
0
CreateDialog::CreateDialog() {

	set_resizable(true);

	HSplitContainer *hbc = memnew(HSplitContainer);

	add_child(hbc);

	VBoxContainer *lvbc = memnew(VBoxContainer);
	hbc->add_child(lvbc);
	lvbc->set_custom_minimum_size(Size2(150, 0) * EDSCALE);

	favorites = memnew(Tree);
	lvbc->add_margin_child(TTR("Favorites:"), favorites, true);
	favorites->set_hide_root(true);
	favorites->set_hide_folding(true);
	favorites->connect("cell_selected", this, "_favorite_selected");
	favorites->connect("item_activated", this, "_favorite_activated");
	favorites->set_drag_forwarding(this);

	recent = memnew(Tree);
	lvbc->add_margin_child(TTR("Recent:"), recent, true);
	recent->set_hide_root(true);
	recent->set_hide_folding(true);
	recent->connect("cell_selected", this, "_history_selected");
	recent->connect("item_activated", this, "_history_activated");

	VBoxContainer *vbc = memnew(VBoxContainer);
	hbc->add_child(vbc);
	vbc->set_h_size_flags(SIZE_EXPAND_FILL);
	HBoxContainer *search_hb = memnew(HBoxContainer);
	search_box = memnew(LineEdit);
	search_box->set_h_size_flags(SIZE_EXPAND_FILL);
	search_hb->add_child(search_box);
	favorite = memnew(Button);
	favorite->set_toggle_mode(true);
	search_hb->add_child(favorite);
	favorite->connect("pressed", this, "_favorite_toggled");
	vbc->add_margin_child(TTR("Search:"), search_hb);
	search_box->connect("text_changed", this, "_text_changed");
	search_box->connect("gui_input", this, "_sbox_input");
	search_options = memnew(Tree);
	vbc->add_margin_child(TTR("Matches:"), search_options, true);
	get_ok()->set_text(TTR("Create"));
	get_ok()->set_disabled(true);
	register_text_enter(search_box);
	set_hide_on_ok(false);
	search_options->connect("item_activated", this, "_confirmed");
	search_options->connect("cell_selected", this, "_item_selected");
	//search_options->set_hide_root(true);
	base_type = "Object";

	help_bit = memnew(EditorHelpBit);
	vbc->add_margin_child(TTR("Description:"), help_bit);
	help_bit->connect("request_hide", this, "_closed");
}
Пример #4
0
GotoLineDialog::GotoLineDialog() {

	set_title("Go to Line");
	Label *l = memnew(Label);
	l->set_text("Line Number:");
	l->set_pos(Point2(5,5));
	add_child(l);

	line = memnew( LineEdit );
	line->set_anchor( MARGIN_RIGHT, ANCHOR_END );
	line->set_begin( Point2(15,22) );
	line->set_end( Point2(15,35) );
	add_child(line);
	register_text_enter(line);
	text_editor=NULL;

	set_hide_on_ok(false);
}
Пример #5
0
EditorQuickOpen::EditorQuickOpen() {


    VBoxContainer *vbc = memnew( VBoxContainer );
    add_child(vbc);
    set_child_rect(vbc);
    search_box = memnew( LineEdit );
    vbc->add_margin_child("Search:",search_box);
    search_box->connect("text_changed",this,"_text_changed");
    search_box->connect("input_event",this,"_sbox_input");
    search_options = memnew( Tree );
    vbc->add_margin_child("Matches:",search_options,true);
    get_ok()->set_text("Open");
    get_ok()->set_disabled(true);
    register_text_enter(search_box);
    set_hide_on_ok(false);
    search_options->connect("item_activated",this,"_confirmed");
    search_options->set_hide_root(true);
}
Пример #6
0
CreateDialog::CreateDialog() {


    VBoxContainer *vbc = memnew( VBoxContainer );
    add_child(vbc);
    set_child_rect(vbc);
    search_box = memnew( LineEdit );
    vbc->add_margin_child(TTR("Search:"),search_box);
    search_box->connect("text_changed",this,"_text_changed");
    search_box->connect("input_event",this,"_sbox_input");
    search_options = memnew( Tree );
    vbc->add_margin_child(TTR("Matches:"),search_options,true);
    get_ok()->set_text(TTR("Create"));
    get_ok()->set_disabled(true);
    register_text_enter(search_box);
    set_hide_on_ok(false);
    search_options->connect("item_activated",this,"_confirmed");
//	search_options->set_hide_root(true);
    base_type="Object";

}
Пример #7
0
GotoLineDialog::GotoLineDialog() {

	set_title(TTR("Go to Line"));

	VBoxContainer *vbc = memnew(VBoxContainer);
	vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 8 * EDSCALE);
	vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 8 * EDSCALE);
	vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -8 * EDSCALE);
	vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -8 * EDSCALE);
	add_child(vbc);

	Label *l = memnew(Label);
	l->set_text(TTR("Line Number:"));
	vbc->add_child(l);

	line = memnew(LineEdit);
	vbc->add_child(line);
	register_text_enter(line);
	text_editor = NULL;

	set_hide_on_ok(false);
}
Пример #8
0
EditorHelpIndex::EditorHelpIndex() {

	VBoxContainer *vbc = memnew( VBoxContainer );
	add_child(vbc);
	set_child_rect(vbc);

	search_box = memnew( LineEdit );
	vbc->add_margin_child(TTR("Search:"), search_box);
	search_box->set_h_size_flags(SIZE_EXPAND_FILL);

	register_text_enter(search_box);

	search_box->connect("text_changed", this, "_text_changed");
	search_box->connect("input_event", this, "_sbox_input");

	class_list = memnew( Tree );
	vbc->add_margin_child(TTR("Class List:")+" ", class_list, true);
	class_list->set_v_size_flags(SIZE_EXPAND_FILL);

	class_list->connect("item_activated",this,"_tree_item_selected");

	get_ok()->set_text(TTR("Open"));
}
Пример #9
0
CreateDialog::CreateDialog() {

	is_replace_mode = false;

	set_resizable(true);

	HSplitContainer *hsc = memnew(HSplitContainer);
	add_child(hsc);

	VSplitContainer *vsc = memnew(VSplitContainer);
	hsc->add_child(vsc);

	VBoxContainer *fav_vb = memnew(VBoxContainer);
	vsc->add_child(fav_vb);
	fav_vb->set_custom_minimum_size(Size2(150, 100) * EDSCALE);
	fav_vb->set_v_size_flags(SIZE_EXPAND_FILL);

	favorites = memnew(Tree);
	fav_vb->add_margin_child(TTR("Favorites:"), favorites, true);
	favorites->set_hide_root(true);
	favorites->set_hide_folding(true);
	favorites->connect("cell_selected", this, "_favorite_selected");
	favorites->connect("item_activated", this, "_favorite_activated");
	favorites->set_drag_forwarding(this);

	VBoxContainer *rec_vb = memnew(VBoxContainer);
	vsc->add_child(rec_vb);
	rec_vb->set_custom_minimum_size(Size2(150, 100) * EDSCALE);
	rec_vb->set_v_size_flags(SIZE_EXPAND_FILL);

	recent = memnew(Tree);
	rec_vb->add_margin_child(TTR("Recent:"), recent, true);
	recent->set_hide_root(true);
	recent->set_hide_folding(true);
	recent->connect("cell_selected", this, "_history_selected");
	recent->connect("item_activated", this, "_history_activated");

	VBoxContainer *vbc = memnew(VBoxContainer);
	hsc->add_child(vbc);
	vbc->set_custom_minimum_size(Size2(300, 0) * EDSCALE);
	vbc->set_h_size_flags(SIZE_EXPAND_FILL);
	HBoxContainer *search_hb = memnew(HBoxContainer);
	search_box = memnew(LineEdit);
	search_box->set_h_size_flags(SIZE_EXPAND_FILL);
	search_hb->add_child(search_box);
	favorite = memnew(Button);
	favorite->set_flat(true);
	favorite->set_toggle_mode(true);
	search_hb->add_child(favorite);
	favorite->connect("pressed", this, "_favorite_toggled");
	vbc->add_margin_child(TTR("Search:"), search_hb);
	search_box->connect("text_changed", this, "_text_changed");
	search_box->connect("gui_input", this, "_sbox_input");
	search_options = memnew(Tree);
	vbc->add_margin_child(TTR("Matches:"), search_options, true);
	get_ok()->set_disabled(true);
	register_text_enter(search_box);
	set_hide_on_ok(false);
	search_options->connect("item_activated", this, "_confirmed");
	search_options->connect("cell_selected", this, "_item_selected");
	base_type = "Object";
	preferred_search_result_type = "";

	help_bit = memnew(EditorHelpBit);
	vbc->add_margin_child(TTR("Description:"), help_bit);
	help_bit->connect("request_hide", this, "_closed");

	type_blacklist.insert("PluginScript"); // PluginScript must be initialized before use, which is not possible here
	type_blacklist.insert("ScriptCreateDialog"); // This is an exposed editor Node that doesn't have an Editor prefix.

	EDITOR_DEF("interface/editors/derive_script_globals_by_name", true);
}