Text auto scrolling documentation 50/56650/11
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 11 Jan 2016 17:26:19 +0000 (17:26 +0000)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Tue, 17 May 2016 14:48:14 +0000 (15:48 +0100)
Updated Property documentation in header file for TextLabel
Added AutoScrolling to programming guide

Change-Id: Icf4fc662976a2c1964f0ba7b43a88268fcf84fd4
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
dali-toolkit/public-api/controls/text-controls/text-label.h
docs/content/images/text-controls/AutoScroll.gif [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/text-auto-scrolling.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/text-label.md

index 7153d3a..33e95f1 100644 (file)
@@ -40,6 +40,30 @@ class TextLabel;
  * @brief A control which renders a short text string.
  *
  * Text labels are lightweight, non-editable and do not respond to user input.
+ *
+ * @section TextLabelProperties Properties
+ * |%Property enum                    |String name          |Type          |Writable|Animatable|
+ * |----------------------------------|---------------------|--------------|--------|----------|
+ * | Property::RENDERING_BACKEND      | renderingBackend    |  INTEGER     | O      | X        |
+ * | Property::TEXT                   | text                |  STRING      | O      | X        |
+ * | Property::FONT_FAMILY            | fontFamily          |  STRING      | O      | X        |
+ * | Property::FONT_STYLE             | fontStyle           |  STRING      | O      | X        |
+ * | Property::POINT_SIZE             | pointSize           |  FLOAT       | O      | X        |
+ * | Property::MULTI_LINE             | multiLine           |  BOOLEAN     | O      | X        |
+ * | Property::HORIZONTAL_ALIGNMENT   | horizontalAlignment |  STRING      | O      | X        |
+ * | Property::VERTICAL_ALIGNMENT     | verticalAlignment   |  STRING      | O      | X        |
+ * | Property::TEXT_COLOR             | textColor           |  VECTOR4     | O      | X        |
+ * | Property::SHADOW_OFFSET          | shadowOffset        |  VECTOR2     | O      | X        |
+ * | Property::SHADOW_COLOR           | shadowColor         |  VECTOR4     | O      | X        |
+ * | Property::UNDERLINE_ENABLED      | underlineEnabled    |  BOOLEAN     | O      | X        |
+ * | Property::UNDERLINE_COLOR        | underlineColor      |  VECTOR4     | O      | X        |
+ * | Property::UNDERLINE_HEIGHT       | underlineHeight     |  FLOAT       | O      | X        |
+ * | Property::ENABLE_MARKUP          | enableMarkup        |  BOOLEAN     | O      | X        |
+ * | Property::ENABLE_AUTO_SCROLL     | enableAutoScroll    |  BOOLEAN     | O      | X        |
+ * | Property::AUTO_SCROLL_SPEED      | autoScrollSpeed     |  INTEGER     | O      | X        |
+ * | Property::AUTO_SCROLL_LOOP_COUNT | autoScrollLoopCount |  INTEGER     | O      | X        |
+ * | Property::AUTO_SCROLL_GAP        | autoScrollGap       |  INTEGER     | O      | X        |
+ *
  * @SINCE_1_0.0
  */
 class DALI_IMPORT_API TextLabel : public Control
@@ -64,25 +88,138 @@ public:
   {
     enum
     {
-      RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "renderingBackend",     The type or rendering e.g. bitmap-based,          type INT @SINCE_1_0.0
-      TEXT,                                     ///< name "text",                 The text to display in UTF-8 format,              type STRING @SINCE_1_0.0
-      FONT_FAMILY,                              ///< name "fontFamily",           The requested font family,                        type STRING @SINCE_1_0.0
-      FONT_STYLE,                               ///< name "fontStyle",            The requested font style,                         type STRING @SINCE_1_0.0
-      POINT_SIZE,                               ///< name "pointSize",            The size of font in points,                       type FLOAT @SINCE_1_0.0
-      MULTI_LINE,                               ///< name "multiLine",            The single-line or multi-line layout option,      type BOOLEAN @SINCE_1_0.0
-      HORIZONTAL_ALIGNMENT,                     ///< name "horizontalAlignment",  The line horizontal alignment,                    type STRING,  values "BEGIN", "CENTER", "END" @SINCE_1_0.0
-      VERTICAL_ALIGNMENT,                       ///< name "verticalAlignment",    The line vertical alignment,                      type STRING,  values "TOP",   "CENTER", "BOTTOM" @SINCE_1_0.0
-      TEXT_COLOR,                               ///< name "textColor",            The text color,                                   type VECTOR4 @SINCE_1_0.0
-      SHADOW_OFFSET,                            ///< name "shadowOffset",         The drop shadow offset 0 indicates no shadow,     type VECTOR2 @SINCE_1_0.0
-      SHADOW_COLOR,                             ///< name "shadowColor",          The color of a drop shadow,                       type VECTOR4 @SINCE_1_0.0
-      UNDERLINE_ENABLED,                        ///< name "underlineEnabled",     The underline enabled flag,                       type BOOLEAN @SINCE_1_0.0
-      UNDERLINE_COLOR,                          ///< name "underlineColor",       The color of the underline,                       type VECTOR4 @SINCE_1_0.0
-      UNDERLINE_HEIGHT,                         ///< name "underlineHeight",      Overrides the underline height from font metrics, type FLOAT @SINCE_1_0.0
-      ENABLE_MARKUP,                            ///< name "enableMarkup",         Whether the mark-up processing is enabled.        type BOOLEAN @SINCE_1_0.0
-      ENABLE_AUTO_SCROLL,                       ///< name "enableAutoScroll",     Whether to start auto text scrolling              type BOOLEAN @SINCE_1_1.35
-      AUTO_SCROLL_SPEED,                        ///< name "autoScrollSpeed",      Speed at which text should auto scroll            type INT @SINCE_1_1.35
-      AUTO_SCROLL_LOOP_COUNT,                   ///< name "autoScrollLoopCount",  Number of times the text should scroll (loop)     type INT @SINCE_1_1.35
-      AUTO_SCROLL_GAP                           ///< name "autoScrollGap",        Gap before text wraps around when scrolling       type FLOAT @SINCE_1_1.35
+      /**
+       * @brief The type of rendering e.g. bitmap-based
+       * @details name "renderingBackend", type INT, default RENDERING_SHARED_ATLAS
+       * @SINCE_1_0.0
+       */
+      RENDERING_BACKEND = PROPERTY_START_INDEX,
+
+      /**
+       * @brief The text to display in UTF-8 format,
+       * @details name "text", type STRING
+       * @SINCE_1_0.0
+       */
+      TEXT,
+
+      /**
+       * @brief The requested font family to use,
+       * @details name "fontFamily", type STRING
+       * @SINCE_1_0.0
+       */
+      FONT_FAMILY,
+
+      /**
+       * @brief The requested font style to use,
+       * @details name "fontStyle", type STRING
+       * @SINCE_1_0.0
+       */
+      FONT_STYLE,
+
+      /**
+       * @brief The size of font in points
+       * @details name "pointSize", type FLOAT
+       * @SINCE_1_0.0
+       */
+      POINT_SIZE,
+
+      /**
+       * @brief The single-line or multi-line layout option
+       * @details name "multiLine", type FLOAT, default SINGLE_LINE_BOX
+       * @SINCE_1_0.0
+       */
+      MULTI_LINE,
+
+      /**
+       * @brief The line horizontal alignment
+       * @details name "horizontalAlignment", type STRING,  values "BEGIN", "CENTER", "END", default BEGIN
+       * @SINCE_1_0.0
+       */
+      HORIZONTAL_ALIGNMENT,
+
+      /**
+       * @brief The line vertical alignment
+       * @details name "verticalAlignment", type STRING,  values "TOP",   "CENTER", "BOTTOM" @SINCE_1_0.0, default TOP
+       * @SINCE_1_0.0
+       */
+      VERTICAL_ALIGNMENT,
+
+      /**
+       * @brief The color of the text
+       * @details name "textColor", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      TEXT_COLOR,
+
+      /**
+       * @brief The drop shadow offset 0 indicates no shadow
+       * @details name "shadowOffset", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      SHADOW_OFFSET,
+
+      /**
+       * @brief The color of a drop shadow
+       * @details name "shadowColor", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      SHADOW_COLOR,
+
+      /**
+       * @brief The underline enabled flag
+       * @details name "underlineEnabled", type BOOLEAN
+       * @SINCE_1_0.0
+       */
+      UNDERLINE_ENABLED,
+
+      /**
+       * @brief The color of the underline
+       * @details name "underlineColor", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      UNDERLINE_COLOR,
+
+      /**
+       * @brief Overrides the underline height from font metrics
+       * @details name "underlineHeight", type FLOAT
+       * @SINCE_1_0.0
+       */
+      UNDERLINE_HEIGHT,
+
+      /**
+       * @brief  Whether the mark-up processing is enabled
+       * @details name "enableMarkup", type BOOLEAN
+       * @SINCE_1_0.0
+       */
+      ENABLE_MARKUP,
+
+      /**
+       * @brief  Start or stop auto scrolling,
+       * @details name "enableMarkup", type BOOLEAN, default is false
+       * @SINCE_1_1.35
+       */
+      ENABLE_AUTO_SCROLL,
+
+      /**
+       * @brief  Start or stop auto scrolling,
+       * @details name "autoScrollSpeed", type INT, default in style sheet
+       * @SINCE_1_1.35
+       */
+      AUTO_SCROLL_SPEED,
+
+      /**
+       * @brief  Number of complete loops when scrolling enabled
+       * @details name "autoScrollLoopCount", type INT, default in style sheet
+       * @SINCE_1_1.35
+       */
+      AUTO_SCROLL_LOOP_COUNT,
+
+      /**
+       * @brief  Gap before before scrolling wraps
+       * @details name "autoScrollGap", type INT, default in style sheet but can be overridden to prevent same text being show at start and end.
+       * @SINCE_1_1.35
+       */
+      AUTO_SCROLL_GAP
     };
   };
 
diff --git a/docs/content/images/text-controls/AutoScroll.gif b/docs/content/images/text-controls/AutoScroll.gif
new file mode 100644 (file)
index 0000000..663cd3b
Binary files /dev/null and b/docs/content/images/text-controls/AutoScroll.gif differ
diff --git a/docs/content/shared-javascript-and-cpp-documentation/text-auto-scrolling.md b/docs/content/shared-javascript-and-cpp-documentation/text-auto-scrolling.md
new file mode 100644 (file)
index 0000000..ba7270d
--- /dev/null
@@ -0,0 +1,63 @@
+<!--
+/**-->
+
+# Text auto scrolling {#text-auto-scrolling}
+
+## Overview
+
+Auto TextLabel scrolling enables the text to scroll within the control, it can be used if text exceeds the boundary of the control hence showing the full content.
+It will also scroll text that is smaller than the control and ensure the same bit of text is not visible at the same time, this gap can be configured to be larger.
+
+If the number of loops (repetitions) is not set then once triggered to start it will scroll until requested to stop.
+If loop count is set to 3 for example it will scroll the text 3 times.
+
+![ ](../assets/img/text-controls/AutoScroll.gif)
+![ ](AutoScroll.gif)
+
+### Usage
+
+At version 1.1.35 auto scrolling is only supported in single line, mutliline text will not scroll and Text should be BEGIN aligned.
+
+The ENABLE_AUTO_SCROLL property should be set to TRUE to enable scrolling.
+
+The scroll speed, gap and loop count can be set in the stylesheet or provided by Dali::Handle::SetProperty. See the description of each below.
+
+Once enabled it will start scrolling until the loop count is completed or the ENABLE_AUTO_SCROLL set to false, setting ENABLE_AUTO_SCROLL to false will let the
+text complete it's current scrolling loop then stop.
+
+## The additional properties below can be set to customise the scrolling behaviour
+
+#### AUTO_SCROLL_SPEED
+
+This controls the speed of the scrolling, the speed should be provided as pixels/second.
+
+#### AUTO_SCROLL_LOOP_COUNT
+
+This specifies how many times the text will complete a full scroll cycle.
+If not set then it will keep scrolling until ENABLE_AUTO_SCROLL is set to false.
+
+Setting ENABLE_AUTO_SCROLL to false will stop scrolling whilst still maintaining the original loop count value for when it is next started.
+
+#### AUTO_SCROLL_GAP
+
+This specifies the amount of whitespace to display before the scrolling text is shown again.
+
+This will be increased if the given value is not large enough to prevent the same bit of text being visible at two locations in the control.
+
+Provide the distance in pixels.
+
+### Scroll Direction
+
+The scroll direction is choosen automatically with the following rules:
+
+If the text is single-lined it will scroll left when the text is Left to Right (LTR) or scroll right if text is Right to Left (RTL).
+
+If the text is multi-lined it will scroll upwards. ( Not supported at 1.1.35 )
+
+### Text Label Scrolling Properties
+
+The properties used by TextLabel for Auto Scrolling are listed [here](@ref TextLabelProperties)
+
+@class TextLabel_Scrolling
+
+*/
index 5247e92..ae03364 100644 (file)
@@ -316,27 +316,16 @@ label1.underlineHeight = 1;
 ![ ](../assets/img/text-controls/TextWith1pxUnderline.png)
 ![ ](TextWith1pxUnderline.png)
 
-### Text Label Properties
+### Auto Scrolling
+
+![ ](../assets/img/text-controls/AutoScroll.gif)
+![ ](AutoScroll.gif)
 
- Name (JavaScript)   |  Name (C++)          |  Type        | Writable     | Animatable
----------------------|----------------------|--------------|--------------|-----------
- renderingBackend    | RENDERING_BACKEND    |  INTEGER     | O            | X
- text                | TEXT                 |  STRING      | O            | X
- fontFamily          | FONT_FAMILY          |  STRING      | O            | X
- fontStyle           | FONT_STYLE           |  STRING      | O            | X
- pointSize           | POINT_SIZE           |  FLOAT       | O            | X
- multiLine           | MULTI_LINE           |  BOOLEAN     | O            | X
- horizontalAlignment | HORIZONTAL_ALIGNMENT |  STRING      | O            | X
- verticalAlignment   | VERTICAL_ALIGNMENT   |  STRING      | O            | X
- textColor           | TEXT_COLOR           |  VECTOR4     | O            | X
- shadowOffset        | SHADOW_OFFSET        |  VECTOR2     | O            | X
- shadowColor         | SHADOW_COLOR         |  VECTOR4     | O            | X
- underlineEnabled    | UNDERLINE_ENABLED    |  BOOLEAN     | O            | X
- underlineColor      | UNDERLINE_COLOR      |  VECTOR4     | O            | X
- underlineHeight     | UNDERLINE_HEIGHT     |  FLOAT       | O            | X
- enableMarkup        | ENABLE_MARKUP        |  BOOLEAN     | O            | X
+The \link text-auto-scrolling Auto text scrolling \endlink section details how to scroll text automatically.
 
+### Text Label Properties
 
+The properties used by TextLabel are listed [here](@ref TextLabelProperties)
 
 @class TextLabel