本文整理汇总了C++中set_hide_on_ok函数的典型用法代码示例。如果您正苦于以下问题:C++ set_hide_on_ok函数的具体用法?C++ set_hide_on_ok怎么用?C++ set_hide_on_ok使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_hide_on_ok函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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");
}
示例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);
}
示例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);
}
示例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");
}
示例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);
}
示例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";
}
示例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);
}
示例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);
}
示例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;
}