Commit e47266230939c74ce53471ab6e73112d86663cd8

Authored by Paul Wisbey
1 parent c0cf48f4

Minor TextField demo tweaks

Change-Id: I092baac3133471d94aa62109548a745a74b037e0
examples/text-field/edit-layout-impl.cpp
... ... @@ -94,6 +94,8 @@ void EditLayout::OnRelayout( const Vector2& size, ActorSizeContainer& container
94 94  
95 95 float height = mTopPanel.GetHeightForWidth( panelWidth );
96 96  
  97 + mTopPanel.SetSize( Vector2(panelWidth, height) );
  98 +
97 99 container.push_back( ActorSizePair( mTopPanel, Vector2(panelWidth, height) ) );
98 100 }
99 101 }
... ...
examples/text-field/text-field-example.cpp
... ... @@ -78,11 +78,10 @@ public:
78 78 field.SetBackgroundColor( Color::BLACK );
79 79 layout.SetTopPanel( field );
80 80  
81   - field.SetProperty( TextField::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" );
  81 + field.SetProperty( TextField::Property::TEXT, "Hello" );
82 82  
83   - // TODO
84   - //Property::Value fieldText = field.GetProperty( TextField::Property::TEXT );
85   - //std::cout << "Got text from field: " << fieldText.Get< std::string >() << std::endl;
  83 + Property::Value fieldText = field.GetProperty( TextField::Property::TEXT );
  84 + std::cout << "Displaying text: " << fieldText.Get< std::string >() << std::endl;
86 85 }
87 86  
88 87 /**
... ...