From e47266230939c74ce53471ab6e73112d86663cd8 Mon Sep 17 00:00:00 2001 From: Paul Wisbey Date: Tue, 17 Mar 2015 16:17:53 +0000 Subject: [PATCH] Minor TextField demo tweaks --- examples/text-field/edit-layout-impl.cpp | 2 ++ examples/text-field/text-field-example.cpp | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/text-field/edit-layout-impl.cpp b/examples/text-field/edit-layout-impl.cpp index 16e8146..f87550b 100644 --- a/examples/text-field/edit-layout-impl.cpp +++ b/examples/text-field/edit-layout-impl.cpp @@ -94,6 +94,8 @@ void EditLayout::OnRelayout( const Vector2& size, ActorSizeContainer& container float height = mTopPanel.GetHeightForWidth( panelWidth ); + mTopPanel.SetSize( Vector2(panelWidth, height) ); + container.push_back( ActorSizePair( mTopPanel, Vector2(panelWidth, height) ) ); } } diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp index 1ee882d..9940514 100644 --- a/examples/text-field/text-field-example.cpp +++ b/examples/text-field/text-field-example.cpp @@ -78,11 +78,10 @@ public: field.SetBackgroundColor( Color::BLACK ); layout.SetTopPanel( field ); - field.SetProperty( TextField::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" ); + field.SetProperty( TextField::Property::TEXT, "Hello" ); - // TODO - //Property::Value fieldText = field.GetProperty( TextField::Property::TEXT ); - //std::cout << "Got text from field: " << fieldText.Get< std::string >() << std::endl; + Property::Value fieldText = field.GetProperty( TextField::Property::TEXT ); + std::cout << "Displaying text: " << fieldText.Get< std::string >() << std::endl; } /** -- libgit2 0.21.4