本文整理汇总了C++中SpinBox::set_h_size_flags方法的典型用法代码示例。如果您正苦于以下问题:C++ SpinBox::set_h_size_flags方法的具体用法?C++ SpinBox::set_h_size_flags怎么用?C++ SpinBox::set_h_size_flags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpinBox
的用法示例。
在下文中一共展示了SpinBox::set_h_size_flags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memnew
EditorImportTextureOptions::EditorImportTextureOptions() {
updating=false;
format = memnew( OptionButton );
format->add_item("Uncompressed",EditorTextureImportPlugin::IMAGE_FORMAT_UNCOMPRESSED);
format->add_item("Compress Lossless (PNG)",EditorTextureImportPlugin::IMAGE_FORMAT_COMPRESS_DISK_LOSSLESS);
format->add_item("Compress Lossy (WebP)",EditorTextureImportPlugin::IMAGE_FORMAT_COMPRESS_DISK_LOSSY);
format->add_item("Compress (VRAM)",EditorTextureImportPlugin::IMAGE_FORMAT_COMPRESS_RAM);
add_margin_child("Texture Format",format);
quality_vb = memnew( VBoxContainer );
HBoxContainer *quality_hb = memnew(HBoxContainer);
HSlider *hs = memnew( HSlider );
hs->set_h_size_flags(SIZE_EXPAND_FILL);
hs->set_stretch_ratio(0.8);
quality_hb->add_child(hs);
quality_hb->set_h_size_flags(SIZE_EXPAND_FILL);
SpinBox *sb = memnew( SpinBox );
sb->set_h_size_flags(SIZE_EXPAND_FILL);
sb->set_stretch_ratio(0.2);
quality_hb->add_child(sb);
sb->share(hs);
hs->set_min(0);
hs->set_max(1.0);
hs->set_step(0.01);
hs->set_val(0.7);
quality=hs;
quality_vb->add_margin_child("Texture Compression Quality (WebP):",quality_hb);
add_child(quality_vb);
flags = memnew( Tree );
flags->set_hide_root(true);
TreeItem *root = flags->create_item();
const char ** fname=flag_names;
while( *fname ) {
TreeItem*ti = flags->create_item(root);
ti->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
ti->set_text(0,*fname);
ti->set_editable(0,true);
items.push_back(ti);
fname++;
}
add_margin_child("Texture Options",flags,true);
notice_for_2d = memnew( Label );
notice_for_2d->set_text("NOTICE: You are not forced to import textures for 2D projects. Just copy your .jpg or .png files to your project, and change export options later. Atlases can be generated on export too.");
notice_for_2d->set_custom_minimum_size(Size2(0,50));
notice_for_2d->set_autowrap(true);
add_child(notice_for_2d);
notice_for_2d->hide();
}