当前位置: 首页>>代码示例>>C++>>正文


C++ SetBool函数代码示例

本文整理汇总了C++中SetBool函数的典型用法代码示例。如果您正苦于以下问题:C++ SetBool函数的具体用法?C++ SetBool怎么用?C++ SetBool使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetBool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetBool

/*********************************************************************\
	Function name    : CCustomSubDialog::InitValues
	Description      :
	Created at       : 27.03.02, @ 12:07:33
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool CCustomSubDialog::InitValues(void)
{
    Int32 lID = FIRST_CUSTOM_ELEMENT_ID;
    Int32 i;

    CCustomElements* pElement = g_pCustomElements->GetItem(m_pElement->m_lElement);
    if (!pElement) return true;

    if (!m_pElement->m_pbcGUI) return true;
    BaseContainer* pBC = &m_pElement->m_pbcGUI[m_pElement->m_lElement];

    SetBool(IDC_CUSTOM_OPEN_CLOSE, pElement->m_bIsOpen);

    for (i = 0; m_pProp && m_pProp[i].type != CUSTOMTYPE_END; i++, lID++)
    {
        CustomProperty* pProp = &pElement->m_pProp[i];

        if (pProp->type == CUSTOMTYPE_FLAG) SetBool(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_LONG) SetInt32(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_REAL) SetFloat(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_STRING) SetString(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_VECTOR)
        {
            Vector v = pBC->GetVector(pProp->id);
            SetFloat(lID++,v.x);
            SetFloat(lID++,v.y);
            SetFloat(lID,v.z);
        }
    }

    return true;
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:39,代码来源:DialogCustomElement.cpp

示例2: switch

/////////////////////////////////////////////////////////
// Resets a value with a string, preserving current type
void VariableData::ResetWith(wxString value) {
	switch (type) {
		case VARDATA_INT: {
			long temp = 0;
			value.ToLong(&temp);
			SetInt(temp);
			break;
		}
		case VARDATA_FLOAT: {
			double temp = 0;
			value.ToDouble(&temp);
			SetFloat(temp);
			break;
		}
		case VARDATA_BOOL:
			if (value == _T("1")) SetBool(true);
			else SetBool(false);
			break;
		case VARDATA_COLOUR: {
			long r=0,g=0,b=0;
			value.Mid(1,2).ToLong(&r,16);
			value.Mid(3,2).ToLong(&g,16);
			value.Mid(5,2).ToLong(&b,16);
			SetColour(wxColour(r,g,b));
			break;
		}
		default:
			SetText(value);
			break;
	}
}
开发者ID:BackupTheBerlios,项目名称:aegisub-svn,代码行数:33,代码来源:variable_data.cpp

示例3: SetBool

void
QvisLegendAttributesInterface::orientationChanged(int orientation)
{
    SetBool(LEGEND_ORIENTATION0, (orientation==2 || orientation==3) );
    SetBool(LEGEND_ORIENTATION1, (orientation==1 || orientation==3) );
    SetUpdate(false);
    Apply();
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:8,代码来源:QvisLegendAttributesInterface.C

示例4: prEvent_IsRest

int prEvent_IsRest(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *dictslots = slotRawObject(g->sp)->slots;
	PyrSlot *arraySlot = dictslots + ivxIdentDict_array;

	if (isKindOfSlot(arraySlot, class_array)) {
		PyrSlot key, typeSlot;
		static PyrSymbol *s_type = getsym("type");
		static PyrSymbol *s_rest = getsym("rest");
		PyrSymbol *typeSym;
		// test 'this[\type] == \rest' first
		SetSymbol(&key, s_type);
		identDict_lookup(slotRawObject(g->sp), &key, calcHash(&key), &typeSlot);
		if(!slotSymbolVal(&typeSlot, &typeSym) && typeSym == s_rest) {
			SetBool(g->sp, 1);
			return errNone;
		} else {
			PyrObject *array = slotRawObject(arraySlot);
			PyrSymbol *slotSym;
			static PyrSymbol *s_empty = getsym("");
			static PyrSymbol *s_r = getsym("r");
			static PyrClass *class_rest = getsym("Rest")->u.classobj;
			static PyrClass *class_metarest = getsym("Meta_Rest")->u.classobj;
			PyrSlot *slot;
			int32 size = array->size;
			int32 i;

			slot = array->slots + 1;  // scan only the odd items

			for (i = 1; i < size; i += 2, slot += 2) {
				if (isKindOfSlot(slot, class_rest)
				    || isKindOfSlot(slot, class_metarest)
				) {
					SetBool(g->sp, 1);
					return errNone;
				} else if(!slotSymbolVal(slot, &slotSym)) {
					if(slotSym == s_empty
						|| slotSym == s_r
						|| slotSym == s_rest
					) {
						SetBool(g->sp, 1);
						return errNone;
					}
				}  // why no 'else'?
				// slotSymbolVal nonzero return = not a symbol;
				// non-symbols don't indicate rests, so, ignore them.
			}
		}
	} else {
		return errWrongType;
	}

	SetBool(g->sp, 0);
	return errNone;
}
开发者ID:fsateler,项目名称:supercollider,代码行数:55,代码来源:PyrListPrim.cpp

示例5: SetNumber

FormLayout::FormLayout()
{
	SetNumber("Form.Width",  400);
	SetNumber("Form.Height", 300);

	SetBool("Form.MaximizeBox", false);
	SetBool("Form.MinimizeBox", false);
	SetBool("Form.Sizeable",    false);
	SetBool("Form.ToolWindow",  false);

	Set("Form.Name", t_("Noname"));

	SetPageRect( Rect(Point(10, 10), Size(400, 300)) );
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:14,代码来源:FormLayout.cpp

示例6: _Init

/*********************************************************************\
	Function name    : CArrowSettings::SetData
	Description      :
	Created at       : 12.08.01, @ 21:55:29
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CArrowSettings::SetData()
{
	_Init();

	SetBool(IDS_ARROW_SMALL_CHK, m_pArrow->m_lArrowType > 4);
	Int32 l = m_pArrow->m_lArrowType;
	if (l > 4) l -= 4;
	SetInt32(IDS_ARROW_TYPE_COMBO, l - 1);
	SetBool(IDC_IS_POPUP_CHK, m_pArrow->m_bIsPopupButton);
	Enable(IDS_ARROW_SMALL_CHK, !m_pArrow->m_bIsPopupButton);
	Enable(IDS_ARROW_TYPE_COMBO, !m_pArrow->m_bIsPopupButton);
	Enable(IDC_ARROW_CHILD_ITEMS, m_pArrow->m_bIsPopupButton);

	m_pArrow->m_Children.FillEditBox(m_pSettingsDialog, IDC_ARROW_CHILD_ITEMS);
}
开发者ID:phohale,项目名称:ResEdit,代码行数:22,代码来源:DialogArrow.cpp

示例7: SetBool

void CXTPPropertyGridItemBool::OnBeforeInsert()
{
	if (m_pBindBool && *m_pBindBool != m_bValue)
	{
		SetBool(*m_pBindBool);
	}
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:7,代码来源:XTPPropertyGridItemBool.cpp

示例8: switch

/*************************************
 * operator =
 *************************************/
SHVDataVariant& SHVDataVariantImpl::operator=(const SHVDataVariant& val)
{
	switch (val.GetDataType())
	{
		case SHVDataVariant::TypeInt:
			SetInt(val.AsInt());
			break;
		case SHVDataVariant::TypeInt64:
			SetInt64(val.AsInt64());
			break;
		case SHVDataVariant::TypeBool:
			SetBool(val.AsBool());
			break;
		case SHVDataVariant::TypeDouble:
			SetDouble(val.AsDouble());
			break;
		case SHVDataVariant::TypeString:
			SetString(val.AsString());
			break;
		case SHVDataVariant::TypeTime:
			SetTime(val.AsTime());
			break;
	}
	return *this;
}
开发者ID:ElmerFuddDK,项目名称:libshiva,代码行数:28,代码来源:shvdatavariantimpl.cpp

示例9: switch

PListValue& PListValue::operator =(const PListValue& rhs)
{
    switch (rhs.type_)
    {
    case PLVT_NONE:
        Reset();
        break;
    case PLVT_INT:
        SetInt(rhs.int_);
        break;
    case PLVT_BOOL:
        SetBool(rhs.bool_);
        break;
    case PLVT_FLOAT:
        SetFloat(rhs.float_);
        break;
    case PLVT_STRING:
        SetString(*rhs.string_);
        break;
    case PLVT_VALUEMAP:
        SetValueMap(*rhs.valueMap_);
        break;
    case PLVT_VALUEVECTOR:
        SetValueVector(*rhs.valueVector_);
        break;
    }

    return *this;
}
开发者ID:03050903,项目名称:Urho3D,代码行数:29,代码来源:PListFile.cpp

示例10: GetBool

void ApplinkDialog::Timer(const BaseContainer &msg)
{
	Bool b;
	GetBool(IDC_CHK_PROMPT, b);
	if(b)
	{
		Filename fn;
		fn.SetDirectory(gPreferences.GetString(IDC_EXCH_FOLDER));
		fn.SetFile("export.txt");
        
		if(GeFExist(fn))
		{
			GePrint("File exists!");
			SetTimer(0);
			if(GeOutString("To import a new object?", GEMB_OKCANCEL) == GEMB_R_OK)
			{
				GePrint("Start import!");
				BaseDocument* doc = GetActiveDocument();
				ApplinkImporter* importer = NewObjClear(ApplinkImporter);
				importer->Execute(doc, &gPreferences);
				SetTimer(1000);
			}
			else
			{
				SetBool(IDC_CHK_PROMPT, false);
			}
		}
	}
}
开发者ID:sshumihin,项目名称:3DCoat_Applinks,代码行数:29,代码来源:ApplinkDialog.cpp

示例11: avtAnnotationColleague

avtLegendAttributesColleague::avtLegendAttributesColleague(
    VisWindowColleagueProxy &m) : avtAnnotationColleague(m), atts()
{
    // Populate atts with some legend defaults.
    SetBool(atts, LEGEND_MANAGE_POSITION,  true);
    SetBool(atts, LEGEND_DRAW_BOX,         false);
    SetBool(atts, LEGEND_DRAW_LABELS,      false);
    SetBool(atts, LEGEND_ORIENTATION0,     false);
    SetBool(atts, LEGEND_ORIENTATION1,     false);
    SetBool(atts, LEGEND_DRAW_TITLE,       true);
    SetBool(atts, LEGEND_DRAW_MINMAX,      true);
    SetBool(atts, LEGEND_CONTROL_TICKS,    true);
    SetBool(atts, LEGEND_MINMAX_INCLUSIVE, true);
    SetBool(atts, LEGEND_DRAW_VALUES,      true);

    // Set the format string for the legend into the text.
    stringVector text;
    text.push_back("%# -9.4g");
    atts.SetText(text);

    // Set the default position.
    const double defaultPosition[2] = {0.05, 0.9};
    atts.SetPosition(defaultPosition);

    // Set the default scale.
    const double defaultScale[2] = {1.,1.};
    atts.SetPosition2(defaultScale);

    // Set the default font height.
    atts.SetDoubleAttribute1(0.015);

    // Set the default bounding box color.
    atts.SetColor1(ColorAttribute(0,0,0,50));

    // Set the default font properties.
    atts.SetFontFamily(AnnotationObject::Arial);
    atts.SetFontBold(false);
    atts.SetFontItalic(false);
    atts.SetFontShadow(false);

    // Set the default number of ticks 
    atts.SetIntAttribute2(5);

    // Set the default legend type to variable
    atts.SetIntAttribute3(0);
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:46,代码来源:avtLegendAttributesColleague.C

示例12: ScIDE_Connected

int ScIDE_Connected(struct VMGlobals *g, int numArgsPushed)
{
    PyrSlot * returnSlot = g->sp - numArgsPushed + 1;

    SetBool(returnSlot, gIpcClient != 0);

    return errNone;
}
开发者ID:8c6794b6,项目名称:supercollider,代码行数:8,代码来源:sc_ipc_client.cpp

示例13: SetBool

Bool CSearchDialog::InitValues()
{
	if (!GeDialog::InitValues()) return false;

	SetBool(IDC_SEARCH_REG_EXPR_CHK, m_bRegExpr);
	SetString(IDC_SEARCH_EDIT, m_strText);

	return true;
}
开发者ID:phohale,项目名称:ResEdit,代码行数:9,代码来源:SearchDialog.cpp

示例14: lock

bool CSettingsManager::ToggleBool(const std::string &id)
{
  CSharedLock lock(m_settingsCritical);
  CSetting *setting = GetSetting(id);
  if (setting == NULL || setting->GetType() != SettingTypeBool)
    return false;

  return SetBool(id, !((CSettingBool*)setting)->GetValue());
}
开发者ID:Anankin,项目名称:xbmc,代码行数:9,代码来源:SettingsManager.cpp

示例15: InitValues

  Bool InitValues()
  {
    // Initialize the force items.
    FreeChildren(CMB_FORCE);
    AddForceCycleElement(ID_SPRING);
    AddForceCycleElement(ID_CONNECTOR);
    AddForceCycleElement(ID_MOTOR);
    SetInt32(CMB_FORCE, ID_CONNECTOR);

    SetInt32(CMB_TYPE, -1);
    SetInt32(CMB_MODE, CMB_MODE_ALL);
    SetInt32(EDT_MAXCONN, 0, 0, 20, 1, false, 0, LIMIT<Int32>::MAX);
    SetFloat(EDT_RADIUS, (Float) 0, 0, 500, 1.0, FORMAT_METER, 0, MAXVALUE_FLOAT, false, false);

    SetBool(CHK_ADDDYNAMICS, false);
    SetBool(CHK_COMPOUND, false);
    SetBool(CHK_CLOSED, false);

    UpdateGadgets(true);
    return super::InitValues();
  }
开发者ID:nr-plugins,项目名称:auto-connect,代码行数:21,代码来源:main.cpp


注:本文中的SetBool函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。