本文整理汇总了C++中CheckButton::is_pressed方法的典型用法代码示例。如果您正苦于以下问题:C++ CheckButton::is_pressed方法的具体用法?C++ CheckButton::is_pressed怎么用?C++ CheckButton::is_pressed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CheckButton
的用法示例。
在下文中一共展示了CheckButton::is_pressed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _import
void _import() {
if (items.size()==0) {
error_dialog->set_text(TTR("No items to import!"));
error_dialog->popup_centered(Size2(200,100));
}
if (!save_path->get_text().begins_with("res://")) {
error_dialog->set_text(TTR("No target path!"));
error_dialog->popup_centered(Size2(200,100));
}
EditorProgress progress("import_xl",TTR("Import Translations"),items.size());
for(int i=0;i<items.size();i++) {
progress.step(items[i]->get_metadata(1),i);
if (!items[i]->is_checked(0))
continue;
String locale = TranslationServer::get_all_locales()[items[i]->get_range(1)];
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
imd->add_source(EditorImportPlugin::validate_source_path(import_path->get_text()));
imd->set_option("locale",locale);
imd->set_option("index",i);
imd->set_option("skip_first",ignore_first->is_pressed());
imd->set_option("compress",compress->is_pressed());
String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+"."+locale+".xl");
Error err = plugin->import(savefile,imd);
if (err!=OK) {
error_dialog->set_text(TTR("Couldn't import!"));
error_dialog->popup_centered(Size2(200,100));
} else if (add_to_project->is_pressed()) {
ProjectSettings::get_singleton()->add_translation(savefile);
}
}
hide();
}
示例2: _import
void EditorTextureImportDialog::_import() {
// ImportMonitorBlock imb;
Vector<String> files=import_path->get_text().split(",");
if (!files.size()) {
error_dialog->set_text("Please specify some files!");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_path=save_path->get_text();
if (save_path->get_text().strip_edges()=="") {
error_dialog->set_text("Target path is empty.");
error_dialog->popup_centered_minsize();
return;
}
if (!save_path->get_text().begins_with("res://")) {
error_dialog->set_text("Target path must be full resource path.");
error_dialog->popup_centered_minsize();
return;
}
if (!atlas && !large && !DirAccess::exists(save_path->get_text())) {
error_dialog->set_text("Target path must exist.");
error_dialog->popup_centered_minsize();
return;
}
if (atlas) { //atlas
if (files.size()==0) {
error_dialog->set_text("At least one file needed for Atlas.");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_file = dst_path;
//dst_file=dst_file.basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
//imd->set_editor();
for(int i=0;i<files.size();i++) {
imd->add_source(EditorImportPlugin::validate_source_path(files[i]));
}
imd->set_option("format",texture_options->get_format());
imd->set_option("flags",texture_options->get_flags());
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",true);
imd->set_option("atlas_size",int(size->get_val()));
imd->set_option("large",false);
imd->set_option("crop",crop_source->is_pressed());
Error err = plugin->import(dst_file,imd);
if (err) {
error_dialog->set_text("Error importing: "+dst_file.get_file());
error_dialog->popup_centered(Size2(200,100));
return;
}
} else if (large) { //atlas
if (files.size()!=1) {
error_dialog->set_text("Only one file is required for large texture");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_file = dst_path;
//dst_file=dst_file.basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
//imd->set_editor();
for(int i=0;i<files.size();i++) {
imd->add_source(EditorImportPlugin::validate_source_path(files[i]));
}
imd->set_option("format",texture_options->get_format());
imd->set_option("flags",texture_options->get_flags());
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",false);
imd->set_option("large",true);
imd->set_option("large_cell_size",int(size->get_val()));
imd->set_option("crop",crop_source->is_pressed());
Error err = plugin->import(dst_file,imd);
if (err) {
error_dialog->set_text("Error importing: "+dst_file.get_file());
error_dialog->popup_centered(Size2(200,100));
return;
}
} else {
//.........这里部分代码省略.........
示例3: _import
void EditorTextureImportDialog::_import() {
// ImportMonitorBlock imb;
Vector<String> files=import_path->get_text().split(",");
if (!files.size()) {
error_dialog->set_text("Please specify some files!");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_path=save_path->get_text();
if (dst_path.empty()) {
error_dialog->set_text("Please specify a valid target import path!");
error_dialog->popup_centered(Size2(200,100));
return;
}
if (atlas) { //atlas
if (files.size()==0) {
error_dialog->set_text("At least one file needed for Atlas.");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_file = dst_path;
//dst_file=dst_file.basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
//imd->set_editor();
for(int i=0;i<files.size();i++) {
imd->add_source(EditorImportPlugin::validate_source_path(files[i]));
}
imd->set_option("format",texture_options->get_format());
imd->set_option("flags",texture_options->get_flags());
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",true);
imd->set_option("crop",crop_source->is_pressed());
Error err = plugin->import(dst_file,imd);
if (err) {
error_dialog->set_text("Error importing: "+dst_file.get_file());
error_dialog->popup_centered(Size2(200,100));
return;
}
} else {
for(int i=0;i<files.size();i++) {
String dst_file = dst_path.plus_file(files[i].get_file());
dst_file=dst_file.basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
//imd->set_editor();
imd->add_source(EditorImportPlugin::validate_source_path(files[i]));
imd->set_option("format",texture_options->get_format());
imd->set_option("flags",texture_options->get_flags());
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",false);
Error err = plugin->import(dst_file,imd);
if (err) {
error_dialog->set_text("Error importing: "+dst_file.get_file());
error_dialog->popup_centered(Size2(200,100));
return;
}
}
}
hide();
}