private InputMethodContext inputMethodCotext = null;
private float fontSizeScale = 1.0f;
private bool hasFontSizeChangedCallback = false;
+ private bool isSettingTextInCSharp = false;
static TextField() { }
{
SetVisible(false);
}
+
+ TextChanged += TextEditorTextChanged;
}
internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn, null)
{
SetVisible(false);
}
+
+ TextChanged += TextEditorTextChanged;
}
internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.NewTextField(TextField.getCPtr(handle)), true)
{
SetVisible(false);
}
+
+ TextChanged += TextEditorTextChanged;
}
internal enum ExceedPolicyType
}
set
{
- SetValueAndForceSendChangeSignal(TextProperty, value);
+ SetValue(TextProperty, value);
NotifyPropertyChanged();
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetFontStyle(FontStyle fontStyle)
{
- SetProperty(TextField.Property.FontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
- NotifyPropertyChanged();
+ SetValue(FontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public FontStyle GetFontStyle()
{
- var map = new PropertyMap();
- GetProperty(TextField.Property.FontStyle).Get(map);
- return TextUtils.GetFontStyleStruct(map);
+ return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
}
/// <summary>
}
/// <summary>
+ /// Set SelectionHandleImage to TextField. <br />
+ /// </summary>
+ /// <param name="selectionHandleImage">The SelectionHandleImage</param>
+ /// <remarks>
+ /// SetSelectionHandleImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetSelectionHandleImage method.
+ /// <code>
+ /// var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
+ /// selectionHandleImage.LeftImageUrl = "handle_downleft.png";
+ /// selectionHandleImage.RightImageUrl = "handle_downright.png";
+ /// field.SetSelectionHandleImage(selectionHandleImage);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage)
+ {
+ if (!String.IsNullOrEmpty(selectionHandleImage.LeftImageUrl))
+ {
+ SetValue(SelectionHandleImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleImage.LeftImageUrl));
+ }
+
+ if (!String.IsNullOrEmpty(selectionHandleImage.RightImageUrl))
+ {
+ SetValue(SelectionHandleImageRightProperty, TextUtils.GetFileNameMap(selectionHandleImage.RightImageUrl));
+ }
+ }
+
+ /// <summary>
+ /// Get SelectionHandleImage from TextField. <br />
+ /// </summary>
+ /// <returns>The SelectionHandleImage</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SelectionHandleImage GetSelectionHandleImage()
+ {
+ return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleImageLeftProperty), (PropertyMap)GetValue(SelectionHandleImageRightProperty));
+ }
+
+ /// <summary>
/// The SelectionHandlePressedImageLeft property.
/// The selectionHandlePressedImageLeft map contains the following key :<br />
/// <list type="table">
}
/// <summary>
+ /// Set SelectionHandlePressedImage to TextField. <br />
+ /// </summary>
+ /// <param name="selectionHandlePressedImage">The SelectionHandleImage</param>
+ /// <remarks>
+ /// SetSelectionHandlePressedImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetSelectionHandlePressedImage method.
+ /// <code>
+ /// var selectionHandlePressedImage = new Tizen.NUI.Text.SelectionHandleImage();
+ /// selectionHandlePressedImage.LeftImageUrl = "handle_pressed_downleft.png";
+ /// selectionHandlePressedImage.RightImageUrl = "handle_pressed_downright.png";
+ /// field.SetSelectionHandlePressedImage(selectionHandlePressedImage);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandlePressedImage)
+ {
+ if (!String.IsNullOrEmpty(selectionHandlePressedImage.LeftImageUrl))
+ {
+ SetValue(SelectionHandlePressedImageLeftProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl));
+ }
+
+ if (!String.IsNullOrEmpty(selectionHandlePressedImage.RightImageUrl))
+ {
+ SetValue(SelectionHandlePressedImageRightProperty, TextUtils.GetFileNameMap(selectionHandlePressedImage.RightImageUrl));
+ }
+ }
+
+ /// <summary>
+ /// Get SelectionHandlePressedImage from TextField. <br />
+ /// </summary>
+ /// <returns>The SelectionHandlePressedImage</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SelectionHandleImage GetSelectionHandlePressedImage()
+ {
+ return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty), (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty));
+ }
+
+ /// <summary>
/// The SelectionHandleMarkerImageLeft property.
/// The selectionHandleMarkerImageLeft map contains the following key :<br />
/// <list type="table">
}
/// <summary>
+ /// Set SelectionHandleMarkerImage to TextField. <br />
+ /// </summary>
+ /// <param name="selectionHandleMarkerImage">The SelectionHandleImage</param>
+ /// <remarks>
+ /// SetSelectionHandleMarkerImage specifies the display image used for the selection handle through <see cref="Tizen.NUI.Text.SelectionHandleImage"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetSelectionHandleMarkerImage method.
+ /// <code>
+ /// var selectionHandleMarkerImage = new Tizen.NUI.Text.SelectionHandleImage();
+ /// selectionHandleMarkerImage.LeftImageUrl = "handle_pressed_downleft.png";
+ /// selectionHandleMarkerImage.RightImageUrl = "handle_pressed_downright.png";
+ /// field.SetSelectionHandleMarkerImage(selectionHandleMarkerImage);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMarkerImage)
+ {
+ if (!String.IsNullOrEmpty(selectionHandleMarkerImage.LeftImageUrl))
+ {
+ SetValue(SelectionHandleMarkerImageLeftProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl));
+ }
+
+ if (!String.IsNullOrEmpty(selectionHandleMarkerImage.RightImageUrl))
+ {
+ SetValue(SelectionHandleMarkerImageRightProperty, TextUtils.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl));
+ }
+ }
+
+ /// <summary>
+ /// Get SelectionHandleMarkerImage from TextField. <br />
+ /// </summary>
+ /// <returns>The SelectionHandleMarkerImage</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.SelectionHandleImage"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SelectionHandleImage GetSelectionHandleMarkerImage()
+ {
+ return TextUtils.GetSelectionHandleImageStruct((PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty), (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty));
+ }
+
+ /// <summary>
/// The SelectionHighlightColor property.
/// </summary>
/// <remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetInputFontStyle(FontStyle fontStyle)
{
- SetProperty(TextField.Property.InputFontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
- NotifyPropertyChanged();
+ SetValue(InputFontStyleProperty, TextUtils.GetFontStyleMap(fontStyle));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public FontStyle GetInputFontStyle()
{
- var map = new PropertyMap();
- GetProperty(TextField.Property.InputFontStyle).Get(map);
- return TextUtils.GetFontStyleStruct(map);
+ return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(InputFontStyleProperty));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetUnderline(Underline underline)
{
- SetProperty(TextField.Property.UNDERLINE, new PropertyValue(TextUtils.GetUnderlineMap(underline)));
+ SetValue(UnderlineProperty, TextUtils.GetUnderlineMap(underline));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Underline GetUnderline()
{
- var map = new PropertyMap();
- GetProperty(TextField.Property.UNDERLINE).Get(map);
- return TextUtils.GetUnderlineStruct(map);
+ return TextUtils.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetShadow(Tizen.NUI.Text.Shadow shadow)
{
- SetProperty(TextField.Property.SHADOW, new PropertyValue(TextUtils.GetShadowMap(shadow)));
+ SetValue(ShadowProperty, TextUtils.GetShadowMap(shadow));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Tizen.NUI.Text.Shadow GetShadow()
{
- var map = new PropertyMap();
- GetProperty(TextField.Property.SHADOW).Get(map);
- return TextUtils.GetShadowStruct(map);
+ return TextUtils.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetOutline(Outline outline)
{
- SetProperty(TextField.Property.OUTLINE, new PropertyValue(TextUtils.GetOutlineMap(outline)));
+ SetValue(OutlineProperty, TextUtils.GetOutlineMap(outline));
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Outline GetOutline()
{
- var map = new PropertyMap();
- GetProperty(TextField.Property.OUTLINE).Get(map);
- return TextUtils.GetOutlineStruct(map);
+ return TextUtils.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
}
/// <summary>
}
/// <summary>
+ /// Set HiddenInput to TextField. <br />
+ /// </summary>
+ /// <param name="hiddenInput">The HiddenInput</param>
+ /// <remarks>
+ /// SetHiddenInput specifies the requested font style through <see cref="Tizen.NUI.Text.HiddenInput"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetHiddenInput method.
+ /// <code>
+ /// var hiddenInput = new Tizen.NUI.Text.HiddenInput();
+ /// hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
+ /// hiddenInput.SubstituteCharacter = '★';
+ /// hiddenInput.SubstituteCount = 0;
+ /// hiddenInput.ShowLastCharacterDuration = 1000;
+ /// field.SetHiddenInput(hiddenInput);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetHiddenInput(HiddenInput hiddenInput)
+ {
+ SetValue(HiddenInputSettingsProperty, TextUtils.GetHiddenInputMap(hiddenInput));
+ }
+
+ /// <summary>
+ /// Get HiddenInput from TextField. <br />
+ /// </summary>
+ /// <returns>The HiddenInput</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.HiddenInput"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public HiddenInput GetHiddenInput()
+ {
+ return TextUtils.GetHiddenInputStruct((PropertyMap)GetValue(HiddenInputSettingsProperty));
+ }
+
+ /// <summary>
/// The PixelSize property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
GetProperty(TextField.Property.SelectedTextStart).Get(out temp);
return temp;
}
- set
- {
- SetProperty(TextField.Property.SelectedTextStart, new PropertyValue(value));
- NotifyPropertyChanged();
- }
}
/// <summary>
GetProperty(TextField.Property.SelectedTextEnd).Get(out temp);
return temp;
}
- set
- {
- SetProperty(TextField.Property.SelectedTextEnd, new PropertyValue(value));
- NotifyPropertyChanged();
- }
}
/// <summary>
/// <summary>
/// The ellipsis position of the text.
- /// The ellipsis position type when the text size over the layout size.<br />
- /// The ellipsis position: End, Start or Middle.<br />
+ /// Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.<br />
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public EllipsisPosition EllipsisPosition
{
get
/// </code>
/// </example>
/// <since_tizen> 3 </since_tizen>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
public Tizen.NUI.PropertyMap Placeholder
{
get
}
/// <summary>
+ /// Set Placeholder to TextField. <br />
+ /// </summary>
+ /// <param name="placeholder">The Placeholder</param>
+ /// <remarks>
+ /// SetPlaceholder specifies the attributes of the placeholder property through <see cref="Tizen.NUI.Text.Placeholder"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetPlaceholder method.
+ /// <code>
+ /// var placeholder = new Tizen.NUI.Text.Placeholder();
+ /// placeholder.Text = "placeholder text";
+ /// placeholder.TextFocused = "placeholder textFocused";
+ /// placeholder.Color = new Color("#45B39D");
+ /// placeholder.FontFamily = "BreezeSans";
+ /// placeholder.FontStyle = new Tizen.NUI.Text.FontStyle()
+ /// {
+ /// Width = FontWidthType.Expanded,
+ /// Weight = FontWeightType.ExtraLight,
+ /// Slant = FontSlantType.Italic,
+ /// };
+ /// placeholder.PointSize = 25.0f;
+ /// //placeholder.PixelSize = 50.0f;
+ /// placeholder.Ellipsis = true;
+ /// field.SetPlaceholder(placeholder);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetPlaceholder(Placeholder placeholder)
+ {
+ SetValue(PlaceholderProperty, TextUtils.GetPlaceholderMap(placeholder));
+ }
+
+ /// <summary>
+ /// Get Placeholder from TextField. <br />
+ /// </summary>
+ /// <returns>The Placeholder</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Placeholder"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Placeholder GetPlaceholder()
+ {
+ return TextUtils.GetPlaceholderStruct((PropertyMap)GetValue(PlaceholderProperty));
+ }
+
+ /// <summary>
/// The Ellipsis property.<br />
/// Enable or disable the ellipsis.<br />
/// Placeholder PropertyMap is used to add ellipsis to placeholder text.
}
}
- /// Only used by the IL of xaml, will never changed to not hidden.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override bool IsCreateByXaml
- {
- get
- {
- return base.IsCreateByXaml;
- }
- set
- {
- base.IsCreateByXaml = value;
-
- if (value == true)
- {
- this.TextChanged += (obj, e) =>
- {
- this.Text = e.TextField.Text;
- };
- }
- }
- }
-
/// <summary>
/// Get the InputMethodContext instance.
/// </summary>
}
/// <summary>
- /// Select text from start to end index.
+ /// Select text from start to end index. <br />
+ /// The index is valid when 0 or positive. <br />
/// </summary>
/// <param name="start">The start index for selection.</param>
/// <param name="end">The end index for selection.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void SelectText(uint start, uint end)
+ public void SelectText(int start, int end)
{
- Interop.TextField.SelectText(SwigCPtr, start, end);
+ if (start < 0)
+ throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
+ if (end < 0)
+ throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
+
+ Interop.TextField.SelectText(SwigCPtr, (uint)start, (uint)end);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
- }
-
internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
{
SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t(Interop.TextField.InputStyleChangedSignal(SwigCPtr));
this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate);
}
+ if (textFieldSelectionClearedCallbackDelegate != null)
+ {
+ this.SelectionClearedSignal().Disconnect(textFieldSelectionClearedCallbackDelegate);
+ }
+
if (textFieldSelectionChangedCallbackDelegate != null)
{
this.SelectionChangedSignal().Disconnect(textFieldSelectionChangedCallbackDelegate);
}
}
+ TextChanged -= TextEditorTextChanged;
+
base.Dispose(type);
}
}
}
+ private void TextEditorTextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (!isSettingTextInCSharp)
+ {
+ ForceNotifyBindedInstance(TextProperty);
+ }
+ }
+
internal new class Property
{
internal static readonly int TEXT = Interop.TextField.TextGet();