本文整理汇总了C++中LabelPtr::ReferencesObject方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelPtr::ReferencesObject方法的具体用法?C++ LabelPtr::ReferencesObject怎么用?C++ LabelPtr::ReferencesObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelPtr
的用法示例。
在下文中一共展示了LabelPtr::ReferencesObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InterpretFilePathField
//.........这里部分代码省略.........
editButton->a_HelpText.Set( TXT( "Attempt to edit the file using its associated default application." ) );
container->AddChild( editButton );
}
}
}
else
{
ValuePtr value = CreateControl< Value >();
value->a_IsReadOnly.Set( readOnly );
value->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
container->AddChild( value );
}
//
// Setup label
//
LabelPtr label = NULL;
{
std::vector< ControlPtr >::const_iterator itr = container->GetChildren().begin();
std::vector< ControlPtr >::const_iterator end = container->GetChildren().end();
for( ; itr != end; ++itr )
{
Label* label = Reflect::SafeCast<Label>( *itr );
if (label)
{
break;
}
}
}
if (!label.ReferencesObject())
{
label = CreateControl< Label >();
std::string temp;
field->GetProperty( TXT( "UIName" ), temp );
if ( temp.empty() )
{
bool converted = Helium::ConvertString( field->m_Name, temp );
HELIUM_ASSERT( converted );
}
label->BindText( temp );
label->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
container->InsertChild(0, label);
}
//
// Create type m_FinderSpecific data bound to this and additional objects
//
std::vector<Data*> datas;
{
std::vector<Reflect::Object*>::const_iterator itr = objects.begin();
std::vector<Reflect::Object*>::const_iterator end = objects.end();
for ( ; itr != end; ++itr )
{
Data s = field->CreateData();
if (s->IsA(Reflect::GetMetaClass<ContainerData>()))
{
示例2: InterpretField
void ReflectValueInterpreter::InterpretField(const Field* field, const std::vector<Reflect::Object*>& instances, Container* parent)
{
if (field->m_Flags & FieldFlags::Hide)
{
return;
}
//
// Create the ui we are generating
//
ContainerPtr container = CreateControl<Container>();
bool readOnly = ( field->m_Flags & FieldFlags::ReadOnly ) == FieldFlags::ReadOnly;
//
// Parse
//
tstring fieldUI;
field->GetProperty( TXT( "UIScript" ), fieldUI );
bool result = Script::Parse(fieldUI, this, parent->GetCanvas(), container, field->m_Flags);
if (!result)
{
if ( field->m_DataClass == Reflect::GetClass<EnumerationData>() )
{
ChoicePtr choice = CreateControl<Choice>();
const Reflect::Enumeration* enumeration = Reflect::ReflectionCast< Enumeration >( field->m_Type );
std::vector< ChoiceItem > items;
items.resize( enumeration->m_Elements.GetSize() );
DynArray< EnumerationElement >::ConstIterator itr = enumeration->m_Elements.Begin();
DynArray< EnumerationElement >::ConstIterator end = enumeration->m_Elements.End();
for ( size_t index=0; itr != end; ++itr, ++index )
{
ChoiceItem& item = items[index];
item.m_Key = itr->m_Name;
item.m_Data = itr->m_Name;
}
choice->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
choice->a_Items.Set( items );
choice->a_IsDropDown.Set( true );
choice->a_IsReadOnly.Set( readOnly );
container->AddChild(choice);
}
else
{
if ( field->m_DataClass == Reflect::GetClass<BoolData>() )
{
CheckBoxPtr checkBox = CreateControl<CheckBox>();
checkBox->a_IsReadOnly.Set( readOnly );
checkBox->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
container->AddChild( checkBox );
}
else
{
ValuePtr value = CreateControl<Value>();
value->a_IsReadOnly.Set( readOnly );
value->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
container->AddChild( value );
}
}
}
//
// Setup label
//
LabelPtr label = NULL;
{
V_Control::const_iterator itr = container->GetChildren().begin();
V_Control::const_iterator end = container->GetChildren().end();
for( ; itr != end; ++itr )
{
Label* label = Reflect::SafeCast<Label>( *itr );
if (label)
{
break;
}
}
}
if (!label.ReferencesObject())
{
label = CreateControl<Label>();
tstring temp;
field->GetProperty( TXT( "UIName" ), temp );
if ( temp.empty() )
{
bool converted = Helium::ConvertString( field->m_Name, temp );
HELIUM_ASSERT( converted );
}
//.........这里部分代码省略.........
示例3: InterpretValueField
void ReflectInterpreter::InterpretValueField( const std::vector< Reflect::Pointer >& pointers, Reflect::Translator* translator, const Field* field, Container* parent )
{
if (field->m_Flags & FieldFlags::Hide)
{
return;
}
//
// Create the ui we are generating
//
ContainerPtr container = CreateControl<Container>();
bool readOnly = ( field->m_Flags & FieldFlags::ReadOnly ) == FieldFlags::ReadOnly;
if ( field->m_ValueType && field->m_ValueType->IsA( MetaIds::MetaEnum ) )
{
const Reflect::MetaEnum* enumeration = Reflect::ReflectionCast< MetaEnum >( field->m_ValueType );
ChoicePtr choice = CreateControl<Choice>();
std::vector< ChoiceItem > items;
items.resize( enumeration->m_Elements.GetSize() );
DynamicArray< MetaEnum::Element >::ConstIterator itr = enumeration->m_Elements.Begin();
DynamicArray< MetaEnum::Element >::ConstIterator end = enumeration->m_Elements.End();
for ( size_t index=0; itr != end; ++itr, ++index )
{
ChoiceItem& item = items[index];
item.m_Key = itr->m_Name;
item.m_Data = itr->m_Name;
}
choice->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
choice->a_Items.Set( items );
choice->a_IsDropDown.Set( true );
choice->a_IsReadOnly.Set( readOnly );
container->AddChild(choice);
}
else
{
ScalarTranslator* scalar = ReflectionCast< ScalarTranslator >( field->m_Translator );
if ( scalar && scalar->m_Type == ScalarTypes::Boolean )
{
CheckBoxPtr checkBox = CreateControl<CheckBox>();
checkBox->a_IsReadOnly.Set( readOnly );
checkBox->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
container->AddChild( checkBox );
}
else
{
ValuePtr value = CreateControl<Value>();
value->a_IsReadOnly.Set( readOnly );
value->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
container->AddChild( value );
}
}
//
// Setup label
//
LabelPtr label = NULL;
{
std::vector< ControlPtr >::const_iterator itr = container->GetChildren().begin();
std::vector< ControlPtr >::const_iterator end = container->GetChildren().end();
for( ; itr != end; ++itr )
{
Label* label = Reflect::SafeCast<Label>( *itr );
if (label)
{
break;
}
}
}
if (!label.ReferencesObject())
{
label = CreateControl<Label>();
std::string temp;
field->GetProperty( TXT( "UIName" ), temp );
if ( temp.empty() )
{
bool converted = Helium::ConvertString( field->m_Name, temp );
HELIUM_ASSERT( converted );
}
label->BindText( temp );
label->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
container->InsertChild(0, label);
}
//
// Bind data
//
//.........这里部分代码省略.........