Adding Selection Markers to TextField 86/45486/5
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 5 Aug 2015 09:36:48 +0000 (10:36 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 6 Aug 2015 17:36:41 +0000 (18:36 +0100)
* Selection Markers if specified in json style file whill add a upper left image and upper right image to the selection handle.
 They can be on the same level as the text and stretch to it's height.

* Image Handle Properties for decorations changed from string to Map as string did not work. Control used MAP for background-image.

* Updated TCT cases for testing Handle Images

Change-Id: I2df31baa4a1c6fe5a34b437532c46393b4d6aee3
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
dali-toolkit/images/selection_marker_left.png [new file with mode: 0644]
dali-toolkit/images/selection_marker_right.png [new file with mode: 0644]
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/decorator/text-decorator.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/public-api/controls/text-controls/text-field.h
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json

index b8fd9db..6e620eb 100644 (file)
@@ -259,6 +259,24 @@ int UtcDaliTextFieldGetPropertyP(void)
   END_TEST;
 }
 
+bool SetPropertyMapRetreived( TextField& field, const Property::Index property, const std::string mapKey, const std::string mapValue )
+{
+  bool result = false;
+  Property::Map imageMap;
+  imageMap[mapKey] =mapValue;
+
+  field.SetProperty( property , imageMap );
+  Property::Value propValue = field.GetProperty( property );
+  Property::Map* resultMap = propValue.GetMap();
+
+  if ( resultMap->Find( mapKey )->Get< std::string>() == mapValue )
+  {
+    result = true;
+  }
+
+  return result;
+}
+
 // Positive test case for a method
 int UtcDaliTextFieldSetPropertyP(void)
 {
@@ -266,6 +284,7 @@ int UtcDaliTextFieldSetPropertyP(void)
   tet_infoline(" UtcDaliToolkitTextFieldSetPropertyP");
   TextField field = TextField::New();
   DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
 
   // Note - we can't check the defaults since the stylesheets are platform-specific
 
@@ -345,13 +364,14 @@ int UtcDaliTextFieldSetPropertyP(void)
   field.SetProperty( TextField::Property::GRAB_HANDLE_PRESSED_IMAGE, "image2" );
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::GRAB_HANDLE_PRESSED_IMAGE ), "image2", TEST_LOCATION );
   field.SetProperty( TextField::Property::SELECTION_HANDLE_IMAGE_LEFT, "image3" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::SELECTION_HANDLE_IMAGE_LEFT ), "image3", TEST_LOCATION );
-  field.SetProperty( TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT, "image4" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT ), "image4", TEST_LOCATION );
-  field.SetProperty( TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, "image5" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT ), "image5", TEST_LOCATION );
-  field.SetProperty( TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, "image6" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT ), "image6", TEST_LOCATION );
+
+  // Check handle images
+  DALI_TEST_CHECK( SetPropertyMapRetreived( field, TextField::Property::SELECTION_HANDLE_IMAGE_LEFT, "filename", "leftHandleImage" )  );
+  DALI_TEST_CHECK( SetPropertyMapRetreived( field, TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT, "filename", "rightHandleImage" )  );
+  DALI_TEST_CHECK( SetPropertyMapRetreived( field, TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, "filename", "leftHandleImagePressed" )  );
+  DALI_TEST_CHECK( SetPropertyMapRetreived( field, TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, "filename", "rightHandleImagePressed" )  );
+  DALI_TEST_CHECK( SetPropertyMapRetreived( field, TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT, "filename", "leftHandleMarkerImage" )  );
+  DALI_TEST_CHECK( SetPropertyMapRetreived( field, TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT, "filename", "rightHandleMarkerImage" )  );
 
   // Check the highlight color
   field.SetProperty( TextField::Property::SELECTION_HIGHLIGHT_COLOR, Color::GREEN );
diff --git a/dali-toolkit/images/selection_marker_left.png b/dali-toolkit/images/selection_marker_left.png
new file mode 100644 (file)
index 0000000..3472053
Binary files /dev/null and b/dali-toolkit/images/selection_marker_left.png differ
diff --git a/dali-toolkit/images/selection_marker_right.png b/dali-toolkit/images/selection_marker_right.png
new file mode 100644 (file)
index 0000000..cd41114
Binary files /dev/null and b/dali-toolkit/images/selection_marker_right.png differ
index 5c72c40..3ec2280 100644 (file)
@@ -112,10 +112,12 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-image",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-pressed-image",            STRING,    GRAB_HANDLE_PRESSED_IMAGE            )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-threshold",                     FLOAT,     SCROLL_THRESHOLD                     )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-speed",                         FLOAT,     SCROLL_SPEED                         )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left",          STRING,    SELECTION_HANDLE_IMAGE_LEFT          )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right",         STRING,    SELECTION_HANDLE_IMAGE_RIGHT         )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left",  STRING,    SELECTION_HANDLE_PRESSED_IMAGE_LEFT  )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING,    SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left",          MAP,       SELECTION_HANDLE_IMAGE_LEFT          )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right",         MAP,       SELECTION_HANDLE_IMAGE_RIGHT         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left",  MAP,       SELECTION_HANDLE_PRESSED_IMAGE_LEFT  )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", MAP,       SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-marker-image-left",   MAP,       SELECTION_HANDLE_MARKER_IMAGE_LEFT   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-marker-image-right",  MAP,       SELECTION_HANDLE_MARKER_IMAGE_RIGHT  )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            VECTOR4,   SELECTION_HIGHLIGHT_COLOR            )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box",              RECTANGLE, DECORATION_BOUNDING_BOX              )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "input-method-settings",                MAP,       INPUT_METHOD_SETTINGS                )
@@ -458,8 +460,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_LEFT %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const Image image = Scripting::NewImage( value );
 
         if( impl.mDecorator )
         {
@@ -470,8 +471,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_RIGHT %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const Image image = Scripting::NewImage( value );
 
         if( impl.mDecorator )
         {
@@ -482,8 +482,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_LEFT %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const Image image = Scripting::NewImage( value );
 
         if( impl.mDecorator )
         {
@@ -494,8 +493,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_RIGHT %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const Image image = Scripting::NewImage( value );
 
         if( impl.mDecorator )
         {
@@ -504,6 +502,26 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
+      {
+        const Image image = Scripting::NewImage( value );
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
+          impl.RequestTextRelayout();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
+      {
+        const Image image = Scripting::NewImage( value );
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
+          impl.RequestTextRelayout();
+        }
+        break;
+      }
       case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
       {
         const Vector4 color = value.Get< Vector4 >();
@@ -762,50 +780,32 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
       {
-        if( impl.mDecorator )
-        {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
-        }
+        impl.GetHandleImagePropertyValue( value, LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED );
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
       {
-        if( impl.mDecorator )
-        {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
-        }
+        impl.GetHandleImagePropertyValue( value, RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) ;
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
       {
-        if( impl.mDecorator )
-        {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
-        }
+        impl.GetHandleImagePropertyValue( value, LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED );
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
       {
-        if( impl.mDecorator )
-        {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
-        }
+        impl.GetHandleImagePropertyValue( value, RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED );
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
+      {
+        impl.GetHandleImagePropertyValue( value, LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED );
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
+      {
+        impl.GetHandleImagePropertyValue( value, RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED );
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
@@ -1145,6 +1145,21 @@ ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager,
   return mController->OnImfEvent( imfManager, imfEvent );
 }
 
+void TextField::GetHandleImagePropertyValue(  Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType )
+{
+  if( mDecorator )
+  {
+    ResourceImage image = ResourceImage::DownCast( mDecorator->GetHandleImage( handleType, handleImageType ) );
+
+    if ( image )
+    {
+      Property::Map map;
+      Scripting::CreatePropertyMap( image, map );
+      value = map;
+    }
+  }
+}
+
 void TextField::EnableClipping( bool clipping, const Vector2& size )
 {
   if( clipping )
index e275980..8a59577 100644 (file)
@@ -188,6 +188,14 @@ private: // From Control
 private: // Implementation
 
   /**
+   * @brief Get a Property Map for the image used for the required Handle Image
+   * @param[out] value the returned image property
+   * @param[in] handleType the type of handle
+   * @param[in] handleImageType the type of image for the given handleType
+   */
+  void GetHandleImagePropertyValue(  Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType );
+
+  /**
    * @brief Enable or disable clipping.
    *
    * @param[in] clipping True if clipping should be enabled.
index bdfc356..5c45bf3 100644 (file)
@@ -87,8 +87,6 @@ namespace
 {
 
 const char* DEFAULT_GRAB_HANDLE_IMAGE_RELEASED( DALI_IMAGE_DIR "cursor_handler_center.png" );
-const char* DEFAULT_SELECTION_HANDLE_ONE_RELEASED( DALI_IMAGE_DIR "selection_handle_left.png" );
-const char* DEFAULT_SELECTION_HANDLE_TWO_RELEASED( DALI_IMAGE_DIR "selection_handle_right.png" );
 
 const int DEFAULT_POPUP_OFFSET( -100.0f ); // Vertical offset of Popup from cursor or handles position.
 
@@ -214,6 +212,7 @@ struct Decorator::Impl : public ConnectionTracker
 
     ImageActor actor;
     Actor grabArea;
+    ImageActor markerActor;
 
     Vector2 position;
     float lineHeight; ///< Not the handle height
@@ -352,12 +351,16 @@ struct Decorator::Impl : public ConnectionTracker
         {
           primary.actor.SetPosition( primaryPosition.x,
                                      primaryPosition.y + primary.lineHeight ); // TODO : Fix for multiline.
+
+          SetSelectionHandleMarkerSize( primary );
         }
 
         if( isSecondaryVisible )
         {
           secondary.actor.SetPosition( secondaryPosition.x,
                                        secondaryPosition.y + secondary.lineHeight ); // TODO : Fix for multiline.
+
+          SetSelectionHandleMarkerSize( secondary );
         }
       }
       primary.actor.SetVisible( isPrimaryVisible );
@@ -579,6 +582,15 @@ struct Decorator::Impl : public ConnectionTracker
     mActiveLayer.RaiseToTop();
   }
 
+  void SetSelectionHandleMarkerSize( HandleImpl& handle )
+  {
+    if ( handle.markerActor )
+    {
+      handle.markerActor.SetResizePolicy ( ResizePolicy::FIXED, Dimension::HEIGHT );
+      handle.markerActor.SetSize( 0, handle.lineHeight );
+    }
+  }
+
   void CreateGrabHandle()
   {
     HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
@@ -629,16 +641,32 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
-  void CreateSelectionHandles()
+  void CreateHandleMarker( HandleImpl& handle, Image& image, HandleType handleType )
   {
-    HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
-    if( !primary.actor )
+    if ( image)
     {
-      if( !mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
+      handle.markerActor = ImageActor::New( image );
+      handle.markerActor.SetColor( mHandleColor );
+      handle.actor.Add( handle.markerActor );
+
+      if ( LEFT_SELECTION_HANDLE == handleType )
       {
-        mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE_RELEASED );
+        handle.markerActor.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
+        handle.markerActor.SetParentOrigin( ParentOrigin::TOP_RIGHT );
       }
+      else if ( RIGHT_SELECTION_HANDLE == handleType )
+      {
+        handle.markerActor.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+        handle.markerActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+      }
+    }
+  }
 
+  void CreateSelectionHandles()
+  {
+    HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
+    if( !primary.actor )
+    {
       primary.actor = ImageActor::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
       primary.actor.SetName("SelectionHandleOne");
@@ -662,6 +690,8 @@ struct Decorator::Impl : public ConnectionTracker
       primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
 
       primary.actor.Add( primary.grabArea );
+
+      CreateHandleMarker( primary, mHandleImages[LEFT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], LEFT_SELECTION_HANDLE );
     }
 
     if( !primary.actor.GetParent() )
@@ -672,11 +702,6 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
     if( !secondary.actor )
     {
-      if( !mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
-      {
-        mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO_RELEASED );
-      }
-
       secondary.actor = ImageActor::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
       secondary.actor.SetName("SelectionHandleTwo");
@@ -700,6 +725,8 @@ struct Decorator::Impl : public ConnectionTracker
       secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
 
       secondary.actor.Add( secondary.grabArea );
+
+      CreateHandleMarker( secondary, mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][HANDLE_IMAGE_RELEASED], RIGHT_SELECTION_HANDLE  );
     }
 
     if( !secondary.actor.GetParent() )
@@ -1142,6 +1169,15 @@ struct Decorator::Impl : public ConnectionTracker
     rightHandle.actor.SetImage( rightFlipped ? mHandleImages[LEFT_SELECTION_HANDLE][rightImageType] : mHandleImages[RIGHT_SELECTION_HANDLE][rightImageType] );
 
     rightHandle.actor.SetAnchorPoint( rightFlipped ? AnchorPoint::TOP_RIGHT : AnchorPoint::TOP_LEFT );
+
+    if ( leftHandle.markerActor )
+    {
+      leftHandle.markerActor.SetImage( leftFlipped ? mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][leftImageType] : mHandleImages[LEFT_SELECTION_HANDLE_MARKER][leftImageType] );
+    }
+    if ( rightHandle.markerActor )
+    {
+      rightHandle.markerActor.SetImage( rightFlipped ? mHandleImages[LEFT_SELECTION_HANDLE_MARKER][rightImageType] : mHandleImages[RIGHT_SELECTION_HANDLE_MARKER][rightImageType] );
+    }
   }
 
   void SetScrollThreshold( float threshold )
index b018c6a..c84c352 100644 (file)
@@ -81,6 +81,8 @@ enum HandleType
   GRAB_HANDLE,
   LEFT_SELECTION_HANDLE,
   RIGHT_SELECTION_HANDLE,
+  LEFT_SELECTION_HANDLE_MARKER,
+  RIGHT_SELECTION_HANDLE_MARKER,
   HANDLE_TYPE_COUNT
 };
 
index a843feb..233e764 100644 (file)
@@ -1514,6 +1514,12 @@ void Controller::DecorationEvent( HandleType handleType, HandleState state, floa
         mImpl->mEventData->mEventQueue.push_back( event );
         break;
       }
+      case LEFT_SELECTION_HANDLE_MARKER:
+      case RIGHT_SELECTION_HANDLE_MARKER:
+      {
+        // Markers do not move the handles.
+        break;
+      }
       case HANDLE_TYPE_COUNT:
       {
         DALI_ASSERT_DEBUG( !"Controller::HandleEvent. Unexpected handle type" );
index 4f3da41..d295e0f 100644 (file)
@@ -86,10 +86,12 @@ public:
       GRAB_HANDLE_PRESSED_IMAGE,                ///< name "grab-handle-pressed-image",           The image to display when the grab handle is pressed,                     type STRING
       SCROLL_THRESHOLD,                         ///< name "scroll-threshold"                     Scrolling will occur if the cursor is this close to the control border,   type FLOAT
       SCROLL_SPEED,                             ///< name "scroll-speed"                         The scroll speed in pixels per second,                                    type FLOAT
-      SELECTION_HANDLE_IMAGE_LEFT,              ///< name "selection-handle-image-left",         The image to display for the left selection handle,                       type STRING
-      SELECTION_HANDLE_IMAGE_RIGHT,             ///< name "selection-handle-image-right",        The image to display for the right selection handle,                      type STRING
-      SELECTION_HANDLE_PRESSED_IMAGE_LEFT,      ///< name "selection-handle-pressed-image-left"  The image to display when the left selection handle is pressed,           type STRING
-      SELECTION_HANDLE_PRESSED_IMAGE_RIGHT,     ///< name "selection-handle-pressed-image-right" The image to display when the right selection handle is pressed,          type STRING
+      SELECTION_HANDLE_IMAGE_LEFT,              ///< name "selection-handle-image-left",         The image to display for the left selection handle,                       type MAP
+      SELECTION_HANDLE_IMAGE_RIGHT,             ///< name "selection-handle-image-right",        The image to display for the right selection handle,                      type MAP
+      SELECTION_HANDLE_PRESSED_IMAGE_LEFT,      ///< name "selection-handle-pressed-image-left"  The image to display when the left selection handle is pressed,           type MAP
+      SELECTION_HANDLE_PRESSED_IMAGE_RIGHT,     ///< name "selection-handle-pressed-image-right" The image to display when the right selection handle is pressed,          type MAP
+      SELECTION_HANDLE_MARKER_IMAGE_LEFT,       ///< name "selection-handle-marker-image-left",  The image to display for the left selection handle marker,                type MAP
+      SELECTION_HANDLE_MARKER_IMAGE_RIGHT,      ///< name "selection-handle-marker-image-right", The image to display for the right selection handle marker,               type MAP
       SELECTION_HIGHLIGHT_COLOR,                ///< name "selection-highlight-color"            The color of the selection highlight,                                     type VECTOR4
       DECORATION_BOUNDING_BOX,                  ///< name "decoration-bounding-box"              The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
       INPUT_METHOD_SETTINGS                     ///< name "input-method-settings"                The settings to relating to the System's Input Method, Key and Value      type MAP
index cb7f5e1..96be16b 100644 (file)
@@ -64,9 +64,11 @@ distributing this software or its derivatives.
       "primary-cursor-color":[0.0,0.72,0.9,1.0],
       "secondary-cursor-color":[0.0,0.72,0.9,1.0],
       "selection-highlight-color":[0.75,0.96,1.0,1.0],
-      "grab-handle-image":"{DALI_IMAGE_DIR}cursor_handler_center.png",
-      "selection-handle-image-left":"{DALI_IMAGE_DIR}selection_handle_left.png",
-      "selection-handle-image-right":"{DALI_IMAGE_DIR}selection_handle_right.png"
+      "grab-handle-image": { "filename":"{DALI_IMAGE_DIR}cursor_handler_center.png" },
+      "selection-handle-image-left" : {"filename":"{DALI_IMAGE_DIR}selection_handle_left.png" },
+      "selection-handle-image-right": {"filename":"{DALI_IMAGE_DIR}selection_handle_right.png" },
+      "selection-handle-marker-image-left":{ "filename":"{DALI_IMAGE_DIR}selection_marker_left.png" },
+      "selection-handle-marker-image-right":{ "filename":"{DALI_IMAGE_DIR}selection_marker_right.png" }
     },
 
     "textfield-font-size-0":
index ce53bbb..0329619 100644 (file)
@@ -60,13 +60,15 @@ distributing this software or its derivatives.
 
     "textfield":
     {
-      "point-size":28,
+      "point-size":18,
       "primary-cursor-color":[0.0,0.72,0.9,1.0],
       "secondary-cursor-color":[0.0,0.72,0.9,1.0],
       "selection-highlight-color":[0.75,0.96,1.0,1.0],
-      "grab-handle-image":"{DALI_IMAGE_DIR}cursor_handler_center.png",
-      "selection-handle-image-left":"{DALI_IMAGE_DIR}selection_handle_left.png",
-      "selection-handle-image-right":"{DALI_IMAGE_DIR}selection_handle_right.png"
+      "grab-handle-image": { "filename":"{DALI_IMAGE_DIR}cursor_handler_center.png" },
+      "selection-handle-image-left" : {"filename":"{DALI_IMAGE_DIR}selection_handle_left.png" },
+      "selection-handle-image-right": {"filename":"{DALI_IMAGE_DIR}selection_handle_right.png" },
+      "selection-handle-marker-image-left":{ "filename":"{DALI_IMAGE_DIR}selection_marker_left.png" },
+      "selection-handle-marker-image-right":{ "filename":"{DALI_IMAGE_DIR}selection_marker_right.png" }
     },
 
     "textfield-font-size-0":