- // TODO
- //Property::Value fieldText = field.GetProperty( TextField::PROPERTY_TEXT );
- //std::cout << "Got text from field: " << fieldText.Get< std::string >() << std::endl;
+ void OnPopupOutsideTouched()
+ {
+ // Update the folder text
+ if( mButton && mField )
+ {
+ Property::Value text = mField.GetProperty( TextField::Property::TEXT );
+ mButtonLabel = text.Get< std::string >();
+ mButton.SetLabelText( mButtonLabel );
+ }
+
+ // Hide & discard the pop-up
+ if( mPopup )
+ {
+ mPopup.SetDisplayState( Popup::HIDDEN );
+ }
+ mField.Reset();
+ }
+
+ bool OnPopupTouched( Actor actor, const TouchData& event )
+ {
+ // End edit mode for TextField if parent Popup touched.
+ if(event.GetPointCount() > 0)
+ {
+ switch( event.GetState( 0 ) )
+ {
+ case PointState::DOWN:
+ {
+ // Update the folder text and lose focus for Key events
+ if( mButton && mField )
+ {
+ Property::Value text = mField.GetProperty( TextField::Property::TEXT );
+ mButtonLabel = text.Get< std::string >();
+ mButton.SetLabelText( mButtonLabel );
+ mField.ClearKeyInputFocus();
+ }
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ } // end switch
+ }
+
+ return true;