/// </summary>
/// <param name="eventArgs">The click information.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- protected virtual void OnClick(ClickEventArgs eventArgs)
+ protected virtual void OnClicked(ClickedEventArgs eventArgs)
{
}
LayoutChild();
}
- private void OnClickInternal(ClickEventArgs eventArgs)
+ private void OnClickedInternal(ClickedEventArgs eventArgs)
{
Command?.Execute(CommandParameter);
- OnClick(eventArgs);
- Extension?.OnClick(this, eventArgs);
- ClickEvent?.Invoke(this, eventArgs);
+ OnClicked(eventArgs);
+ Extension?.OnClicked(this, eventArgs);
+
+ ClickEventArgs nestedEventArgs = new ClickEventArgs();
+ ClickEvent?.Invoke(this, nestedEventArgs);
+ Clicked?.Invoke(this, eventArgs);
}
private void OnIconRelayout(object sender, EventArgs e)
namespace Tizen.NUI.Components
{
/// <summary>
+ /// ClickedEventArgs is a class to record button click event arguments which will sent to user.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public class ClickedEventArgs : EventArgs
+ {
+ }
+
+ /// <summary>
/// Button is one kind of common component, a button clearly describes what action will occur when the user selects it.
/// Button may contain text or an icon.
/// </summary>
/// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use Clicked event instead.")]
public event EventHandler<ClickEventArgs> ClickEvent;
/// <summary>
+ /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public event EventHandler<ClickedEventArgs> Clicked;
+
+ /// <summary>
/// An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
/// </summary>
/// <since_tizen> 6 </since_tizen>
if (clicked)
{
- ClickEventArgs eventArgs = new ClickEventArgs();
- OnClickInternal(eventArgs);
+ ClickedEventArgs eventArgs = new ClickedEventArgs();
+ OnClickedInternal(eventArgs);
}
}
}
if (clicked)
{
- ClickEventArgs eventArgs = new ClickEventArgs();
- OnClickInternal(eventArgs);
+ ClickedEventArgs eventArgs = new ClickedEventArgs();
+ OnClickedInternal(eventArgs);
}
return true;
/// ClickEventArgs is a class to record button click event arguments which will sent to user.
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use ClickedEventArgs instead.")]
public class ClickEventArgs : EventArgs
{
}
/// <param name="button">The Button instance that the extension currently applied to.</param>
/// <param name="eventArgs">The click event information.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public virtual void OnClick(Button button, Button.ClickEventArgs eventArgs)
+ public virtual void OnClicked(Button button, ClickedEventArgs eventArgs)
{
}
private Calculator calculator;
private Size containerSize = new Size(0, 0);
private ScrollbarStyle scrollbarStyle => ViewStyle as ScrollbarStyle;
+ private bool mScrollEnabled = true;
#endregion Fields
[EditorBrowsable(EditorBrowsableState.Never)]
public override void ScrollTo(float position, uint durationMs = 0, AlphaFunction alphaFunction = null)
{
+ if (mScrollEnabled == false)
+ {
+ return;
+ }
+
if (calculator == null)
{
return;
thumbVisual.UpdateVisual(true);
}
+ /// <inheritdoc/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool ScrollEnabled
+ {
+ get
+ {
+ return mScrollEnabled;
+ }
+ set
+ {
+ if (value != mScrollEnabled)
+ {
+ mScrollEnabled = value;
+ }
+ }
+ }
+
#endregion Methods
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class ScrollbarBase : Control
{
+ private bool mScrollEnabled = true;
+
#region Constructors
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract void Initialize(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false);
+ /// <summary>
+ /// Enable or disable scrolling.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract bool ScrollEnabled { get; set; }
+
#endregion Methods
}
}
private float currentSlidedOffset;
private EventHandler<ValueChangedArgs> valueChangedHandler;
private EventHandler<SlidingFinishedArgs> slidingFinishedHandler;
+ private EventHandler<SliderValueChangedEventArgs> sliderValueChangedHandler;
+ private EventHandler<SliderSlidingFinishedEventArgs> sliderSlidingFinishedHandler;
private EventHandler<StateChangedArgs> stateChangedHandler;
bool isFocused = false;
slidingFinishedHandler(this, args);
}
+ if (null != sliderSlidingFinishedHandler)
+ {
+ SliderSlidingFinishedEventArgs args = new SliderSlidingFinishedEventArgs();
+ args.CurrentValue = curValue;
+ sliderSlidingFinishedHandler(this, args);
+ }
+
UpdateState(isFocused, false);
}
}
namespace Tizen.NUI.Components
{
/// <summary>
+ /// Slider value changed event data.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public class SliderValueChangedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Current Slider value
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public float CurrentValue { get; set; }
+ }
+
+ /// <summary>
+ /// Slider sliding finished event data.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public class SliderSlidingFinishedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Current Slider value
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public float CurrentValue { get; set; }
+ }
+
+ /// <summary>
/// A slider lets users select a value from a continuous or discrete range of values by moving the slider thumb.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// The value changed event handler.
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use ValueChanged event instead.")]
public event EventHandler<ValueChangedArgs> ValueChangedEvent
{
add
/// The sliding finished event handler.
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use SlidingFinished event instead.")]
public event EventHandler<SlidingFinishedArgs> SlidingFinishedEvent
{
add
}
/// <summary>
+ /// The value changed event handler.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public event EventHandler<SliderValueChangedEventArgs> ValueChanged
+ {
+ add
+ {
+ sliderValueChangedHandler += value;
+ }
+ remove
+ {
+ sliderValueChangedHandler -= value;
+ }
+ }
+
+ /// <summary>
+ /// The sliding finished event handler.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public event EventHandler<SliderSlidingFinishedEventArgs> SlidingFinished
+ {
+ add
+ {
+ sliderSlidingFinishedHandler += value;
+ }
+ remove
+ {
+ sliderSlidingFinishedHandler -= value;
+ }
+ }
+
+ /// <summary>
/// The state changed event handler.
/// </summary>
/// <since_tizen> 6 </since_tizen>
args.CurrentValue = curValue;
valueChangedHandler(this, args);
}
+
+ if (sliderValueChangedHandler != null)
+ {
+ SliderValueChangedEventArgs args = new SliderValueChangedEventArgs();
+ args.CurrentValue = curValue;
+ sliderValueChangedHandler(this, args);
+ }
}
private bool OnTouchEventForBgTrack(object source, TouchEventArgs e)
args.CurrentValue = curValue;
slidingFinishedHandler(this, args);
}
+
+ if (null !=sliderSlidingFinishedHandler)
+ {
+ SliderSlidingFinishedEventArgs args = new SliderSlidingFinishedEventArgs();
+ args.CurrentValue = curValue;
+ sliderSlidingFinishedHandler(this, args);
+ }
}
return false;
}
args.CurrentValue = curValue;
valueChangedHandler(this, args);
}
+
+ if (null != sliderValueChangedHandler)
+ {
+ SliderValueChangedEventArgs args = new SliderValueChangedEventArgs();
+ args.CurrentValue = curValue;
+ sliderValueChangedHandler(this, args);
+ }
}
}
/// Value Changed event data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderValueChangedEventArgs instead.")]
public class ValueChangedArgs : EventArgs
{
/// <summary>
/// Curren value
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderValueChangedEventArgs.CurrentValue instead.")]
public float CurrentValue;
}
/// Value Changed event data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderSlidingFinishedEventArgs instead.")]
public class SlidingFinishedArgs : EventArgs
{
/// <summary>
/// Curren value
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderSlidingFinishedEventArgs.CurrentValue instead.")]
public float CurrentValue;
}
/// An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use SelectedChanged event instead.")]
public event EventHandler<SelectEventArgs> SelectedEvent;
/// <summary>
+ /// An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ public event EventHandler<SelectedChangedEventArgs> SelectedChanged;
+
+ /// <summary>
/// Return a copied Style instance of Switch
/// </summary>
/// <remarks>
eventArgs.IsSelected = IsSelected;
SelectedEvent(this, eventArgs);
}
+
+ if (SelectedChanged != null)
+ {
+ SelectedChangedEventArgs eventArgs = new SelectedChangedEventArgs();
+ eventArgs.IsSelected = IsSelected;
+ SelectedChanged(this, eventArgs);
+ }
}
/// <summary>
/// SelectEventArgs is a class to record item selected arguments which will sent to user.
/// </summary>
/// <since_tizen> 6 </since_tizen>
+ [Obsolete("Deprecated in API8; Will be removed in API10. Please use SelectedChangedEventArgs instead.")]
public class SelectEventArgs : EventArgs
{
/// <summary> Select state of Switch </summary>
private Size containerSize = new Size(0, 0);
private Animation thumbStartAngleAnimation;
private Animation thumbSweepAngleAnimation;
+ private bool mScrollEnabled = true;
#endregion Fields
{
currentPosition = position;
+ if (mScrollEnabled == false)
+ {
+ return;
+ }
+
if (thumbVisual == null)
{
return;
thumbVisual.UpdateVisual(true);
}
+ /// <inheritdoc/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool ScrollEnabled
+ {
+ get
+ {
+ return mScrollEnabled;
+ }
+ set
+ {
+ if (value != mScrollEnabled)
+ {
+ mScrollEnabled = value;
+ }
+ }
+ }
+
#endregion Methods
}
}
namespace Tizen.NUI.BaseComponents
{
-
/// <summary>
/// A control which renders a short text string.<br />
/// Text labels are lightweight, non-editable, and do not respond to the user input.<br />
/// <since_tizen> 3 </since_tizen>
public partial class TextLabel : View
{
+ private class TextLayout : LayoutItem
+ {
+ protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
+ {
+ // Padding will be automatically applied by DALi TextLabel.
+ float totalWidth = widthMeasureSpec.Size.AsDecimal();
+ float totalHeight = heightMeasureSpec.Size.AsDecimal();
+
+ if (widthMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly)
+ {
+ if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
+ {
+ totalHeight = Owner.GetHeightForWidth(totalWidth);
+ heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
+ }
+ }
+ else
+ {
+ if (heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly)
+ {
+ // GetWidthForHeight is not implemented.
+ totalWidth = Owner.GetNaturalSize().Width;
+ widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
+ }
+ else
+ {
+ Vector3 naturalSize = Owner.GetNaturalSize();
+ totalWidth = naturalSize.Width;
+ totalHeight = naturalSize.Height;
+
+ heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
+ widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
+ }
+ }
+
+ MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
+ MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
+
+ SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
+ ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));
+ }
+ }
+
static TextLabel() { }
private string textLabelSid = null;
public TextLabel() : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Layout = new TextLayout();
}
/// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
[EditorBrowsable(EditorBrowsableState.Never)]
public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true, viewStyle)
{
+ Layout = new TextLayout();
}
/// <summary>
public TextLabel(bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Layout = new TextLayout();
SetVisible(shown);
}
public TextLabel(string text) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Layout = new TextLayout();
}
/// <summary>
public TextLabel(string text, bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Layout = new TextLayout();
SetVisible(shown);
}
set
{
Extents padding = value;
- if (Layout !=null)
+ if (Layout != null)
{
// Layout set so store Padding in LayoutItem instead of in View.
// If View stores the Padding value then Legacy Size Negotiation will overwrite
Layout.Padding = value;
// If Layout is a LayoutItem then it could be a View that handles it's own padding.
// Let the View keeps it's padding. Still store Padding in Layout to reduce code paths.
- if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind.
+ if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
{
- padding = new Extents(0,0,0,0); // Reset value stored in View.
+ padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
}
- _layout?.RequestLayout();
}
+
SetValue(PaddingProperty, padding);
NotifyPropertyChanged();
- _layout?.RequestLayout();
}
}
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
+using System.Collections.Generic;
+using System.ComponentModel;
using System.IO;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Wearable;
-namespace Tizen.NUI.Samples
+namespace Tizen.NUI.Utility
{
+
+ /// <summary>
+ /// This is a class for stroing the text of a page.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
class PageData
{
public string previousTag {get; set;}
public int endOffset {get; set;}
}
+ /// <summary>
+ /// This is a class that stores information when parsing markup text.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
class TagData
{
public string tagName {get; set;}
public bool isEndTag {get; set;}
}
+ /// <summary>
+ /// This is utility class for paging very long text.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
public class TextPageUtil
{
private static char LESS_THAN = '<';
private List<char> characterList;
private string pageString;
-
+ /// <summary>
+ /// When text is inputed, the text is paging in the TextLabe size unit.
+ /// <returns>The total number of pages.</returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int SetText(TextLabel label, string str)
{
if(str == null) return 0;
return totalPageCnt;
}
+ /// <summary>
+ /// Input the page number returns the text of the page.
+ /// <returns>The text of the page.</returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string GetText(int pageNum)
{
if( pageNum > totalPageCnt || pageNum < 1 ) {
Interop.Window.delete_Window(swigCPtr);
}
+ private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
+
+ private static readonly object locker = new object();
+
+ private static int key = 0;
+
+ private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
+
+ private struct internalHookCallbackType
+ {
+ public FrameCallbackType userCallback;
+ public int frameId;
+ }
+
+ private static void OnInternalHookFrameCallback(int id)
+ {
+ lock (locker)
+ {
+ if (frameCallbackList.ContainsKey(id))
+ {
+ if (frameCallbackList[id].userCallback != null)
+ {
+ frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
+ frameCallbackList.Remove(id);
+ }
+ else
+ {
+ NUILog.Error($"found userCallback is NULL");
+ frameCallbackList.Remove(id);
+ }
+ }
+ }
+ }
+
+ private int AddInterHookCallback(FrameCallbackType callback, int frameId)
+ {
+ if (null == callback)
+ {
+ throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
+ }
+ var assignedKey = 0;
+ lock (locker)
+ {
+ key++;
+ assignedKey = key;
+ frameCallbackList.Add(assignedKey, new internalHookCallbackType()
+ {
+ userCallback = callback,
+ frameId = frameId,
+ });
+ }
+ return assignedKey;
+ }
+
/// <summary>
/// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
{
- IntPtr ip = Marshal.GetFunctionPointerForDelegate<Delegate>(callback);
-
- if (IntPtr.Zero == ip)
- {
- throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
- }
-
- Interop.WindowInternal.AddFrameRenderedCallback(swigCPtr, new HandleRef(this, ip), frameId);
+ var assignedKey = AddInterHookCallback(callback, frameId);
+ Interop.WindowInternal.AddFrameRenderedCallback(swigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
{
- IntPtr ip = Marshal.GetFunctionPointerForDelegate<Delegate>(callback);
-
- if (IntPtr.Zero == ip)
- {
- throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
- }
-
- Interop.WindowInternal.AddFramePresentedCallback(swigCPtr, new HandleRef(this, ip), frameId);
+ var assignedKey = AddInterHookCallback(callback, frameId);
+ Interop.WindowInternal.AddFramePresentedCallback(swigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Window win;
Window.FrameCallbackType cb;
+ TextLabel tl;
+ View view;
void test()
{
+ tlog.Fatal(tag, $"test start");
win = NUIApplication.GetDefaultWindow();
win.TouchEvent += WinTouchEvent;
- View view = new View();
+ view = new View();
view.Size = new Size(100, 100);
view.BackgroundColor = Color.Blue;
+ view.Focusable = true;
+ view.KeyEvent += View_KeyEvent;
win.Add(view);
cb = testCallback;
Timer timer = new Timer(5000);
timer.Tick += testOnTick;
timer.Start();
+
+ tl = new TextLabel("frameId");
+ tl.Size = new Size(500, 200);
+ tl.Position = new Position(10, 200);
+ tl.BackgroundColor = Color.White;
+ win.Add(tl);
+
+ FocusManager.Instance.SetCurrentFocusView(view);
}
private void WinTouchEvent(object sender, Window.TouchEventArgs e)
void testCallback(int id)
{
- Console.WriteLine($"testCallback() id={id}");
+ tlog.Fatal(tag, $"testCallback() id={id}");
+ tl.Text = $"frameId={id}";
+ }
+
+ private bool View_KeyEvent(object source, View.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down)
+ {
+ if (e.Key.KeyPressedName == "1")
+ {
+ cb = testCallback;
+ win.AddFrameRenderedCallback(cb, cnt++);
+ tlog.Fatal(tag, $"1) testOnTick() AddFrameRenderedCallback() send id={cnt}");
+ }
+ else if (e.Key.KeyPressedName == "2")
+ {
+ cb = testCallback;
+ win.AddFramePresentedCallback(cb, cnt++);
+ tlog.Fatal(tag, $"2) testOnTick() AddFramePresentedCallback() send id={cnt}");
+ }
+ else if (e.Key.KeyPressedName == "3")
+ {
+ cb = testCallback;
+ win.AddFramePresentedCallback(cb, cnt++);
+ cb = null;
+ tlog.Fatal(tag, $"3) testOnTick() AddFramePresentedCallback() send id={cnt}");
+ }
+ else if (e.Key.KeyPressedName == "4")
+ {
+ win.AddFrameRenderedCallback((int id) =>
+ {
+ tlog.Fatal(tag, $"testCallback() id={id}");
+ tl.Text = $"frameId={id}";
+ }, cnt++);
+ tlog.Fatal(tag, $"4) testOnTick() AddFrameRenderedCallback() send id={cnt}");
+ }
+ else if (e.Key.KeyPressedName == "Return")
+ {
+ Random rand = new Random();
+ view.BackgroundColor = new Color((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble(), 1);
+ }
+ }
+ return true;
}
root.Add(box);
box.image.SetValues();
- box.but1.ClickEvent += But1_ClickEvent;
+ box.but1.Clicked += But1_Clicked;
box.but1.Style.Text.Text = new Selector<string>
{
Normal = "Pause !",
Selected = "Play !"
};
- box.but2.ClickEvent += But2_ClickEvent;
+ box.but2.Clicked += But2_Clicked;
box.but2.Style.Text.Text = new Selector<string>
{
Normal = "Stop !",
box2.image.URLs = list;
box2.image.Play();
- box2.but1.ClickEvent += But1_ClickEvent1;
+ box2.but1.Clicked += But1_Clicked1;
box2.but1.Style.Text.Text = new Selector<string>
{
Normal = "Pause !",
box2.but1.Style.Text.MultiLine = true;
- box2.but2.ClickEvent += But2_ClickEvent1;
+ box2.but2.Clicked += But2_Clicked1;
box2.but2.IsSelectable = false;
box2.but2.Style.Text.Text = new Selector<string>
{
Pressed = "Up 100ms",
};
- box2.but3.ClickEvent += But3_ClickEvent;
+ box2.but3.Clicked += But3_Clicked;
box2.but3.IsSelectable = false;
box2.but3.Style.Text.Text = new Selector<string>
{
}
- private void But3_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void But3_Clicked(object sender, ClickedEventArgs e)
{
- tlog.Fatal(tag, $"But3_ClickEvent()!");
+ tlog.Fatal(tag, $"But3_Clicked()!");
var src = sender as Button;
if (src != null)
{
}
}
- private void But2_ClickEvent1(object sender, Button.ClickEventArgs e)
+ private void But2_Clicked1(object sender, ClickedEventArgs e)
{
- tlog.Fatal(tag, $"But2_ClickEvent1()!");
+ tlog.Fatal(tag, $"But2_Clicked1()!");
var src = sender as Button;
if (src != null)
{
box2.status.Text = $"playing now, frame delay: {box2.image.FrameDelay}ms, loop count: {box2.image.LoopCount}";
}
}
- private void But1_ClickEvent1(object sender, Button.ClickEventArgs e)
+ private void But1_Clicked1(object sender, ClickedEventArgs e)
{
- tlog.Fatal(tag, $"But1_ClickEvent1()!");
+ tlog.Fatal(tag, $"But1_Clicked1()!");
var src = sender as Button;
if (src != null)
{
}
}
- private void But2_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void But2_Clicked(object sender, ClickedEventArgs e)
{
- tlog.Fatal(tag, $"But2_ClickEvent()!");
+ tlog.Fatal(tag, $"But2_Clicked()!");
var src = sender as Button;
if (src != null)
{
}
}
- private void But1_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void But1_Clicked(object sender, ClickedEventArgs e)
{
- tlog.Fatal(tag, $"But1_ClickEvent()!");
+ tlog.Fatal(tag, $"But1_Clicked()!");
var src = sender as Button;
if (src != null)
{
iconButton.Size = new Size(80, 80);
iconButton.Icon.ResourceUrl = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
parent2.Add(iconButton);
- iconButton.ClickEvent += (ojb, e) => {
+ iconButton.Clicked += (ojb, e) => {
var btn = iconButton.Icon.GetParent() as Button;
string name = btn.Name;
};
//checkCaptureNew();
}
- private void onCaptureFinished(object sender, CaptureFinishStateEventArgs e)
+ private void onCaptureFinished(object sender, CaptureFinishedEventArgs e)
{
log.Debug(tag, $"onCaptureFinished() statue={e.Success} \n");
style.PivotPoint = PivotPoint.TopLeft;
style.Size = new Size(58, 58);
mSlideshowButton = new Button(style);
- mSlideshowButton.ClickEvent += OnPushButtonClicked;
+ mSlideshowButton.Clicked += OnPushButtonClicked;
mSlideshowButton.RaiseToTop();
if (mSlideshowButton)
{
tool_bar.Remove(mSlideshowButton);
- mSlideshowButton.ClickEvent -= OnPushButtonClicked;
+ mSlideshowButton.Clicked -= OnPushButtonClicked;
mSlideshowButton.Dispose();
mSlideshowButton = null;
}
Size = new Size(100, 50),
Margin = 10,
};
- btn_1.ClickEvent += Btn1_ClickEvent;
- btn_2.ClickEvent += Btn2_ClickEvent;
+ btn_1.Clicked += Btn1_Clicked;
+ btn_2.Clicked += Btn2_Clicked;
bottomView.Add(btn_1);
bottomView.Add(btn_2);
Size = new Size(50, 50),
Margin = 10,
};
- btn_5.ClickEvent += Btn5_ClickEvent;
- btn_6.ClickEvent += Btn6_ClickEvent;
+ btn_5.Clicked += Btn5_Clicked;
+ btn_6.Clicked += Btn6_Clicked;
bottomView_2.Add(btn_5);
bottomView_2.Add(btn_6);
}
- private void Btn1_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void Btn1_Clicked(object sender, ClickedEventArgs e)
{
GridLayout layout = new GridLayout();
layout.Columns = 5;
layout.LayoutWithTransition = true;
}
- private void Btn2_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void Btn2_Clicked(object sender, ClickedEventArgs e)
{
GridLayout layout = new GridLayout();
layout.LayoutWithTransition = true;
layoutOption = 2;
}
- private void Btn5_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void Btn5_Clicked(object sender, ClickedEventArgs e)
{
ObjectProcess(true);
}
- private void Btn6_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void Btn6_Clicked(object sender, ClickedEventArgs e)
{
ObjectProcess(false);
}
mEditButton.IsSelectable = true;
mEditButton.Size = new Size(34, 34);
mEditButton.LeaveRequired = true;
- mEditButton.ClickEvent += (obj, e) =>
+ mEditButton.Clicked += (obj, e) =>
{
SwitchToNextMode();
};
mLayoutButton.IsSelectable = true;
mLayoutButton.Size = new Size(34, 34);
mLayoutButton.LeaveRequired = true;
- mLayoutButton.ClickEvent += (obj, e) =>
+ mLayoutButton.Clicked += (obj, e) =>
{
mCurrentLayout = (mCurrentLayout + 1) % (int)mItemView.GetLayoutCount();
ChangeLayout();
mDeleteButton.Size = new Size(50, 50);
mDeleteButton.LeaveRequired = true;
mDeleteButton.Hide();
- mDeleteButton.ClickEvent += (obj, e) =>
+ mDeleteButton.Clicked += (obj, e) =>
{
ItemIdContainer removeList = new ItemIdContainer();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
mInsertButton.Size = new Size(50, 50);
mInsertButton.LeaveRequired = true;
mInsertButton.Hide();
- mInsertButton.ClickEvent += (obj, e) =>
+ mInsertButton.Clicked += (obj, e) =>
{
ItemContainer insertList = new ItemContainer();
Random random = new Random();
mReplaceButton.Size = new Size(50, 50);
mReplaceButton.LeaveRequired = true;
mReplaceButton.Hide();
- mReplaceButton.ClickEvent += (obj, e) =>
+ mReplaceButton.Clicked += (obj, e) =>
{
ItemContainer replaceList = new ItemContainer();
Random random = new Random();
button[0].BackgroundColor = Color.Green;
layout[0].Add(button[0]);
button[0].Focusable = true;
- button[0].ClickEvent += propFpsAdd;
+ button[0].Clicked += propFpsAdd;
FocusManager.Instance.SetCurrentFocusView(button[0]);
button[1] = new Button();
button[1].BackgroundColor = Color.Green;
layout[0].Add(button[1]);
button[1].Focusable = true;
- button[1].ClickEvent += propFpsMinus;
+ button[1].Clicked += propFpsMinus;
FocusManager.Instance.SetCurrentFocusView(button[1]);
gridLayout.Add(layout[0]);
button.WidthSpecification = 580;
button.HeightSpecification = 80;
button.TextLabel.Text = "LayoutDirection is left to right";
- button.ClickEvent += ButtonClickEvent;
+ button.Clicked += ButtonClicked;
parent1.Add(parent2);
parent1.Add(button);
}
}
- private void ButtonClickEvent(object sender, Button.ClickEventArgs e)
+ private void ButtonClicked(object sender, ClickedEventArgs e)
{
if (popup.LayoutDirection == ViewLayoutDirectionType.LTR)
{
button[0].BackgroundColor = Color.Green;
layout[2].Add(button[0]);
button[0].Focusable = true;
- button[0].ClickEvent += ProgressAdd;
+ button[0].Clicked += ProgressAdd;
button[1] = new Button();
button[1].WidthSpecification = 140;
button[1].BackgroundColor = Color.Green;
layout[2].Add(button[1]);
button[1].Focusable = true;
- button[1].ClickEvent += ProgressMinus;
+ button[1].Clicked += ProgressMinus;
}
private void CreateAttrElements()
Name = "test button",
};
- button.ClickEvent += (object source, Button.ClickEventArgs args) =>
+ button.Clicked += (object source, ClickedEventArgs args) =>
{
if (++cnt % 2 == 0)
{
}
button[0].Text = "+";
- button[0].ClickEvent += Scroll1Add;
+ button[0].Clicked += Scroll1Add;
button[1].Text = "-";
- button[1].ClickEvent += Scroll1Minus;
+ button[1].Clicked += Scroll1Minus;
button[2].Text = "+ / - 4";
- button[2].ClickEvent += Scroll1_2move;
+ button[2].Clicked += Scroll1_2move;
button[3].Text = "change direction";
- button[3].ClickEvent += Scroll1_2Changed;
+ button[3].Clicked += Scroll1_2Changed;
button[3].Size = new Size(180, 50);
// Set focus to Add Button
Position = new Position(10, H1 + 20),
Text = "add new child",
};
- b1.ClickEvent += B1_ClickEvent;
+ b1.Clicked += B1_Clicked;
win.Add(b1);
b2 = new Button()
Position = new Position(10, H1 + 20 + 120),
Text = "refresh sibling order",
};
- b2.ClickEvent += B2_ClickEvent;
+ b2.Clicked += B2_Clicked;
win.Add(b2);
b3 = new Button()
Position = new Position(10, H1 + 20 + 120 + 120),
Text = "place children to fit parent",
};
- b3.ClickEvent += B3_ClickEvent;
+ b3.Clicked += B3_Clicked;
win.Add(b3);
text = new TextLabel()
win.Add(text);
}
- private void B1_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void B1_Clicked(object sender, ClickedEventArgs e)
{
string n = "CH" + (v.ChildCount + 1);
var ch = new TextLabel();
a.Finished += A_Finished;
}
- private void B2_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void B2_Clicked(object sender, ClickedEventArgs e)
{
for(int i=0; i < v.ChildCount; i++)
{
}
}
- private void B3_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void B3_Clicked(object sender, ClickedEventArgs e)
{
for (int i = 0; i < v.ChildCount; i++)
{
public void Deactivate()
{
- b1.ClickEvent -= B1_ClickEvent;
- b2.ClickEvent -= B2_ClickEvent;
- b3.ClickEvent -= B3_ClickEvent;
+ b1.Clicked -= B1_Clicked;
+ b2.Clicked -= B2_Clicked;
+ b3.Clicked -= B3_Clicked;
b1.Unparent();
b2.Unparent();
source.MinValue = MIN_VALUE;
source.MaxValue = MAX_VALUE;
source.StateChangedEvent += OnStateChanged;
- source.ValueChangedEvent += OnValueChanged;
- source.SlidingFinishedEvent += OnSlidingFinished;
+ source.ValueChanged += OnValueChanged;
+ source.SlidingFinished += OnSlidingFinished;
source.Size = new Size(w, h);
source.CurrentValue = curValue;
return source;
source.MinValue = MIN_VALUE;
source.MaxValue = MAX_VALUE;
source.StateChangedEvent += OnStateChanged;
- source.ValueChangedEvent += OnValueChanged;
- source.SlidingFinishedEvent += OnSlidingFinished;
+ source.ValueChanged += OnValueChanged;
+ source.SlidingFinished += OnSlidingFinished;
source.Size = new Size(w, h);
source.CurrentValue = curValue;
return source;
}
- private void OnValueChanged(object sender, Slider.ValueChangedArgs args)
+ private void OnValueChanged(object sender, SliderValueChangedEventArgs args)
{
Slider source = sender as Slider;
if (source != null)
}
}
- private void OnSlidingFinished(object sender, Slider.SlidingFinishedArgs args)
+ private void OnSlidingFinished(object sender, SliderSlidingFinishedEventArgs args)
{
Slider source = sender as Slider;
if (source != null)
button = new Button(buttonStyle);
button.Size = new Size(500, 80);
button.TextLabel.Text = mode[index];
- button.ClickEvent += ButtonClickEvent;
+ button.Clicked += ButtonClicked;
parentView[2].Add(button);
// Button of LayoutDirection
button2 = new Button(buttonStyle);
button2.Size = new Size(500, 80);
button2.TextLabel.Text = "LayoutDirection is left to right";
- button2.ClickEvent += ButtonClickEvent2;
+ button2.Clicked += ButtonClicked2;
parentView[2].Add(button2);
}
createText[1].Text = "Create Tab just by Style, Selected index from " + e.PreviousIndex + " to " + e.CurrentIndex;
}
- private void ButtonClickEvent(object sender, Button.ClickEventArgs e)
+ private void ButtonClicked(object sender, ClickedEventArgs e)
{
index = (index + 1) % 4;
button.TextLabel.Text = mode[index];
};
}
- private void ButtonClickEvent2(object sender, Button.ClickEventArgs e)
+ private void ButtonClicked2(object sender, ClickedEventArgs e)
{
if (tab.LayoutDirection == ViewLayoutDirectionType.LTR)
{
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Wearable;
+using Tizen.NUI.Utility;
using System;
using System.IO;
{
Window window = NUIApplication.GetDefaultWindow();
- TextLabelStyle attr = new TextLabelStyle
- {
-
- BackgroundColor = Color.Yellow,
- TextColor = Color.Blue,
- };
-
-
- label = new TextLabel(attr);
+ label = new TextLabel();
label.Size = new Size(300, 700);
label.PointSize = 11.0f;
label.MultiLine = true;
-
TextPageUtil util = new TextPageUtil();
int pageCount = util.SetText( label, LoadTerms() );
Tizen.Log.Error("NUI", $"pageCount: {pageCount}\n");
parentView[1].Add(button[i]);
}
button[0].Text = "toast1_1 Show";
- button[0].ClickEvent += toast1_1Show;
+ button[0].Clicked += toast1_1Show;
button[1].Text = "toast2_1 Show";
- button[1].ClickEvent += toast2_1Show;
+ button[1].Clicked += toast2_1Show;
// Set init focus
FocusManager.Instance.SetCurrentFocusView(button[0]);
myContent1.ParentOrigin = ParentOrigin.Center;
myContent1.PivotPoint = PivotPoint.Center;
myPopup1.AppendContent("ContentText", myContent1);
- leftButton.ClickEvent += LeftButton_ClickEvent;
- rightButton.ClickEvent += RightButton_ClickEvent;
+ leftButton.Clicked += LeftButton_Clicked;
+ rightButton.Clicked += RightButton_Clicked;
myPopup1.OutsideClicked += Mp_OutsideClicked;
myPopup1.ContentContainer.WidthResizePolicy = ResizePolicyType.FitToChildren;
NUIApplication.GetDefaultWindow().Add(t1);
}
- private void RightButton_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void RightButton_Clicked(object sender, ClickedEventArgs e)
{
myPopup1.Dismiss();
}
- private void LeftButton_ClickEvent(object sender, Button.ClickEventArgs e)
+ private void LeftButton_Clicked(object sender, ClickedEventArgs e)
{
myContent1.TextColor = Color.Yellow;
}