Пример #1
0
        /// <summary>
        /// Get the control at specified position.
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="control"></param>
        /// <returns></returns>
        private GLControl GetControlAt(int x, int y, GLControl control)
        {
            GLControl result = null;

            if (control.ContainsPoint(x, y))
            {
                if (control.AcceptPicking)
                {
                    result = control;
                }

                foreach (var item in control.Children)
                {
                    GLControl child = GetControlAt(x, y, item);
                    if (child != null)
                    {
                        result = child;
                        break;
                    }
                }
            }

            return(result);
        }