Commit 53f5231c061b4a69f321c6b87c42faa46efdcc80
1 parent
3e218430
Support for child properties registration in FlexContainer
Change-Id: I12e45bcce115a5e78ca60bf88b1183f2bdebe873
Showing
1 changed file
with
3 additions
and
3 deletions
examples/flex-container/flex-container-example.cpp
| ... | ... | @@ -200,8 +200,8 @@ public: |
| 200 | 200 | |
| 201 | 201 | // Add a text label to the container for showing the recently updated flexbox property value |
| 202 | 202 | mFlexPropertyLabel = TextLabel::New( FLEX_DIRECTION[mCurrentFlexDirection] ); |
| 203 | - mFlexPropertyLabel.RegisterProperty("flexMargin", Vector4(10.0f, 10.0f, 10.0f, 10.0f), Property::READ_WRITE); | |
| 204 | - mFlexPropertyLabel.RegisterProperty("flex", 0.05f, Property::READ_WRITE); // 5 pecent of the container size in the main axis | |
| 203 | + mFlexPropertyLabel.SetProperty(FlexContainer::ChildProperty::FLEX_MARGIN, Vector4(10.0f, 10.0f, 10.0f, 10.0f)); | |
| 204 | + mFlexPropertyLabel.SetProperty(FlexContainer::ChildProperty::FLEX, 0.05f); // 5 pecent of the container size in the main axis | |
| 205 | 205 | mFlexPropertyLabel.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER"); |
| 206 | 206 | mFlexPropertyLabel.SetProperty(TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER"); |
| 207 | 207 | mFlexContainer.Add( mFlexPropertyLabel ); |
| ... | ... | @@ -211,9 +211,9 @@ public: |
| 211 | 211 | mFlexItemContainer.SetParentOrigin(ParentOrigin::TOP_LEFT); |
| 212 | 212 | mFlexItemContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT); |
| 213 | 213 | mFlexItemContainer.SetBackgroundColor( Color::YELLOW ); |
| 214 | - mFlexItemContainer.RegisterProperty("flex", 0.95f, Property::READ_WRITE); // 95 pecent of the container size in the main axis | |
| 215 | 214 | mFlexItemContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, mCurrentFlexDirection); |
| 216 | 215 | mFlexItemContainer.SetProperty(FlexContainer::Property::FLEX_WRAP, mCurrentFlexWrap); |
| 216 | + mFlexItemContainer.SetProperty(FlexContainer::ChildProperty::FLEX, 0.95f); // 95 pecent of the container size in the main axis | |
| 217 | 217 | mFlexContainer.Add(mFlexItemContainer); |
| 218 | 218 | |
| 219 | 219 | // Create flex items and add them to the container | ... | ... |