當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetBool函數代碼示例

本文整理匯總了C++中GetBool函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetBool函數的具體用法?C++ GetBool怎麽用?C++ GetBool使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetBool函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: XRC_MAKE_INSTANCE

wxObject * 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,代碼來源:glue.cpp

示例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,代碼來源:ConfigManager.cpp

示例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,代碼來源:dmk_generator.cpp

示例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,代碼來源:mpIValue.cpp

示例5: GetString

void 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,代碼來源:ApplinkDialog.cpp

示例6: GetBool

bool 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,代碼來源:GetAllMenuCommands.cpp

示例7: GetString

bool 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,代碼來源:OpenSaveCommands.cpp

示例8: switch

std::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,代碼來源:Json.cpp

示例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,代碼來源:DefineVoxelHandler.cpp

示例10: LOGI

int 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,代碼來源:Preferences.cpp

示例11: XRC_MAKE_INSTANCE

wxObject *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,代碼來源:xh_kwxangularmeterhandler.cpp

示例12: CreateFrame

wxObject *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,代碼來源:xh_mdi.cpp

示例13: XRC_MAKE_INSTANCE

wxObject *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,代碼來源:xh_radbt.cpp

示例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,代碼來源:Peephole.cpp

示例15: XRC_MAKE_INSTANCE

wxObject *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,代碼來源:xh_bmpbt.cpp


注:本文中的GetBool函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。