本文整理汇总了C++中set_hide_on_ok函数的典型用法代码示例。如果您正苦于以下问题:C++ set_hide_on_ok函数的具体用法?C++ set_hide_on_ok怎么用?C++ set_hide_on_ok使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_hide_on_ok函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: NewProjectDialog
NewProjectDialog() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
set_child_rect(vb);
Label* l = memnew(Label);
l->set_text("Project Path:");
vb->add_child(l);
pp=l;
project_path = memnew( LineEdit );
MarginContainer *mc = memnew( MarginContainer );
vb->add_child(mc);
HBoxContainer *pphb = memnew( HBoxContainer );
mc->add_child(pphb);
pphb->add_child(project_path);
project_path->set_h_size_flags(SIZE_EXPAND_FILL);
Button* browse = memnew( Button );
pphb->add_child(browse);
browse->set_text("Browse");
browse->connect("pressed", this,"_browse_path");
l = memnew(Label);
l->set_text("Project Name:");
l->set_pos(Point2(5,50));
vb->add_child(l);
pn=l;
project_name = memnew( LineEdit );
mc = memnew( MarginContainer );
vb->add_child(mc);
mc->add_child(project_name);
project_name->set_text("New Game Project");
l = memnew(Label);
l->set_text("That's a BINGO!");
vb->add_child(l);
error=l;
l->add_color_override("font_color",Color(1,0.4,0.3,0.8));
l->set_align(Label::ALIGN_CENTER);
get_ok()->set_text("Create");
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
project_path->set_text(d->get_current_dir());
memdelete(d);
fdialog = memnew( FileDialog );
add_child(fdialog);
fdialog->set_access(FileDialog::ACCESS_FILESYSTEM);
project_name->connect("text_changed", this,"_text_changed");
project_path->connect("text_changed", this,"_path_text_changed");
fdialog->connect("dir_selected", this,"_path_selected");
fdialog->connect("file_selected", this,"_file_selected");
set_hide_on_ok(false);
import_mode=false;
}
开发者ID:0871087123,项目名称:godot,代码行数:60,代码来源:project_manager.cpp
示例2: memnew
OrphanResourcesDialog::OrphanResourcesDialog(){
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
files = memnew( Tree );
files->set_columns(2);
files->set_column_titles_visible(true);
files->set_column_min_width(1,100);
files->set_column_expand(0,true);
files->set_column_expand(1,false);
files->set_column_title(0,"Resource");
files->set_column_title(1,TTR("Owns"));
files->set_hide_root(true);
vbc->add_margin_child(TTR("Resources Without Explicit Ownership:"),files,true);
set_title(TTR("Orphan Resource Explorer"));
delete_confirm = memnew( ConfirmationDialog );
delete_confirm->set_text(TTR("Delete selected files?"));
get_ok()->set_text(TTR("Delete"));
add_child(delete_confirm);
dep_edit = memnew( DependencyEditor );
add_child(dep_edit);
files->connect("button_pressed",this,"_button_pressed");
delete_confirm->connect("confirmed",this,"_delete_confirm");
set_hide_on_ok(false);
}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:27,代码来源:dependency_editor.cpp
示例3: memnew
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);
}
开发者ID:UgisBrekis,项目名称:godot,代码行数:28,代码来源:visual_script_property_selector.cpp
示例4: memnew
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);
}
开发者ID:HiddenDark,项目名称:godot,代码行数:27,代码来源:editor_help.cpp
示例5: EditorMeshImportDialog
EditorMeshImportDialog(EditorMeshImportPlugin *p_plugin) {
plugin=p_plugin;
set_title(TTR("Single Mesh Import"));
set_hide_on_ok(false);
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
//set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer );
vbc->add_margin_child(TTR("Source Mesh(es):"),hbc);
import_path = memnew( LineEdit );
import_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(import_path);
Button * import_choose = memnew( Button );
import_choose->set_text(" .. ");
hbc->add_child(import_choose);
import_choose->connect("pressed", this,"_browse");
hbc = memnew( HBoxContainer );
vbc->add_margin_child(TTR("Target Path:"),hbc);
save_path = memnew( LineEdit );
save_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(save_path);
Button * save_choose = memnew( Button );
save_choose->set_text(" .. ");
hbc->add_child(save_choose);
save_choose->connect("pressed", this,"_browse_target");
file_select = memnew( EditorFileDialog );
file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
file_select->set_mode(EditorFileDialog::MODE_OPEN_FILES);
file_select->add_filter("*.obj ; Wavefront OBJ");
add_child(file_select);
file_select->connect("files_selected", this,"_choose_files");
save_select = memnew( EditorDirDialog );
add_child(save_select);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text(TTR("Import"));
error_dialog = memnew( AcceptDialog );
add_child(error_dialog);
options = memnew( _EditorMeshImportOptions );
option_editor = memnew( PropertyEditor );
option_editor->hide_top_label();
vbc->add_margin_child(TTR("Options:"),option_editor,true);
}
开发者ID:pkowal1982,项目名称:godot,代码行数:60,代码来源:editor_mesh_import_plugin.cpp
示例6: set_resizable
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");
}
开发者ID:zgub4,项目名称:godot,代码行数:56,代码来源:create_dialog.cpp
示例7: set_title
EditorSubScene::EditorSubScene() {
scene = NULL;
is_root = false;
set_title(TTR("Select Node(s) to Import"));
set_hide_on_ok(false);
VBoxContainer *vb = memnew(VBoxContainer);
add_child(vb);
//set_child_rect(vb);
HBoxContainer *hb = memnew(HBoxContainer);
path = memnew(LineEdit);
path->connect("text_entered", this, "_path_changed");
hb->add_child(path);
path->set_h_size_flags(SIZE_EXPAND_FILL);
Button *b = memnew(Button);
b->set_text(" .. ");
hb->add_child(b);
b->connect("pressed", this, "_path_browse");
vb->add_margin_child(TTR("Scene Path:"), hb);
tree = memnew(Tree);
tree->set_v_size_flags(SIZE_EXPAND_FILL);
vb->add_margin_child(TTR("Import From Node:"), tree, true);
tree->set_select_mode(Tree::SELECT_MULTI);
tree->connect("multi_selected", this, "_item_multi_selected");
//tree->connect("nothing_selected", this, "_deselect_items");
tree->connect("cell_selected", this, "_selected_changed");
tree->connect("item_activated", this, "_ok", make_binds(), CONNECT_DEFERRED);
file_dialog = memnew(EditorFileDialog);
List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions);
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
file_dialog->add_filter("*." + E->get());
}
file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE);
add_child(file_dialog);
file_dialog->connect("file_selected", this, "_path_selected");
}
开发者ID:UgisBrekis,项目名称:godot,代码行数:46,代码来源:editor_sub_scene.cpp
示例8: set_title
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);
}
开发者ID:elanifegnirf,项目名称:godot,代码行数:18,代码来源:code_editor.cpp
示例9: memnew
EditorAssetInstaller::EditorAssetInstaller() {
VBoxContainer *vb = memnew(VBoxContainer);
add_child(vb);
tree = memnew(Tree);
vb->add_margin_child("Package Contents:", tree, true);
tree->connect("item_edited", this, "_item_edited");
error = memnew(AcceptDialog);
add_child(error);
get_ok()->set_text(TTR("Install"));
set_title(TTR("Package Installer"));
updating = false;
set_hide_on_ok(true);
}
开发者ID:KellyThomas,项目名称:godot,代码行数:18,代码来源:editor_asset_installer.cpp
示例10: set_title
ConnectionsDialog::ConnectionsDialog(EditorNode *p_editor) {
editor=p_editor;
set_title("Edit Connections..");
set_hide_on_ok(false);
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
tree = memnew( Tree );
tree->set_columns(1);
tree->set_select_mode(Tree::SELECT_ROW);
tree->set_hide_root(true);
vbc->add_margin_child("Connections:",tree,true);
// add_child(tree);
connect_dialog = memnew( ConnectDialog );
connect_dialog->set_as_toplevel(true);
add_child(connect_dialog);
remove_confirm = memnew( ConfirmationDialog );
remove_confirm->set_as_toplevel(true);
add_child(remove_confirm);
/*
node_only->set_anchor( MARGIN_TOP, ANCHOR_END );
node_only->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
node_only->set_anchor( MARGIN_RIGHT, ANCHOR_END );
node_only->set_begin( Point2( 20,51) );
node_only->set_end( Point2( 10,44) );
*/
remove_confirm->connect("confirmed", this,"_remove_confirm");
connect_dialog->connect("connected", this,"_connect");
tree->connect("item_selected", this,"_something_selected");
get_cancel()->set_text("Close");
}
开发者ID:Ranmus,项目名称:godot,代码行数:44,代码来源:connections_dialog.cpp
示例11: memnew
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);
}
开发者ID:ShadowKyogre,项目名称:godot,代码行数:19,代码来源:quick_open.cpp
示例12: memnew
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";
}
开发者ID:SasoriOlkof,项目名称:godot,代码行数:21,代码来源:create_dialog.cpp
示例13: set_title
EditorSubScene::EditorSubScene() {
set_title("Select Sub-Scene..");
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
set_child_rect(vb);
HBoxContainer *hb = memnew( HBoxContainer );
path = memnew( LineEdit );
path->connect("text_entered",this,"_path_changed");
hb->add_child(path);
path->set_h_size_flags(SIZE_EXPAND_FILL);
Button *b = memnew( Button );
b->set_text(" .. ");
hb->add_child(b);
b->connect("pressed",this,"_path_browse");
vb->add_margin_child("Scene Path:",hb);
tree = memnew( Tree );
tree->set_v_size_flags(SIZE_EXPAND_FILL);
vb->add_margin_child("Import From Node:",tree)->set_v_size_flags(SIZE_EXPAND_FILL);
file_dialog = memnew( FileDialog );
List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("PackedScene",&extensions);
for(List<String>::Element *E = extensions.front();E;E=E->next() ) {
file_dialog->add_filter("*."+E->get());
}
file_dialog->set_mode(FileDialog::MODE_OPEN_FILE);
add_child(file_dialog);
file_dialog->connect("file_selected",this,"_path_selected");
scene=NULL;
set_hide_on_ok(false);
}
开发者ID:0871087123,项目名称:godot,代码行数:39,代码来源:editor_sub_scene.cpp
示例14: set_title
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);
}
开发者ID:93i,项目名称:godot,代码行数:22,代码来源:code_editor.cpp
示例15: set_title
EditorDirDialog::EditorDirDialog() {
updating = false;
set_title(TTR("Choose a Directory"));
set_hide_on_ok(false);
tree = memnew(Tree);
add_child(tree);
tree->connect("item_activated", this, "_ok");
makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel() ? true : false, "makedir");
makedir->connect("pressed", this, "_make_dir");
makedialog = memnew(ConfirmationDialog);
makedialog->set_title(TTR("Create Folder"));
add_child(makedialog);
VBoxContainer *makevb = memnew(VBoxContainer);
makedialog->add_child(makevb);
//makedialog->set_child_rect(makevb);
makedirname = memnew(LineEdit);
makevb->add_margin_child(TTR("Name:"), makedirname);
makedialog->register_text_enter(makedirname);
makedialog->connect("confirmed", this, "_make_dir_confirm");
mkdirerr = memnew(AcceptDialog);
mkdirerr->set_text(TTR("Could not create folder."));
add_child(mkdirerr);
get_ok()->set_text(TTR("Choose"));
must_reload = false;
}
开发者ID:ISylvox,项目名称:godot,代码行数:36,代码来源:editor_dir_dialog.cpp
示例16: memnew
ScriptCreateDialog::ScriptCreateDialog() {
/* SNAP DIALOG */
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
set_child_rect(vb);
class_name = memnew( LineEdit );
VBoxContainer *vb2 = memnew( VBoxContainer );
vb2->add_child(class_name);
class_name->connect("text_changed", this,"_class_name_changed");
error_label = memnew(Label);
error_label->set_text("valid chars: a-z A-Z 0-9 _");
error_label->set_align(Label::ALIGN_CENTER);
vb2->add_child(error_label);
vb->add_margin_child(TTR("Class Name:"),vb2);
parent_name = memnew( LineEdit );
vb->add_margin_child(TTR("Inherits:"),parent_name);
parent_name->connect("text_changed", this,"_class_name_changed");
language_menu = memnew( OptionButton );
vb->add_margin_child(TTR("Language"),language_menu);
for(int i=0;i<ScriptServer::get_language_count();i++) {
language_menu->add_item(ScriptServer::get_language(i)->get_name());
}
editor_settings = EditorSettings::get_singleton();
String last_selected_language = editor_settings->get_last_selected_language();
if (last_selected_language != "")
for (int i = 0; i < language_menu->get_item_count(); i++)
if (language_menu->get_item_text(i) == last_selected_language)
{
language_menu->select(i);
break;
}
else language_menu->select(0);
language_menu->connect("item_selected",this,"_lang_changed");
//parent_name->set_text();
vb2 = memnew( VBoxContainer );
path_vb = memnew( VBoxContainer );
vb2->add_child(path_vb);
HBoxContainer *hbc = memnew( HBoxContainer );
file_path = memnew( LineEdit );
file_path->connect("text_changed",this,"_path_changed");
hbc->add_child(file_path);
file_path->set_h_size_flags(SIZE_EXPAND_FILL);
Button *b = memnew( Button );
b->set_text(" .. ");
b->connect("pressed",this,"_browse_path");
hbc->add_child(b);
path_vb->add_child(hbc);
path_error_label = memnew( Label );
path_vb->add_child( path_error_label );
path_error_label->set_text(TTR("Error!"));
path_error_label->set_align(Label::ALIGN_CENTER);
internal = memnew( CheckButton );
internal->set_text(TTR("Built-In Script"));
vb2->add_child(internal);
internal->connect("pressed",this,"_built_in_pressed");
vb->add_margin_child(TTR("Path:"),vb2);
set_size(Size2(200,150));
set_hide_on_ok(false);
set_title(TTR("Attach Node Script"));
file_browse = memnew( EditorFileDialog );
file_browse->connect("file_selected",this,"_file_selected");
add_child(file_browse);
get_ok()->set_text(TTR("Create"));
alert = memnew( AcceptDialog );
add_child(alert);
_lang_changed(0);
create_new=true;
}
开发者ID:FEDE0D,项目名称:godot,代码行数:87,代码来源:script_create_dialog.cpp
示例17: set_title
EditorSettingsDialog::EditorSettingsDialog() {
set_title(TTR("Editor Settings"));
set_resizable(true);
undo_redo = memnew(UndoRedo);
tabs = memnew(TabContainer);
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
tabs->connect("tab_changed", this, "_tabs_tab_changed");
add_child(tabs);
//set_child_rect(tabs);
// General Tab
tab_general = memnew(VBoxContainer);
tabs->add_child(tab_general);
tab_general->set_name(TTR("General"));
HBoxContainer *hbc = memnew(HBoxContainer);
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
tab_general->add_child(hbc);
search_box = memnew(LineEdit);
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(search_box);
inspector = memnew(SectionedInspector);
//inspector->hide_top_label();
inspector->get_inspector()->set_use_filter(true);
inspector->register_search_box(search_box);
inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL);
inspector->get_inspector()->set_undo_redo(undo_redo);
tab_general->add_child(inspector);
inspector->get_inspector()->connect("property_edited", this, "_settings_property_edited");
inspector->get_inspector()->connect("restart_requested", this, "_editor_restart_request");
restart_container = memnew(PanelContainer);
tab_general->add_child(restart_container);
HBoxContainer *restart_hb = memnew(HBoxContainer);
restart_container->add_child(restart_hb);
restart_icon = memnew(TextureRect);
restart_icon->set_v_size_flags(SIZE_SHRINK_CENTER);
restart_hb->add_child(restart_icon);
restart_label = memnew(Label);
restart_label->set_text(TTR("Editor must be restarted for changes to take effect"));
restart_hb->add_child(restart_label);
restart_hb->add_spacer();
Button *restart_button = memnew(Button);
restart_button->connect("pressed", this, "_editor_restart");
restart_hb->add_child(restart_button);
restart_button->set_text(TTR("Save & Restart"));
restart_close_button = memnew(ToolButton);
restart_close_button->connect("pressed", this, "_editor_restart_close");
restart_hb->add_child(restart_close_button);
restart_container->hide();
// Shortcuts Tab
tab_shortcuts = memnew(VBoxContainer);
tabs->add_child(tab_shortcuts);
tab_shortcuts->set_name(TTR("Shortcuts"));
hbc = memnew(HBoxContainer);
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
tab_shortcuts->add_child(hbc);
shortcut_search_box = memnew(LineEdit);
shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(shortcut_search_box);
shortcut_search_box->connect("text_changed", this, "_filter_shortcuts");
shortcuts = memnew(Tree);
tab_shortcuts->add_child(shortcuts, true);
shortcuts->set_v_size_flags(SIZE_EXPAND_FILL);
shortcuts->set_columns(2);
shortcuts->set_hide_root(true);
//shortcuts->set_hide_folding(true);
shortcuts->set_column_titles_visible(true);
shortcuts->set_column_title(0, TTR("Name"));
shortcuts->set_column_title(1, TTR("Binding"));
shortcuts->connect("button_pressed", this, "_shortcut_button_pressed");
press_a_key = memnew(ConfirmationDialog);
press_a_key->set_focus_mode(FOCUS_ALL);
add_child(press_a_key);
Label *l = memnew(Label);
l->set_text(TTR("Press a Key..."));
l->set_anchors_and_margins_preset(Control::PRESET_WIDE);
l->set_align(Label::ALIGN_CENTER);
l->set_margin(MARGIN_TOP, 20);
l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30);
press_a_key_label = l;
press_a_key->add_child(l);
press_a_key->connect("gui_input", this, "_wait_for_key");
press_a_key->connect("confirmed", this, "_press_a_key_confirm");
//get_ok()->set_text("Apply");
set_hide_on_ok(true);
//get_cancel()->set_text("Close");
//.........这里部分代码省略.........
开发者ID:KellyThomas,项目名称:godot,代码行数:101,代码来源:settings_config_dialog.cpp
示例18: set_self_opacity
FindReplaceDialog::FindReplaceDialog() {
set_self_opacity(0.8);
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
set_child_rect(vb);
search_text = memnew( LineEdit );
vb->add_margin_child("Search",search_text);
search_text->connect("text_entered", this,"_search_text_entered");
//search_text->set_self_opacity(0.7);
replace_label = memnew( Label);
replace_label->set_text("Replace By");
vb->add_child(replace_label);
replace_mc= memnew( MarginContainer);
vb->add_child(replace_mc);
replace_text = memnew( LineEdit );
replace_text->set_anchor( MARGIN_RIGHT, ANCHOR_END );
replace_text->set_begin( Point2(15,132) );
replace_text->set_end( Point2(15,135) );
//replace_text->set_self_opacity(0.7);
replace_mc->add_child(replace_text);
replace_text->connect("text_entered", this,"_replace_text_entered");
MarginContainer *opt_mg = memnew( MarginContainer );
vb->add_child(opt_mg);
VBoxContainer *svb = memnew( VBoxContainer);
opt_mg->add_child(svb);
svb ->add_child(memnew(Label));
whole_words = memnew( CheckButton );
whole_words->set_text("Whole Words");
svb->add_child(whole_words);
case_sensitive = memnew( CheckButton );
case_sensitive->set_text("Case Sensitive");
svb->add_child(case_sensitive);
backwards = memnew( CheckButton );
backwards->set_text("Backwards");
svb->add_child(backwards);
opt_mg = memnew( MarginContainer );
vb->add_child(opt_mg);
VBoxContainer *rvb = memnew( VBoxContainer);
opt_mg->add_child(rvb);
replace_vb=rvb;
// rvb ->add_child(memnew(HSeparator));
rvb ->add_child(memnew(Label));
prompt = memnew( CheckButton );
prompt->set_text("Prompt On Replace");
rvb->add_child(prompt);
prompt->connect("pressed", this,"_prompt_changed");
selection_only = memnew( CheckButton );
selection_only->set_text("Selection Only");
rvb->add_child(selection_only);
int margin = get_constant("margin","Dialogs");
int button_margin = get_constant("button_margin","Dialogs");
skip = memnew( Button );
skip->set_anchor( MARGIN_LEFT, ANCHOR_END );
skip->set_anchor( MARGIN_TOP, ANCHOR_END );
skip->set_anchor( MARGIN_RIGHT, ANCHOR_END );
skip->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
skip->set_begin( Point2( 70, button_margin ) );
skip->set_end( Point2( 10, margin ) );
skip->set_text("Skip");
add_child(skip);
skip->connect("pressed", this,"_skip_pressed");
error_label = memnew( Label );
error_label->set_align(Label::ALIGN_CENTER);
error_label->add_color_override("font_color",Color(1,0.4,0.3));
error_label->add_color_override("font_color_shadow",Color(0,0,0,0.2));
error_label->add_constant_override("shadow_as_outline",1);
vb->add_child(error_label);
set_hide_on_ok(false);
}
开发者ID:elanifegnirf,项目名称:godot,代码行数:98,代码来源:code_editor.cpp
示例19: set_resizable
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);
}
开发者ID:RandomShaper,项目名称:godot,代码行数:72,代码来源:create_dialog.cpp
示例20: EditorSampleImportDialog
EditorSampleImportDialog(EditorSampleImportPlugin *p_plugin) {
plugin=p_plugin;
set_title("Import Audio Samples");
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer );
vbc->add_margin_child("Source Sample(s):",hbc);
import_path = memnew( LineEdit );
import_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(import_path);
Button * import_choose = memnew( Button );
import_choose->set_text(" .. ");
hbc->add_child(import_choose);
import_choose->connect("pressed", this,"_browse");
hbc = memnew( HBoxContainer );
vbc->add_margin_child("Target Path:",hbc);
save_path = memnew( LineEdit );
save_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(save_path);
Button * save_choose = memnew( Button );
save_choose->set_text(" .. ");
hbc->add_child(save_choose);
save_choose->connect("pressed", this,"_browse_target");
file_select = memnew(FileDialog);
file_select->set_access(FileDialog::ACCESS_FILESYSTEM);
add_child(file_select);
file_select->set_mode(FileDialog::MODE_OPEN_FILES);
file_select->connect("files_selected", this,"_choose_files");
file_select->add_filter("*.wav ; MS Waveform");
save_select = memnew( EditorDirDialog );
add_child(save_select);
// save_select->set_mode(FileDialog::MODE_OPEN_DIR);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text("Import");
error_dialog = memnew ( ConfirmationDialog );
add_child(error_dialog);
error_dialog->get_ok()->set_text("Accept");
// error_dialog->get_cancel()->hide();
set_hide_on_ok(false);
options = memnew( _EditorSampleImportOptions );
option_editor = memnew( PropertyEditor );
option_editor->hide_top_label();
vbc->add_margin_child("Options:",option_editor,true);
}
开发者ID:zz676,项目名称:godot,代码行数:66,代码来源:editor_sample_import_plugin.cpp
注:本文中的set_hide_on_ok函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论