コード例 #1
0
        protected void Gc_MouseClick(object sender, GLMouseEventArgs e)
        {
            SetViewScreenCoord(ref e);

            if (mousedowninitialcontrol == currentmouseover && currentmouseover != null) // clicks only occur if mouse is still over initial control
            {
                e.WasFocusedAtClick = currentmouseover == currentfocus;                  // record if clicking on a focused item

                SetFocus(currentmouseover);

                if (currentmouseover != null)                    // set focus could have force a loss, thru the global focus hook
                {
                    SetControlLocation(ref e, currentmouseover); // reset location etc

                    OnGlobalMouseClick(currentmouseover, e);

                    if (currentmouseover.Enabled)
                    {
                        currentmouseover.OnMouseClick(e);
                    }
                }
            }
            else if (currentmouseover == null)        // not over any control, even control display, but still click, (due to screen coord clip space), so send thru the displaycontrol
            {
                SetFocus(null);
                OnGlobalMouseClick(null, e);
                this.OnMouseClick(e);
            }
        }