+ Popup CreatePopup()
+ {
+ Popup popup = Popup::New();
+ popup.SetParentOrigin( ParentOrigin::CENTER );
+ popup.SetAnchorPoint( AnchorPoint::CENTER );
+ popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH );
+ popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
+ popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched );
+
+ return popup;
+ }
+
+ void OnPopupOutsideTouched()
+ {
+ // Update the folder text
+ if( mButton && mField )
+ {
+ Property::Value text = mField.GetProperty( TextField::Property::TEXT );
+ mButtonLabel = text.Get< std::string >();
+ mButton.SetProperty( Toolkit::Button::Property::LABEL, mButtonLabel );
+ }
+
+ // Hide & discard the pop-up
+ if( mPopup )
+ {
+ mPopup.SetDisplayState( Popup::HIDDEN );
+ }
+ mField.Reset();
+ }