Example #1
0
        public Button(System.Action clickEvent)
        {
            AddToClassList(ussClassName);

            // Click-once behaviour
            clickable = new PointerClickable(clickEvent);
        }
Example #2
0
        /// <summary>
        /// Constructs a button with an Action that is triggered when the button is clicked.
        /// </summary>
        /// <param name="clickEvent">The action triggered when the button is clicked.</param>
        /// <remarks>
        /// By default, a single left mouse click triggers the Action. To change the activator, modify <see cref="clickable"/>.
        /// </remarks>
        public Button(System.Action clickEvent)
        {
            AddToClassList(ussClassName);

            // Click-once behaviour
            clickable = new PointerClickable(clickEvent);

            RegisterCallback <NavigationSubmitEvent>(OnNavigationSubmit);
            RegisterCallback <KeyDownEvent>(OnKeyDown);
        }
 public void SetAction(System.Action clickEvent, long delay, long interval)
 {
     this.RemoveManipulator(m_Clickable);
     m_Clickable = new PointerClickable(clickEvent, delay, interval);
     this.AddManipulator(m_Clickable);
 }