Example #1
0
        protected virtual void OnMousePressed(object sender, MousePressedEventArgs e)
        {
            if (!Enabled || Texture == null)
                return; //avoid null value

            if (mouseInner)
            {
                //gui component is clicked
                ClickEventDispatcher(EventArgs.Empty);
                if (!focused)
                {
                    focused = true;     //gui component is focused
                    FocusedEventDispatcher(EventArgs.Empty);
                }
            }
            else
            {
                if (focused)
                {
                    focused = false;    //gui component lost focus
                    LostFocusEventDispatcher(EventArgs.Empty);
                }
            }
        }
Example #2
0
 protected override void OnMousePressed(object sender, MousePressedEventArgs e)
 {
     base.OnMousePressed(sender, e);
 }
Example #3
0
 private void MousePressedEventDispatcher(MousePressedEventArgs e)
 {
     var h = Pressed;
     if (h != null)
         h(this, e);
 }
Example #4
0
 protected virtual void OnMousePressed(object sender, MousePressedEventArgs e)
 {
     //add common logic here...
 }