예제 #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);
                }
            }
        }
예제 #2
0
 protected override void OnMousePressed(object sender, MousePressedEventArgs e)
 {
     base.OnMousePressed(sender, e);
 }
예제 #3
0
 private void MousePressedEventDispatcher(MousePressedEventArgs e)
 {
     var h = Pressed;
     if (h != null)
         h(this, e);
 }
예제 #4
0
 protected virtual void OnMousePressed(object sender, MousePressedEventArgs e)
 {
     //add common logic here...
 }