本文整理汇总了C++中IProperty::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ IProperty::GetType方法的具体用法?C++ IProperty::GetType怎么用?C++ IProperty::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProperty
的用法示例。
在下文中一共展示了IProperty::GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSTRING
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();
}
示例2: GetFLOAT
float IPropertySet::GetFLOAT(const void* pData, int nIndex)
{
assert(nIndex>=0 && nIndex<PropertyCount());
if(nIndex<0 || nIndex>=PropertyCount()) return -1;
IProperty* pInfo = GetProperty(nIndex);
assert(pInfo->GetType()==PROPERTY_TYPE_FLOAT);
if(pInfo->GetType()!=PROPERTY_TYPE_FLOAT) return -1;
return *((float*)((char*)pData + pInfo->GetOffset()));
}
示例3: GetDWORD
unsigned int IPropertySet::GetDWORD(const void* pData, int nIndex)
{
assert(nIndex>=0 && nIndex<PropertyCount());
if(nIndex<0 || nIndex>=PropertyCount()) return -1;
IProperty* pInfo = GetProperty(nIndex);
assert(pInfo->GetType()==PROPERTY_TYPE_DWORD);
if(pInfo->GetType()!=PROPERTY_TYPE_DWORD) return -1;
return *((unsigned int*)((char*)pData + pInfo->GetOffset()));
}
示例4: SetValue
bool IPropertySet::SetValue(void* pData, int nIndex, char Value)
{
assert(nIndex>=0 && nIndex<PropertyCount());
if(nIndex<0 || nIndex>=PropertyCount()) return false;
IProperty* pInfo = GetProperty(nIndex);
assert(pInfo->GetType()==PROPERTY_TYPE_CHAR);
if(pInfo->GetType()!=PROPERTY_TYPE_CHAR) return false;
*((char*)((char*)pData + pInfo->GetOffset())) = Value;
return true;
}
示例5: 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;
}
示例6: OnEvent
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);
}
}