[NUI] Add RequestAsyncRenderWithFixedWidth to TextLabel
authorBowon Ryu <bowon.ryu@samsung.com>
Wed, 10 Jul 2024 01:26:33 +0000 (10:26 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 21 Aug 2024 06:10:37 +0000 (15:10 +0900)
Requests asynchronous text rendering with a fixed width.
The height is determined by the content of the text when rendered with the given width.
The result will be the same as the height returned by GetHeightForWidth.

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs

index 8fb4a55d8c45074b92cabd8461017b4f77dcf957..b321719fa2347f2c520c4a9bc47599a1deae546c 100755 (executable)
@@ -196,6 +196,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedSize")]
             public static extern void RequestAsyncRenderWithFixedSize(global::System.Runtime.InteropServices.HandleRef textLabelRef, float width, float height);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedWidth")]
+            public static extern void RequestAsyncRenderWithFixedWidth(global::System.Runtime.InteropServices.HandleRef textLabelRef, float width);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncTextRenderedSignal")]
             public static extern global::System.IntPtr AsyncTextRenderedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
         }
index a9f077028e6d12ee6fcd840b3a7f2e31c042273d..dc2ba066c6f7b65bf272121216adc8e62704b692 100755 (executable)
@@ -335,6 +335,22 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Requests asynchronous text rendering with a fixed width.
+        /// </summary>
+        /// <param name="width">The width of text to render.</param>
+        /// <remarks>
+        /// Only works when AsyncLoad is true.<br />
+        /// The height is determined by the content of the text when rendered with the given width.<br />
+        /// The result will be the same as the height returned by GetHeightForWidth.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void RequestAsyncRenderWithFixedWidth(float width)
+        {
+            Interop.TextLabel.RequestAsyncRenderWithFixedWidth(SwigCPtr, width);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         /// <summary>
         /// The TranslatableText property.<br />
         /// The text can set the SID value.<br />