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


C++ IProperty类代码示例

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


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

示例1: assert

const char* IPropertySet::GetSTRING(const void* pData, int nIndex)
{
	assert(nIndex>=0 && nIndex<PropertyCount());
	if(nIndex<0 || nIndex>=PropertyCount()) return NULL;
	IProperty* pInfo = GetProperty(nIndex);
	assert(pInfo->GetType()==PROPERTY_TYPE_STRING);
	if(pInfo->GetType()!=PROPERTY_TYPE_STRING) return NULL;
	return (const char*)pData + pInfo->GetOffset();
}
开发者ID:EmuxEvans,项目名称:sailing,代码行数:9,代码来源:PropertySet.cpp

示例2: SetPropertyValue

	void IObject::SetPropertyValue(Core::IString Name,Core::IString Value)
	{
		IProperty *prop = m_aProperties.GetProperty(Name);

		if (prop)
		{
			prop->SetValueFromString(Value);
			OnPropertyChange(Name);
		}
	}
开发者ID:thennequin,项目名称:InitialProject,代码行数:10,代码来源:IObject.cpp

示例3: parent

void IProperty::setDirty(bool b)
{
	if (isFake()) {
		IProperty *p = parent();
		while (p != 0 && p->isFake())
			p = p->parent();
		if (p != 0)
			p->setDirty(true);
	} else {
		m_dirty = b;
	}
}
开发者ID:CharlieCraft,项目名称:axonengine,代码行数:12,代码来源:propertyeditor_items.cpp

示例4: CreateNewArchetype

int CGamesysManager::CreateNewArchetype(int donorArch, const char* name)
{
	int newArch = g_pObjSys->BeginCreate(donorArch, 2);

	g_pObjSys->NameObject(newArch, name);
	IProperty* donorProp = g_pPropMan->GetPropertyNamed("DonorType");

	if (donorProp->IsSimplyRelevant(donorArch))
	{
		donorProp->Copy(newArch, donorArch);
	}

	g_pObjSys->EndCreate(newArch);

	if (!newArch)
		Log.Print("acache: Failed to create %s.", name);

	return newArch;
}
开发者ID:adrikim,项目名称:thiefmp,代码行数:19,代码来源:Gamesys.cpp

示例5: Fill

//! fills the property with children - must be called after the array has been inserted to the property list
void wxArrayProperty::Fill(ArrayProperty* pProperty)
{
	s32 numProperties = pProperty->GetProperties().size();
	for(s32 i=0; i<numProperties; ++i)
	{
		IProperty* pSubProperty = pProperty->GetProperties()[i];

		std::stringstream ss;
		ss << "[" << i << "]";
		pSubProperty->SetName(ss.str());

		wxPGProperty* pWxProperty = PropertyList::GetWxProperty(pSubProperty, m_pParent);
		InsertChild(-1, pWxProperty);
		bool bParentDisabled = !GetGrid()->IsPropertyEnabled(this);
		if(bParentDisabled)
		{
			GetGrid()->DisableProperty(pWxProperty);
		}
	}

	UpdateValue();
}
开发者ID:aminere,项目名称:VLADHeavyStrikePublic,代码行数:23,代码来源:wxArrayProperty.cpp

示例6: GetNext

bool PropertyBag::GetNext(
   gubi::IProperty** ppProperty )
{
   bool bReturn = false;

   if (ppProperty != NULL && m_mapIterator != m_mapProperty.end())
   {
      IProperty* pProperty = m_mapIterator->second;

      if (pProperty != NULL)
      {
         pProperty->AddReference();
      }

      *ppProperty = pProperty;
      bReturn     = true;

      m_mapIterator++;
   }

   return bReturn;
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-CppCore-v2,代码行数:22,代码来源:PropertyBag.cpp

示例7: Find

bool PropertyBag::Find(
   const gubi::Identifier& ePropertyId,
   gubi::IProperty** ppProperty )
{
   bool bReturn              = false;
   property_map::iterator it = m_mapProperty.find(ePropertyId);

   if (ppProperty != NULL && it != m_mapProperty.end())
   {
      IProperty* pProperty = it->second;

      if (pProperty != NULL)
      {
         pProperty->AddReference();
      }

      *ppProperty = pProperty;
      bReturn     = true;
   }

   return bReturn;
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-CppCore-v2,代码行数:22,代码来源:PropertyBag.cpp

示例8: Stop

RESULT
Animation::BindTo( IProperty& property )
{
    RESULT rval = S_OK;
   
    if (property.IsNull())
    {
        SAFE_DELETE(m_pTargetProperty);
        m_isBoundToProperty = false;
        Stop();
        
        goto Exit;
    }

    
    if (property.GetType() != m_propertyType)
    {
        RETAILMSG(ZONE_ERROR, "ERROR: Animation::BindTo( \"%s\", 0x%x ): target Property type 0x%x incorrect for this Animation",
                  m_name.c_str(), (UINT32)&property, property.GetType());
        rval = E_INVALID_OPERATION;
        goto Exit;
    }
    

    SAFE_DELETE(m_pTargetProperty);
    m_pTargetProperty   = property.Clone();
    m_isBoundToProperty = true;    
    
    if (m_relativeToCurrentState)
    {
        // Save the target Property into our m_startingValue.
        // Keyframes will be interpolated, then added to m_startingValue to produce the final result.
        switch (m_keyFrameType)
        {
            case KEYFRAME_TYPE_UINT32:
                m_startingValue.SetIntValue( m_pTargetProperty->GetInteger() );
                break;
            case KEYFRAME_TYPE_FLOAT:
                m_startingValue.SetFloatValue( m_pTargetProperty->GetFloat() );
                break;
            case KEYFRAME_TYPE_VEC2:
                m_startingValue.SetVec2Value( m_pTargetProperty->GetVec2() );
                break;
            case KEYFRAME_TYPE_VEC3:
                m_startingValue.SetVec3Value( m_pTargetProperty->GetVec3() );
                break;
            case KEYFRAME_TYPE_VEC4:
                m_startingValue.SetVec4Value( m_pTargetProperty->GetVec4() );
                break;
            case KEYFRAME_TYPE_COLOR:
                m_startingValue.SetColorValue( m_pTargetProperty->GetColor() );
                break;
            default:
                DEBUGCHK(0);
                break;
        }
    }


Exit:
    return rval;
}
开发者ID:kabinud,项目名称:HappyGame,代码行数:62,代码来源:Animation.cpp

示例9: Service


//.........这里部分代码省略.........

      if ( type == "Converter" || type == "DataObject" ) {
        /// no Properties, so don't bother create Configurables...
        continue;
      }

      //if ( type == "ApplicationMgr" ) {
      ///  @FIXME: no Configurable for this component. yet...
      ///  continue;
      //}

      if ( !known ) {
        cout << "WARNING: Unknown (return) type [" << rtype << "] !!\n"
             << "WARNING: component [" << ident << "] is skipped !"
             << endl;
        allGood = false;
        continue;
      }

      string cname = "DefaultName";
      vector<void*>  args;
      args.reserve( 3 );
      if ( type == "AlgTool" ) {
        args.resize( 3 );
        args[0] = &cname;
        args[1] = &type;
        args[2] = dummySvc;
      }
      else {
        args.resize( 2 );
        args[0] = &cname;
        args[1] = svcLoc;
      }
      IProperty* prop = 0;
      try {
        if ( type == "Algorithm" ) {
          prop = makeInstance<IAlgorithm>(*it,args);
        }
        else if ( type == "Service") {
          prop = makeInstance<IService>(*it,args);
        }
        else if ( type == "AlgTool") {
          prop = makeInstance<IAlgTool>(*it,args);
        }
        else if ( type == "Auditor") {
          prop = makeInstance<IAuditor>(*it,args);
        }
        else if ( type == "ApplicationMgr") {
          //svcLoc->queryInterface(IProperty::interfaceID(), pp_cast<void>(&prop));
          svcLoc->queryInterface(IProperty::interfaceID(), (void**)(&prop));
        }
        else {
          prop = makeInstance<IInterface>(*it,args);
        }
      }
      catch ( exception& e ) {
        cout << "ERROR: Error instantiating " << name
             << " from " << *iLib << endl;
        cout << "ERROR: Got exception: " << e.what() << endl;
        allGood = false;
        continue;
      }
      catch ( ... ) {
        cout << "ERROR: Error instantiating " << name
             << " from " << *iLib << endl;
        allGood = false;
开发者ID:atlas-org,项目名称:gaudi,代码行数:67,代码来源:genconf.cpp

示例10: u32

bool wxArrayPropertyEditor::OnEvent( wxPropertyGrid* propGrid,
                                     wxPGProperty* property,
                                     wxWindow* ctrl,
                                     wxEvent& event ) const
{
    if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED )
    {
        wxPGMultiButton* buttons = (wxPGMultiButton*) propGrid->GetEditorControlSecondary();
		wxArrayProperty* pArrayProperty = static_cast<wxArrayProperty*>(property);

		if(event.GetId() == buttons->GetButtonId(0)) // + - add element
		{
			if(pArrayProperty->GetMaxElems() < 0
			|| pArrayProperty->GetChildCount() < u32(pArrayProperty->GetMaxElems()))
			{
				// determine new property name
				IProperty* pNewProperty = pArrayProperty->GetSubPropertyTemplate();
				std::stringstream ss;
				ss << "[" << property->GetChildCount() << "]";
				pNewProperty->SetName(ss.str());

				// create a new wxPGProperty out of it and insert it
				wxPGProperty* pWxProperty = PropertyList::GetWxProperty(pNewProperty, pArrayProperty->GetParent());
				property->InsertChild(-1, pWxProperty);

				if(pNewProperty->GetType() == PT_Reference)
				{
					pArrayProperty->GetParent()->FillArrayProperties(pNewProperty, pWxProperty);	
				}

				pArrayProperty->UpdateValue();
				propGrid->RefreshProperty(property);			

				// update the corresponding property in the property stream
				wxPropertyGridEvent PGEvent;
				PGEvent.SetProperty(property);
				pArrayProperty->SetEventType(wxArrayProperty::E_PropertyAdded);
				pArrayProperty->GetParent()->OnPropertyGridChange(PGEvent);
			}			
		}	
		else if(event.GetId() == buttons->GetButtonId(1)) // - remove element
		{
			int childCount = property->GetChildCount();
			if(childCount > 0)
			{
				// remove the wx property
				wxPGProperty* pChild = property->Item(childCount-1);
				propGrid->DeleteProperty(pChild);	
				pArrayProperty->UpdateValue();
				propGrid->RefreshProperty(property);

				// update the corresponding property in the property stream
				wxPropertyGridEvent PGEvent;
				PGEvent.SetProperty(property);
				pArrayProperty->SetEventType(wxArrayProperty::E_PropertyRemoved);
				pArrayProperty->GetParent()->OnPropertyGridChange(PGEvent);
			}
		}

		return true;
    }
	else
	{
		return wxPGTextCtrlEditor::OnEvent(propGrid, property, ctrl, event);
	}    
}
开发者ID:aminere,项目名称:VLADHeavyStrikePublic,代码行数:66,代码来源:wxArrayProperty.cpp

示例11: SetMsgHandled

LRESULT 
CAppOptAdvancedPage::OnTreeNotify(LPNMHDR pnmh)
{
	BOOL fSuccess = FALSE;
	// pnmh->hwndFrom;
	
	if (IDC_OPTION_TREE != pnmh->idFrom) {
		// ignore other notification
		SetMsgHandled(FALSE);
		return TRUE;
	}

	if (PIN_ITEMCHANGING != pnmh->code) {
		// ignore notifications other than PIN_CLICK
		SetMsgHandled(FALSE);
		return TRUE;
	}

	LPNMPROPERTYITEM pnmProp = reinterpret_cast<LPNMPROPERTYITEM>(pnmh);
	if (NULL == pnmProp->prop) {
		SetMsgHandled(FALSE);
		return TRUE;
	}

	IProperty* prop = pnmProp->prop;

	if (NDASSVC_SUSPEND_ALLOW == prop->GetItemData())
	{
		VARIANT varValue;
		::VariantInit(&varValue);
		fSuccess = prop->GetValue(&varValue);
		ATLASSERT(fSuccess);
		ATLASSERT(varValue.vt = VT_BOOL);
		if (!fSuccess || VT_BOOL != varValue.vt) {
			::VariantClear(&varValue);
			SetMsgHandled(FALSE);
			return TRUE;
		}

		//
		// Ignore the status of already checked.
		//
		if (varValue.boolVal) {
			::VariantClear(&varValue);
			SetMsgHandled(FALSE);
			return TRUE;
		}
		::VariantClear(&varValue);

		int response = AtlMessageBox(
			m_hWnd,
			IDS_SUSPEND_WARNING,
			IDS_MAIN_TITLE,
			MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2);

		if (IDYES != response) 
		{
			SetMsgHandled(TRUE);
			return TRUE;
		}
	}

	SetMsgHandled(FALSE);
	return TRUE;
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:65,代码来源:optionpsh.cpp


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