From cf2062a87214260487796d2c72acf2e8cb29a727 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 10 May 2017 17:00:13 +0900 Subject: [PATCH] Text Control devel Properties manual binding - TextEditor / TextField / TextLabel Change-Id: I67dac52150c46b1a74cfe6557abdd66c24381c44 Signed-off-by: Seoyeon Kim --- .../NUISamples/NUISamples.TizenTV/examples/Main.cs | 4 +- .../NUISamples.TizenTV/examples/hello-world.cs | 17 ++++ Tizen.NUI/src/internal/ManualPINVOKE.cs | 31 ++++++ Tizen.NUI/src/public/BaseComponents/TextEditor.cs | 108 +++++++++++++++++++++ Tizen.NUI/src/public/BaseComponents/TextField.cs | 36 +++++++ Tizen.NUI/src/public/BaseComponents/TextLabel.cs | 38 ++++++++ 6 files changed, 232 insertions(+), 2 deletions(-) diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs index 3a0c2f0..6e2c143 100644 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs @@ -16,9 +16,9 @@ namespace NUISamples.TizenTV.examples { //new ControlDashboard.Example().Run(args); //o //new DatePickerTest.Example().Run(args); //o - new DatePickerUsingJson.Example().Run(args); //o + //new DatePickerUsingJson.Example().Run(args); //o //new HelloTest.Example().Run(args); //o - //new HelloWorldTest.Example().Run(args); //o + new HelloWorldTest.Example().Run(args); //o //new Test1.Example().Run(args); //o //new UserAlphaFunctionTest.Example().Run(args); //o //new MyCSharpExample.Example().Run(args); //o diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs index 63fb032..fe496dd 100644 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs @@ -56,6 +56,23 @@ namespace HelloWorldTest window.TouchEvent += OnWindowTouched; window.KeyEvent += OnWindowKeyEvent; + TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f"); + pixelLabel.Position2D = new Position2D(10, 10); + pixelLabel.PixelSize = 32.0f; + window.GetDefaultLayer().Add(pixelLabel); + + TextLabel pointLabel = new TextLabel("Test Point Size 32.0f"); + pointLabel.Position2D = new Position2D(10, 100); + pointLabel.PointSize = 32.0f; + window.GetDefaultLayer().Add(pointLabel); + + TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled."); + ellipsis.Size2D = new Size2D(100, 100); + ellipsis.Position2D = new Position2D(10, 250); + ellipsis.PointSize = 20.0f; + ellipsis.Ellipsis = true; + window.GetDefaultLayer().Add(ellipsis); + _text = new TextLabel("Hello NUI World"); _text.ParentOrigin = ParentOrigin.Center; _text.AnchorPoint = AnchorPoint.Center; diff --git a/Tizen.NUI/src/internal/ManualPINVOKE.cs b/Tizen.NUI/src/internal/ManualPINVOKE.cs index 4509c49..f2fcee0 100644 --- a/Tizen.NUI/src/internal/ManualPINVOKE.cs +++ b/Tizen.NUI/src/internal/ManualPINVOKE.cs @@ -548,6 +548,37 @@ namespace Tizen.NUI public static extern global::System.IntPtr ImfManager_SWIGUpcast(global::System.IntPtr jarg1); ///////////////////////////////////////////////////////////// + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_SMOOTH_SCROLL_get")] + public static extern int TextEditor_Property_SMOOTH_SCROLL_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_SMOOTH_SCROLL_DURATION_get")] + public static extern int TextEditor_Property_SMOOTH_SCROLL_DURATION_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_ENABLE_SCROLL_BAR_get")] + public static extern int TextEditor_Property_ENABLE_SCROLL_BAR_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get")] + public static extern int TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_SCROLL_BAR_FADE_DURATION_get")] + public static extern int TextEditor_Property_SCROLL_BAR_FADE_DURATION_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_PIXEL_SIZE_get")] + public static extern int TextEditor_Property_PIXEL_SIZE_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_HIDDEN_INPUT_SETTINGS_get")] + public static extern int TextField_Property_HIDDEN_INPUT_SETTINGS_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_PIXEL_SIZE_get")] + public static extern int TextField_Property_PIXEL_SIZE_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextLabel_Property_PIXEL_SIZE_get")] + public static extern int TextLabel_Property_PIXEL_SIZE_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextLabel_Property_ELLIPSIS_get")] + public static extern int TextLabel_Property_ELLIPSIS_get(); + + } } diff --git a/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 8f2a7a5..fdc33dc 100644 --- a/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -240,6 +240,12 @@ namespace Tizen.NUI.BaseComponents internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get(); internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get(); internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get(); + internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get(); + internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get(); + internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get(); + internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get(); + internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get(); + internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get(); } @@ -1079,6 +1085,108 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// SmoothScroll property. + /// + public bool SmoothScroll + { + get + { + bool temp = false; + GetProperty(TextEditor.Property.SMOOTH_SCROLL).Get(ref temp); + return temp; + } + set + { + SetProperty(TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// SmoothScrollDuration property. + /// + public float SmoothScrollDuration + { + get + { + float temp = 0.0f; + GetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION).Get(ref temp); + return temp; + } + set + { + SetProperty(TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// EnableScrollBar property. + /// + public bool EnableScrollBar + { + get + { + bool temp = false; + GetProperty(TextEditor.Property.ENABLE_SCROLL_BAR).Get(ref temp); + return temp; + } + set + { + SetProperty(TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// ScrollBarShowDuration property. + /// + public float ScrollBarShowDuration + { + get + { + float temp = 0.0f; + GetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION).Get(ref temp); + return temp; + } + set + { + SetProperty(TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// ScrollBarFadeDuration property. + /// + public float ScrollBarFadeDuration + { + get + { + float temp = 0.0f; + GetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION).Get(ref temp); + return temp; + } + set + { + SetProperty(TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// PixelSize property. + /// + public float PixelSize + { + get + { + float temp = 0.0f; + GetProperty(TextEditor.Property.PIXEL_SIZE).Get(ref temp); + return temp; + } + set + { + SetProperty(TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value)); + } + } + } } diff --git a/Tizen.NUI/src/public/BaseComponents/TextField.cs b/Tizen.NUI/src/public/BaseComponents/TextField.cs index 3975a76..3044e8a 100644 --- a/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -312,6 +312,8 @@ namespace Tizen.NUI.BaseComponents internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextField_Property_INPUT_EMBOSS_get(); internal static readonly int OUTLINE = NDalicPINVOKE.TextField_Property_OUTLINE_get(); internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextField_Property_INPUT_OUTLINE_get(); + internal static readonly int HIDDEN_INPUT_SETTINGS = NDalicManualPINVOKE.TextField_Property_HIDDEN_INPUT_SETTINGS_get(); + internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextField_Property_PIXEL_SIZE_get(); } @@ -1322,6 +1324,40 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// HiddenInputSettings property. + /// + public Tizen.NUI.PropertyMap HiddenInputSettings + { + get + { + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + GetProperty(TextField.Property.HIDDEN_INPUT_SETTINGS).Get(temp); + return temp; + } + set + { + SetProperty(TextField.Property.HIDDEN_INPUT_SETTINGS, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// PixelSize property. + /// + public float PixelSize + { + get + { + float temp = 0.0f; + GetProperty(TextField.Property.PIXEL_SIZE).Get(ref temp); + return temp; + } + set + { + SetProperty(TextField.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value)); + } + } + } } diff --git a/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 3794ec8..523731a 100644 --- a/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -145,6 +145,8 @@ namespace Tizen.NUI.BaseComponents internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get(); internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get(); internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get(); + internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextLabel_Property_PIXEL_SIZE_get(); + internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get(); } @@ -706,5 +708,41 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// PixelSize property.
+ /// The size of font in pixels.
+ ///
+ public float PixelSize + { + get + { + float temp = 0.0f; + GetProperty(TextLabel.Property.PIXEL_SIZE).Get(ref temp); + return temp; + } + set + { + SetProperty(TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// Ellipsis property.
+ /// Enable or disable the ellipsis.
+ ///
+ public bool Ellipsis + { + get + { + bool temp = false; + GetProperty(TextLabel.Property.ELLIPSIS).Get(ref temp); + return temp; + } + set + { + SetProperty(TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue(value)); + } + } + } } -- 2.7.4