这篇教程C++ GetBool函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetBool函数的典型用法代码示例。如果您正苦于以下问题:C++ GetBool函数的具体用法?C++ GetBool怎么用?C++ GetBool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetBool函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: XRC_MAKE_INSTANCEwxObject * MaxToggleButtonXmlHandler::DoCreateResource(){ XRC_MAKE_INSTANCE(control, MaxToggleButton) control->Create(m_parentAsWindow, GetID(), GetText(wxT("label")), GetPosition(), GetSize(), GetStyle(), wxDefaultValidator, GetName()); control->MaxBind(CB_PREF(wx_wxtogglebutton_wxToggleButton__xrcNew)(control)); control->SetValue(GetBool( wxT("checked"))); SetupWindow(control); return control;}
开发者ID:GWRon,项目名称:wx.mod,代码行数:19,
示例2: Get const bool ConfigManager::GetBool(const Urho3D::String& section, const Urho3D::String& parameter, const bool defaultValue) { auto value = Get(section, parameter); if (value.GetType() == Urho3D::VAR_BOOL) return value.GetBool(); if (value.GetType() == Urho3D::VAR_STRING) return Urho3D::ToBool(value.GetString()); // Parameter doesn't exist, or is a different type if (_saveDefaultParameters) { // Set back to default Set(section, parameter, defaultValue); } return defaultValue; }
开发者ID:carnalis,项目名称:urho_map,代码行数:19,
示例3: FromXML// build generator - needs uniqe name (checked by ModelBuilder)// and optional count, which defaults to special "all rows value"Generator * GeneratorTag :: FromXML( const ALib::XMLElement * e ) { RequireChildren( e ); AllowAttrs( e, AttrList( NAME_ATTR, COUNT_ATTRIB, GROUP_ATTR, DEBUG_ATTRIB, HIDE_ATTR, OUT_ATTRIB, FNAMES_ATTR, 0 ) ); string name = e->HasAttr( NAME_ATTR) ? e->AttrValue( NAME_ATTR ) : ""; int count = GetCount( e ); bool debug = GetBool( e, DEBUG_ATTRIB, NO_STR ); FieldList grp( e->AttrValue( GROUP_ATTR, "" )); string ofn = GetOutputFile( e ); string fields = e->AttrValue( FNAMES_ATTR, "" ); std::auto_ptr <GeneratorTag> g( new GeneratorTag( name, count, debug, ofn, fields, grp ) ); g->AddSources( e ); return g.release();}
开发者ID:akki9c,项目名称:csvtest,代码行数:21,
示例4: GetType//---------------------------------------------------------------------------bool IValue::operator!=(const IValue &a_Val) const{ char_type type1 = GetType(), type2 = a_Val.GetType(); if (type1 == type2 || (IsScalar() && a_Val.IsScalar())) { switch (GetType()) { case 's': return GetString() != a_Val.GetString(); case 'i': case 'f': return GetFloat() != a_Val.GetFloat(); case 'c': return (GetFloat() != a_Val.GetFloat()) || (GetImag() != a_Val.GetImag()); case 'b': return GetBool() != a_Val.GetBool(); case 'v': return true; case 'm': if (GetRows() != a_Val.GetRows() || GetCols() != a_Val.GetCols()) { return true; } else { for (int i = 0; i < GetRows(); ++i) { if (const_cast<IValue*>(this)->At(i) != const_cast<IValue&>(a_Val).At(i)) return true; } return false; } default: ErrorContext err; err.Errc = ecINTERNAL_ERROR; err.Pos = -1; err.Type2 = GetType(); err.Type1 = a_Val.GetType(); throw ParserError(err); } // switch this type } else { return true; }}
开发者ID:cloudqiu1110,项目名称:math-parser-benchmark-project,代码行数:44,
示例5: GetStringvoid ApplinkDialog::saveSettings(){ GetString(IDC_TMP_FOLDER, &gPreferences, IDC_TMP_FOLDER); GetString(IDC_EXCH_FOLDER, &gPreferences, IDC_EXCH_FOLDER); GetLong(IDC_COMBO_MAP_TYPE, &gPreferences, IDC_COMBO_MAP_TYPE); GetBool(IDC_CHK_EXP_MAT, &gPreferences, IDC_CHK_EXP_MAT); GetBool(IDC_CHK_EXP_UV, &gPreferences, IDC_CHK_EXP_UV); GetBool(IDC_CHK_IMP_MAT, &gPreferences, IDC_CHK_IMP_MAT); GetLong(IDC_COMBO_MAP_IMPORT, &gPreferences, IDC_COMBO_MAP_IMPORT); GetBool(IDC_CHK_IMP_UV, &gPreferences, IDC_CHK_IMP_UV); GetBool(IDC_CHK_REPLACE, &gPreferences, IDC_CHK_REPLACE); GetBool(IDC_CHK_PROMPT, &gPreferences, IDC_CHK_PROMPT); GetString(IDC_COAT_EXE_PATH, &gPreferences, IDC_COAT_EXE_PATH); GetBool(IDC_CHK_COAT_START, &gPreferences, IDC_CHK_COAT_START);}
开发者ID:oyaGG,项目名称:3DCoat_Applinks,代码行数:18,
示例6: GetBoolbool GetAllMenuCommands::Apply(CommandExecutionContext context){ bool showStatus = GetBool(wxT("ShowStatus")); wxArrayString names; CommandManager *cmdManager = context.GetProject()->GetCommandManager(); cmdManager->GetAllCommandNames(names, false); wxArrayString::iterator iter; for (iter = names.begin(); iter != names.end(); ++iter) { wxString name = *iter; wxString out = name; if (showStatus) { out += wxT("/t"); out += cmdManager->GetEnabled(name) ? wxT("Enabled") : wxT("Disabled"); } Status(out); } return true;}
开发者ID:LBoggino,项目名称:audacity,代码行数:20,
示例7: GetStringbool OpenProjectCommand::Apply(CommandExecutionContext context){ wxString fileName = GetString(wxT("Filename")); bool addToHistory = GetBool(wxT("AddToHistory")); wxString oldFileName = context.GetProject()->GetFileName(); if(fileName == wxEmptyString) { context.GetProject()->OnOpen(); } else { context.GetProject()->OpenFile(fileName, addToHistory); } const wxString &newFileName = context.GetProject()->GetFileName(); // Because Open does not return a success or failure, we have to guess // at this point, based on whether the project file name has // changed and what to... return newFileName != wxEmptyString && newFileName != oldFileName;}
开发者ID:Avi2011class,项目名称:audacity,代码行数:20,
示例8: switchstd::string Json::ToString( ){ std::ostringstream ostr; switch(_kind){ case kNull: { ostr << "Null" ; break; } case kNumber: { ostr << GetDouble() ; break; } case kString: { ostr << "/"" << GetString() << "/""; break; } case kTrue: case kFalse: { ostr << boolalpha << GetBool() ; break; } case kObject: { ostr << "{"; Object* obj = (Object*)_data; Object::const_iterator iter = obj->begin() ; size_t size = obj->size(), ind = 0; for(; iter != obj->end(); iter++){ ostr << "/"" << iter->first << "/"" << ":" << iter->second->ToString(); if(++ind < size) ostr << ","; } ostr << "}"; break; } case kArray: { ostr << "["; Array& arr = *(Array*)_data; size_t size = arr.size(), ind = -1; for(; ++ind < size;){ ostr << arr[ind]->ToString(); if(ind+1 < size) ostr << ","; } ostr << "]"; break; } default: break; } return ostr.str();}
开发者ID:JackWyj,项目名称:Json-Parser,代码行数:41,
示例9: Handle//defineVoxel(integer, {left: })//defineVoxel(type, textures)void DefineVoxelHandler::Handle(CefRefPtr<CefProcessMessage> message){ std::cout << "Define Voxel Handler" << std::endl; auto arguments = message->GetArgumentList(); auto name = arguments->GetString(1); auto topImage = arguments->GetString(2); auto sideImage = arguments->GetString(3); auto bottomImage = arguments->GetString(4); auto transparent = arguments->GetBool(5); VoxelDefinition definition; definition.name = name; definition.topImage = topImage; definition.bottomImage = bottomImage; definition.sideImage = sideImage; definition.transparent = transparent; this->context->world->defineVoxel(definition); }
开发者ID:nathanial,项目名称:salamancer,代码行数:23,
示例10: LOGIint Preferences::LoadFromRegistry(void){ CString sval; bool bval; long lval; LOGI("Loading preferences from registry"); fColumnLayout.LoadFromRegistry(kColumnSect); int i; for (i = 0; i < kPrefNumLastRegistry; i++) { if (fPrefMaps[i].registryKey == NULL) continue; switch (fPrefMaps[i].type) { case kBool: bval = GetPrefBool(fPrefMaps[i].num); SetPrefBool(fPrefMaps[i].num, GetBool(fPrefMaps[i].registrySection, fPrefMaps[i].registryKey, bval)); break; case kLong: lval = GetPrefLong(fPrefMaps[i].num); SetPrefLong(fPrefMaps[i].num, GetInt(fPrefMaps[i].registrySection, fPrefMaps[i].registryKey, lval)); break; case kString: sval = GetPrefString(fPrefMaps[i].num); SetPrefString(fPrefMaps[i].num, GetString(fPrefMaps[i].registrySection, fPrefMaps[i].registryKey, sval)); break; default: LOGW("Invalid type %d on num=%d", fPrefMaps[i].type, i); ASSERT(false); break; } } return 0;}
开发者ID:HankG,项目名称:ciderpress,代码行数:40,
示例11: XRC_MAKE_INSTANCEwxObject *kwxAngularMeterHandler::DoCreateResource(){ // the following macro will init a pointer named "control" // with a new instance of the MyControl class, but will NOT // Create() it! XRC_MAKE_INSTANCE(control, kwxAngularMeter) control->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize()); control->SetNumTick(GetLong(wxT("num_ticks"))); control->SetRange(GetLong(wxT("range_min"), 0), GetLong(wxT("range_max"), 220)); control->SetAngle(GetLong(wxT("angle_min"), -20), GetLong(wxT("angle_max"), 200)); int i = 1; while(1){ wxString s = wxString::Format(wxT("sector_%d_colour"), i); if(!HasParam(s)){ break; } // Setting the number of sectors each time around is not ideal but the alternative is to pre-process the XML. control->SetNumSectors(i); control->SetSectorColor(i - 1, GetColour(s, *wxWHITE)); i++; } control->DrawCurrent(GetBool(wxT("show_value"), true)); control->SetNeedleColour(GetColour(wxT("needle_colour"), *wxRED)); control->SetBackColour(GetColour(wxT("background_colour"), control->GetBackgroundColour())); control->SetBorderColour(GetColour(wxT("border_colour"), control->GetBackgroundColour())); // Avoid error if the font node isn't present. if(HasParam(wxT("font"))){ wxFont font = GetFont(); control->SetTxtFont(font); } control->SetValue(GetLong(wxT("value"), 0)); SetupWindow(control); return control;}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:37,
示例12: CreateFramewxObject *wxMdiXmlHandler::DoCreateResource(){ wxWindow *frame = CreateFrame(); if (HasParam(wxT("size"))) frame->SetClientSize(GetSize()); if (HasParam(wxT("pos"))) frame->Move(GetPosition()); if (HasParam(wxT("icon"))) { wxFrame* f = wxDynamicCast(frame, wxFrame); if (f) f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); } SetupWindow(frame); CreateChildren(frame); if (GetBool(wxT("centered"), false)) frame->Centre(); return frame;}
开发者ID:EdgarTx,项目名称:wx,代码行数:24,
示例13: XRC_MAKE_INSTANCEwxObject *wxRadioButtonXmlHandler::DoCreateResource(){ /* BOBM - implementation note. * once the wxBitmapRadioButton is implemented. * look for a bitmap property. If not null, * make it a wxBitmapRadioButton instead of the * normal radio button. */ XRC_MAKE_INSTANCE(control, wxRadioButton) control->Create(m_parentAsWindow, GetID(), GetText(wxT("label")), GetPosition(), GetSize(), GetStyle(), wxDefaultValidator, GetName()); control->SetValue(GetBool(wxT("value"), 0)); SetupWindow(control); return control;}
开发者ID:chromylei,项目名称:third_party,代码行数:24,
示例14: GetBool// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Operand* Peephole::CreateRangeCompare(Operand* op, IntConstant* leftConst, IntConstant* rightConst, const Type* resultType, bool isUcmp, bool noLeftInc) { DebugValidator::IsTrue(IA::IsLargerOrEqual(rightConst, leftConst)); // Create instructions that test if the operand is found in a range: // (op > leftConst) & (op < rightConst) // Add 1 to the left constant, creates some opportunities // by using >= instead of >. auto intKind = leftConst->GetType()->GetSubtype(); __int64 leftPlusOne = noLeftInc ? leftConst->Value() : IA::Add(leftConst->Value(), 1, intKind); leftConst = irGen_.GetIntConst(leftConst->GetType(), leftPlusOne); if(IA::AreEqual(leftPlusOne, rightConst->Value(), intKind)) { // (op >= 5) & (op < 5) -> always false return GetBool(false, resultType); } // If 'leftConst' is the minimum value, we can eliminate the left part, // because 'op >= MIN" will always be true. __int64 min = IA::GetMin(leftConst->GetType(), isUcmp == false); if(IA::AreEqual(leftPlusOne, min, intKind)) { return CreateCompare(op, rightConst, Order_Less, resultType, isUcmp); } // Else emit a test of the form '(op - leftConst) < (rightConst - leftConst)'. // (op >= 4) & (op < 6) -> (op - 4) < 2 __int64 diff = IA::Sub(rightConst, leftConst); auto diffOp = irGen_.GetIntConst(op->GetType(), diff); auto subOp = GetTemporary(op); irGen_.GetSub(op, leftConst, subOp); return CreateCompare(subOp, diffOp, Order_Less, resultType, true);}
开发者ID:lgratian,项目名称:compiler,代码行数:37,
示例15: XRC_MAKE_INSTANCEwxObject *wxBitmapButtonXmlHandler::DoCreateResource(){ XRC_MAKE_INSTANCE(button, wxBitmapButton) button->Create(m_parentAsWindow, GetID(), GetBitmap(wxT("bitmap"), wxART_BUTTON), GetPosition(), GetSize(), GetStyle(wxT("style"), wxBU_AUTODRAW), wxDefaultValidator, GetName()); if (GetBool(wxT("default"), 0)) button->SetDefault(); SetupWindow(button); if (!GetParamValue(wxT("selected")).IsEmpty()) button->SetBitmapSelected(GetBitmap(wxT("selected"))); if (!GetParamValue(wxT("focus")).IsEmpty()) button->SetBitmapFocus(GetBitmap(wxT("focus"))); if (!GetParamValue(wxT("disabled")).IsEmpty()) button->SetBitmapDisabled(GetBitmap(wxT("disabled"))); return button;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:24,
示例16: allowDistribution// Commit//------------------------------------------------------------------------------/*virtual*/ bool FunctionLibrary::Commit( NodeGraph & nodeGraph, const BFFIterator & funcStartIter ) const{ // make sure all required variables are defined const BFFVariable * outputLib; const BFFVariable * compiler; const BFFVariable * compilerOptions; AStackString<> compilerOptionsDeoptimized; AStackString<> compilerOutputPath; AStackString<> compilerOutputPrefix; const BFFVariable * compilerOutputExtension; const BFFVariable * librarian; const BFFVariable * librarianOptions; if ( !GetString( funcStartIter, outputLib, ".LibrarianOutput", true ) || !GetString( funcStartIter, compiler, ".Compiler", true ) || !GetString( funcStartIter, compilerOptions, ".CompilerOptions", true ) || !GetString( funcStartIter, compilerOptionsDeoptimized, ".CompilerOptionsDeoptimized", false ) || !GetString( funcStartIter, compilerOutputPath, ".CompilerOutputPath", true ) || !GetString( funcStartIter, compilerOutputPrefix, ".CompilerOutputPrefix", false ) || !GetString( funcStartIter, compilerOutputExtension, ".CompilerOutputExtension", false ) || !GetString( funcStartIter, librarian, ".Librarian", true ) || !GetString( funcStartIter, librarianOptions, ".LibrarianOptions", true ) ) { return false; } PathUtils::FixupFolderPath( compilerOutputPath ); // find or create the compiler node CompilerNode * compilerNode = nullptr; if ( !FunctionObjectList::GetCompilerNode( nodeGraph, funcStartIter, compiler->GetString(), compilerNode ) ) { return false; // GetCompilerNode will have emitted error } // Compiler Force Using Dependencies compilerForceUsing; if ( !GetNodeList( nodeGraph, funcStartIter, ".CompilerForceUsing", compilerForceUsing, false ) ) { return false; // GetNodeList will have emitted an error } // de-optimization setting bool deoptimizeWritableFiles = false; bool deoptimizeWritableFilesWithToken = false; if ( !GetBool( funcStartIter, deoptimizeWritableFiles, ".DeoptimizeWritableFiles", false, false ) ) { return false; // GetBool will have emitted error } if ( !GetBool( funcStartIter, deoptimizeWritableFilesWithToken, ".DeoptimizeWritableFilesWithToken", false, false ) ) { return false; // GetBool will have emitted error } if ( ( deoptimizeWritableFiles || deoptimizeWritableFilesWithToken ) && compilerOptionsDeoptimized.IsEmpty() ) { Error::Error_1101_MissingProperty( funcStartIter, this, AStackString<>( ".CompilerOptionsDeoptimized" ) ); return false; } // cache & distribution control bool allowDistribution( true ); bool allowCaching( true ); if ( !GetBool( funcStartIter, allowDistribution, ".AllowDistribution", true ) || !GetBool( funcStartIter, allowCaching, ".AllowCaching", true ) ) { return false; // GetBool will have emitted error } // Precompiled Header support ObjectNode * precompiledHeaderNode = nullptr; AStackString<> compilerOutputExtensionStr( compilerOutputExtension ? compilerOutputExtension->GetString().Get() : ".obj" ); if ( !GetPrecompiledHeaderNode( nodeGraph, funcStartIter, compilerNode, compilerOptions, compilerForceUsing, precompiledHeaderNode, deoptimizeWritableFiles, deoptimizeWritableFilesWithToken, allowDistribution, allowCaching, compilerOutputExtensionStr ) ) { return false; // GetPrecompiledHeaderNode will have emitted error } // Sanity check compile flags const bool usingPCH = ( precompiledHeaderNode != nullptr ); uint32_t objFlags = ObjectNode::DetermineFlags( compilerNode, compilerOptions->GetString(), false, usingPCH ); if ( ( objFlags & ObjectNode::FLAG_MSVC ) && ( objFlags & ObjectNode::FLAG_CREATING_PCH ) ) { // must not specify use of precompiled header (must use the PCH specific options) Error::Error_1303_PCHCreateOptionOnlyAllowedOnPCH( funcStartIter, this, "Yc", "CompilerOptions" ); return false; } // Check input/output for Compiler { bool hasInputToken = false; bool hasOutputToken = false; bool hasCompileToken = false; const AString & args = compilerOptions->GetString(); Array< AString > tokens; args.Tokenize( tokens ); for ( const AString & token : tokens ) { if ( token.Find( "%1" ) ) {//.........这里部分代码省略.........
开发者ID:dontnod,项目名称:fastbuild,代码行数:101,
示例17: GetBool //Metoda zwraca atrybut wskazanego typu bool CXml::GetBool(const std::string &node_name, const std::string &attrib_name, bool default_value) { if (m_xml_root) return GetBool(m_xml_root->first_node(node_name.c_str()), attrib_name, default_value); return default_value; }
开发者ID:karlosos,项目名称:Tertius,代码行数:7,
示例18: RepeatedMessage2Jsonvoid Pb2Json::Message2Json(const ProtobufMsg& message, Json& json, bool enum2str) { auto descriptor = message.GetDescriptor(); auto reflection = message.GetReflection(); if (nullptr == descriptor || nullptr == descriptor) return; auto count = descriptor->field_count(); for (auto i = 0; i < count; ++i) { const auto field = descriptor->field(i); if (field->is_repeated()) { if (reflection->FieldSize(message, field) > 0) RepeatedMessage2Json(message, field, reflection, json[field->name()], enum2str); continue; } if (!reflection->HasField(message, field)) { continue; } switch (field->type()) { case ProtobufFieldDescriptor::TYPE_MESSAGE: { const ProtobufMsg& tmp_message = reflection->GetMessage(message, field); if (0 != tmp_message.ByteSize()) Message2Json(tmp_message, json[field->name()]); } break; case ProtobufFieldDescriptor::TYPE_BOOL: json[field->name()] = reflection->GetBool(message, field) ? true : false; break; case ProtobufFieldDescriptor::TYPE_ENUM: { auto* enum_value_desc = reflection->GetEnum(message, field); if (enum2str) { json[field->name()] = enum_value_desc->name(); } else { json[field->name()] = enum_value_desc->number(); } } break; case ProtobufFieldDescriptor::TYPE_INT32: case ProtobufFieldDescriptor::TYPE_SINT32: case ProtobufFieldDescriptor::TYPE_SFIXED32: json[field->name()] = reflection->GetInt32(message, field); break; case ProtobufFieldDescriptor::TYPE_UINT32: case ProtobufFieldDescriptor::TYPE_FIXED32: json[field->name()] = reflection->GetUInt32(message, field); break; case ProtobufFieldDescriptor::TYPE_INT64: case ProtobufFieldDescriptor::TYPE_SINT64: case ProtobufFieldDescriptor::TYPE_SFIXED64: json[field->name()] = reflection->GetInt64(message, field); break; case ProtobufFieldDescriptor::TYPE_UINT64: case ProtobufFieldDescriptor::TYPE_FIXED64: json[field->name()] = reflection->GetUInt64(message, field); break; case ProtobufFieldDescriptor::TYPE_FLOAT: json[field->name()] = reflection->GetFloat(message, field); break; case ProtobufFieldDescriptor::TYPE_STRING: case ProtobufFieldDescriptor::TYPE_BYTES: json[field->name()] = reflection->GetString(message, field); break; default: break; } }}
开发者ID:HaustWang,项目名称:pb2json,代码行数:76,
示例19: XRC_MAKE_INSTANCEwxObject* MYwxTreebookXmlHandler::DoCreateResource(){ if(m_class == wxT("wxTreebook")) { XRC_MAKE_INSTANCE(tbk, wxTreebook) tbk->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")), GetName()); wxTreebook* old_par = m_tbk; m_tbk = tbk; bool old_ins = m_isInside; m_isInside = true; wxArrayTbkPageIndexes old_treeContext = m_treeContext; m_treeContext.Clear(); CreateChildren(m_tbk, true /*only this handler*/); wxXmlNode* node = GetParamNode(wxT("object")); int pageIndex = 0; for(unsigned int i = 0; i < m_tbk->GetPageCount(); i++) { if(m_tbk->GetPage(i)) { wxXmlNode* child = node->GetChildren(); while(child) { if(child->GetName() == wxT("expanded") && child->GetNodeContent() == wxT("1")) m_tbk->ExpandNode(pageIndex, true); child = child->GetNext(); } pageIndex++; } } m_treeContext = old_treeContext; m_isInside = old_ins; m_tbk = old_par; return tbk; } // else ( m_class == wxT("treebookpage") ) wxXmlNode* n = GetParamNode(wxT("object")); wxWindow* wnd = NULL; if(!n) n = GetParamNode(wxT("object_ref")); if(n) { bool old_ins = m_isInside; m_isInside = false; wxObject* item = CreateResFromNode(n, m_tbk, NULL); m_isInside = old_ins; wnd = wxDynamicCast(item, wxWindow); } size_t depth = GetLong(wxT("depth")); if(depth <= m_treeContext.GetCount()) { // first prepare the icon int imgIndex = wxNOT_FOUND; if(HasParam(wxT("bitmap"))) { wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); wxImageList* imgList = m_tbk->GetImageList(); if(imgList == NULL) { imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight()); m_tbk->AssignImageList(imgList); } imgIndex = imgList->Add(bmp); } else if(HasParam(wxT("image"))) { if(m_tbk->GetImageList()) { imgIndex = GetLong(wxT("image")); } else // image without image list? { } } // then add the page to the corresponding parent if(depth < m_treeContext.GetCount()) m_treeContext.RemoveAt(depth, m_treeContext.GetCount() - depth); if(depth == 0) { m_tbk->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")), imgIndex); } else { m_tbk->InsertSubPage(m_treeContext.Item(depth - 1), wnd, GetText(wxT("label")), GetBool(wxT("selected")), imgIndex); } m_treeContext.Add(m_tbk->GetPageCount() - 1); } else { // ReportParamError("depth", "invalid depth"); } return wnd;}
开发者ID:eranif,项目名称:codelite,代码行数:92,
示例20: bool //----------------------------------------------------------------------------------------------- Value::operator bool() { return GetBool(); }
开发者ID:boussaffawalid,项目名称:OTB,代码行数:5,
示例21: GetBooltemplate <> bool Variant::Get<bool>() const{ return GetBool();}
开发者ID:gogoprog,项目名称:Urho3D,代码行数:4,
示例22: XRC_MAKE_INSTANCEwxObject *wxTreebookXmlHandler::DoCreateResource(){ if (m_class == wxT("wxTreebook")) { XRC_MAKE_INSTANCE(tbk, wxTreebook) tbk->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")), GetName()); wxTreebook * old_par = m_tbk; m_tbk = tbk; bool old_ins = m_isInside; m_isInside = true; wxArrayTbkPageIndexes old_treeContext = m_treeContext; m_treeContext.Clear(); CreateChildren(m_tbk, true/*only this handler*/); m_treeContext = old_treeContext; m_isInside = old_ins; m_tbk = old_par; return tbk; }// else ( m_class == wxT("treebookpage") ) wxXmlNode *n = GetParamNode(wxT("object")); wxWindow *wnd = NULL; if ( !n ) n = GetParamNode(wxT("object_ref")); if (n) { bool old_ins = m_isInside; m_isInside = false; wxObject *item = CreateResFromNode(n, m_tbk, NULL); m_isInside = old_ins; wnd = wxDynamicCast(item, wxWindow); if (wnd == NULL && item != NULL) wxLogError(wxT("Error in resource: control within treebook's <page> tag is not a window.")); } size_t depth = GetLong( wxT("depth") ); if( depth <= m_treeContext.Count() ) { // first prepare the icon int imgIndex = wxNOT_FOUND; if ( HasParam(wxT("bitmap")) ) { wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); wxImageList *imgList = m_tbk->GetImageList(); if ( imgList == NULL ) { imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() ); m_tbk->AssignImageList( imgList ); } imgIndex = imgList->Add(bmp); } // then add the page to the corresponding parent if( depth < m_treeContext.Count() ) m_treeContext.RemoveAt(depth, m_treeContext.Count() - depth ); if( depth == 0) { m_tbk->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")), imgIndex); } else { m_tbk->InsertSubPage(m_treeContext.Item(depth - 1), wnd, GetText(wxT("label")), GetBool(wxT("selected")), imgIndex); } m_treeContext.Add( m_tbk->GetPageCount() - 1); } else wxLogError(wxT("Error in resource. wxTreebookPage has an invalid depth.")); return wnd;}
开发者ID:AlexHayton,项目名称:decoda,代码行数:88,
示例23: wxStaticCastwxObject *wxMenuXmlHandler::DoCreateResource(){ if (m_class == wxT("wxMenu")) { wxMenu *menu = m_instance ? wxStaticCast(m_instance, wxMenu) : new wxMenu(GetStyle()); wxString title = GetText(wxT("label")); wxString help = GetText(wxT("help")); bool oldins = m_insideMenu; m_insideMenu = true; CreateChildren(menu, true/*only this handler*/); m_insideMenu = oldins; wxMenuBar *p_bar = wxDynamicCast(m_parent, wxMenuBar); if (p_bar) { p_bar->Append(menu, title); } else { wxMenu *p_menu = wxDynamicCast(m_parent, wxMenu); if (p_menu) { p_menu->Append(GetID(), title, menu, help); if (HasParam(wxT("enabled"))) p_menu->Enable(GetID(), GetBool(wxT("enabled"))); } } return menu; } else { wxMenu *p_menu = wxDynamicCast(m_parent, wxMenu); if (m_class == wxT("separator")) p_menu->AppendSeparator(); else if (m_class == wxT("break")) p_menu->Break(); else /*wxMenuItem*/ { int id = GetID(); wxString label = GetText(wxT("label")); wxString accel = GetText(wxT("accel"), false); wxString fullLabel = label; if (!accel.empty()) fullLabel << wxT("/t") << accel; wxItemKind kind = wxITEM_NORMAL; if (GetBool(wxT("radio"))) kind = wxITEM_RADIO; if (GetBool(wxT("checkable"))) { if ( kind != wxITEM_NORMAL ) { ReportParamError ( "checkable", "menu item can't have both <radio> and <checkable> properties" ); } kind = wxITEM_CHECK; } wxMenuItem *mitem = new wxMenuItem(p_menu, id, fullLabel, GetText(wxT("help")), kind);#if (!defined(__WXMSW__) && !defined(__WXPM__)) || wxUSE_OWNER_DRAWN if (HasParam(wxT("bitmap"))) { // currently only wxMSW has support for using different checked // and unchecked bitmaps for menu items#ifdef __WXMSW__ if (HasParam(wxT("bitmap2"))) mitem->SetBitmaps(GetBitmap(wxT("bitmap2"), wxART_MENU), GetBitmap(wxT("bitmap"), wxART_MENU)); else#endif // __WXMSW__ mitem->SetBitmap(GetBitmap(wxT("bitmap"), wxART_MENU)); }#endif p_menu->Append(mitem); mitem->Enable(GetBool(wxT("enabled"), true)); if (kind == wxITEM_CHECK) mitem->Check(GetBool(wxT("checked"))); } return NULL; }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:93,
示例24: GetBoolbool ConfigFile::GetBoolDefault(const char* block, const char* name, const bool def /* = false */){ bool val; return GetBool(block, name, &val) ? val : def;}
开发者ID:lev1976g,项目名称:easywow,代码行数:5,
示例25: GetValue bool GetValue(size_t row, bool& value, bool force = false) const { return GetBool(row, value, force); }
开发者ID:timothyjlaurent,项目名称:nacl_blast,代码行数:4,
示例26: boolCESwitch::operator bool(){ return GetBool();}
开发者ID:Maximus5,项目名称:ConEmu,代码行数:4,
示例27: wxCHECK_MSGwxObject *wxToolBarXmlHandler::DoCreateResource(){ if (m_class == wxT("tool")) { wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: tool not within a toolbar!")); if (GetPosition() != wxDefaultPosition) { m_toolbar->AddTool(GetID(), GetBitmap(wxT("bitmap"), wxART_TOOLBAR), GetBitmap(wxT("bitmap2"), wxART_TOOLBAR), GetBool(wxT("toggle")), GetPosition().x, GetPosition().y, NULL, GetText(wxT("tooltip")), GetText(wxT("longhelp"))); } else { wxItemKind kind = wxITEM_NORMAL; if (GetBool(wxT("radio"))) kind = wxITEM_RADIO; if (GetBool(wxT("toggle"))) { wxASSERT_MSG( kind == wxITEM_NORMAL, _T("can't have both toggleable and radion button at once") ); kind = wxITEM_CHECK; } m_toolbar->AddTool(GetID(), GetText(wxT("label")), GetBitmap(wxT("bitmap"), wxART_TOOLBAR), GetBitmap(wxT("bitmap2"), wxART_TOOLBAR), kind, GetText(wxT("tooltip")), GetText(wxT("longhelp"))); if ( GetBool(wxT("disabled")) ) m_toolbar->EnableTool(GetID(), false); } return m_toolbar; // must return non-NULL } else if (m_class == wxT("separator")) { wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: separator not within a toolbar!")); m_toolbar->AddSeparator(); return m_toolbar; // must return non-NULL } else /*<object class="wxToolBar">*/ { int style = GetStyle(wxT("style"), wxNO_BORDER | wxTB_HORIZONTAL);#ifdef __WXMSW__ if (!(style & wxNO_BORDER)) style |= wxNO_BORDER;#endif XRC_MAKE_INSTANCE(toolbar, wxToolBar) toolbar->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), style, GetName()); wxSize bmpsize = GetSize(wxT("bitmapsize")); if (!(bmpsize == wxDefaultSize)) toolbar->SetToolBitmapSize(bmpsize); wxSize margins = GetSize(wxT("margins")); if (!(margins == wxDefaultSize)) toolbar->SetMargins(margins.x, margins.y); long packing = GetLong(wxT("packing"), -1); if (packing != -1) toolbar->SetToolPacking(packing); long separation = GetLong(wxT("separation"), -1); if (separation != -1) toolbar->SetToolSeparation(separation); if (HasParam(wxT("bg"))) toolbar->SetBackgroundColour(GetColour(wxT("bg"))); wxXmlNode *children_node = GetParamNode(wxT("object")); if (!children_node) children_node = GetParamNode(wxT("object_ref")); if (children_node == NULL) return toolbar; m_isInside = true; m_toolbar = toolbar; wxXmlNode *n = children_node; while (n) { if ((n->GetType() == wxXML_ELEMENT_NODE) && (n->GetName() == wxT("object") || n->GetName() == wxT("object_ref"))) { wxObject *created = CreateResFromNode(n, toolbar, NULL); wxControl *control = wxDynamicCast(created, wxControl); if (!IsOfClass(n, wxT("tool")) &&//.........这里部分代码省略.........
开发者ID:hgwells,项目名称:tive,代码行数:101,
注:本文中的GetBool函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetBoolFromConfig函数代码示例 C++ GetBonusHonorFromKill函数代码示例 |