本文整理汇总了C++中SpinBox::set_val方法的典型用法代码示例。如果您正苦于以下问题:C++ SpinBox::set_val方法的具体用法?C++ SpinBox::set_val怎么用?C++ SpinBox::set_val使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpinBox
的用法示例。
在下文中一共展示了SpinBox::set_val方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: popup_import
void popup_import(const String& p_path) {
popup_centered(Size2(600,500));
if (p_path!="") {
Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(p_path);
ERR_FAIL_COND(!rimd.is_valid());
dest->get_line_edit()->set_text(p_path);
List<String> opts;
rimd->get_options(&opts);
for(List<String>::Element *E=opts.front();E;E=E->next()) {
options->_set(E->get(),rimd->get_option(E->get()));
}
String src = "";
for(int i=0;i<rimd->get_source_count();i++) {
if (i>0)
src+=",";
src+=EditorImportPlugin::expand_source_path(rimd->get_source_path(i));
}
source->get_line_edit()->set_text(src);
font_size->set_val(rimd->get_option("font/size"));
}
}
示例2: memnew
EditorFontImportDialog(EditorFontImportPlugin *p_plugin) {
plugin=p_plugin;
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer);
vbc->add_child(hbc);
VBoxContainer *vbl = memnew( VBoxContainer );
hbc->add_child(vbl);
hbc->set_v_size_flags(SIZE_EXPAND_FILL);
vbl->set_h_size_flags(SIZE_EXPAND_FILL);
VBoxContainer *vbr = memnew( VBoxContainer );
hbc->add_child(vbr);
vbr->set_h_size_flags(SIZE_EXPAND_FILL);
source = memnew( LineEditFileChooser );
source->get_file_dialog()->set_access(FileDialog::ACCESS_FILESYSTEM);
source->get_file_dialog()->set_mode(FileDialog::MODE_OPEN_FILE);
source->get_file_dialog()->add_filter("*.ttf;TrueType");
source->get_file_dialog()->add_filter("*.otf;OpenType");
source->get_line_edit()->connect("text_entered",this,"_src_changed");
vbl->add_margin_child("Source Font:",source);
font_size = memnew( SpinBox );
vbl->add_margin_child("Source Font Size:",font_size);
font_size->set_min(3);
font_size->set_max(256);
font_size->set_val(16);
font_size->connect("value_changed",this,"_font_size_changed");
dest = memnew( LineEditFileChooser );
//
List<String> fl;
Ref<Font> font= memnew(Font);
dest->get_file_dialog()->add_filter("*.fnt ; Font" );
//ResourceSaver::get_recognized_extensions(font,&fl);
//for(List<String>::Element *E=fl.front();E;E=E->next()) {
// dest->get_file_dialog()->add_filter("*."+E->get());
//}
vbl->add_margin_child("Dest Resource:",dest);
HBoxContainer *testhb = memnew( HBoxContainer );
test_string = memnew( LineEdit );
test_string->set_text("The quick brown fox jumps over the lazy dog.");
test_string->set_h_size_flags(SIZE_EXPAND_FILL);
test_string->set_stretch_ratio(5);
testhb->add_child(test_string);
test_color = memnew( ColorPickerButton );
test_color->set_color(get_color("font_color","Label"));
test_color->set_h_size_flags(SIZE_EXPAND_FILL);
test_color->set_stretch_ratio(1);
test_color->connect("color_changed",this,"_update_text3");
testhb->add_child(test_color);
vbl->add_spacer();
vbl->add_margin_child("Test: ",testhb);
HBoxContainer *upd_hb = memnew( HBoxContainer );
// vbl->add_child(upd_hb);
upd_hb->add_spacer();
Button *update = memnew( Button);
upd_hb->add_child(update);
update->set_text("Update");
update->connect("pressed",this,"_update");
options = memnew( _EditorFontImportOptions );
prop_edit = memnew( PropertyEditor() );
vbr->add_margin_child("Options:",prop_edit,true);
options->connect("changed",this,"_prop_changed");
prop_edit->hide_top_label();
Panel *panel = memnew( Panel );
vbc->add_child(panel);
test_label = memnew( Label );
test_label->set_autowrap(true);
panel->add_child(test_label);
test_label->set_area_as_parent_rect();
panel->set_v_size_flags(SIZE_EXPAND_FILL);
test_string->connect("text_changed",this,"_update_text2");
set_title("Font Import");
timer = memnew( Timer );
add_child(timer);
timer->connect("timeout",this,"_update");
timer->set_wait_time(0.4);
timer->set_one_shot(true);
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");
set_hide_on_ok(false);
}