예제 #1
0
        private void c_MouseLeave(object sender, EventArgs e)
        {
            Control parent = (Control)sender;

            if (parent != SelectedControl && parent is IRadioControl)
            {
                IRadioControl high = (IRadioControl)parent;
                high.UserLeave();
            }
        }
예제 #2
0
        private void c_MouseEnter(object sender, EventArgs e)
        {
            Control parent = (Control)sender;

            if (parent != SelectedControl)
            {
                IRadioControl high = (IRadioControl)parent;
                high.UserOver();
            }
        }
예제 #3
0
        private void OnClick(object sender)
        {
            if (!CanSelectControls)
            {
                return;
            }

            Control parent = (Control)sender;

            if (parent is TransparentControl)
            {
                parent = parent.Parent;
            }

            if (parent is IRadioControl)
            {
                IRadioControl parentCon = (IRadioControl)parent;
                if (!parentCon.EnableClicking)
                {
                    return;
                }
            }

            for (int i = 0; i < contentPanel.Controls.Count; i++)
            {
                Control c = contentPanel.Controls[i];
                if (c is IRadioControl)
                {
                    IRadioControl high = (IRadioControl)c;
                    if (parent == c && high.EnableClicking)
                    {
                        // highlight
                        high.RadioSelected();
                    }
                    else
                    {
                        high.RadioUnselected();
                    }
                }
            }

            if (parent != null &&
                parent != SelectedControl)
            {
                if (this.SelectedChanged != null)
                {
                    SelectedControl = parent;
                    this.SelectedChanged(SelectedControl);
                }
            }

            SelectedControl = parent;
        }
예제 #4
0
        private void c_MouseLeave(object sender, EventArgs e)
        {
            Control parent = (Control)sender;

            if (parent is TransparentControl)
            {
                parent = parent.Parent;
            }

            if (parent is IRadioControl)
            {
                IRadioControl high = (IRadioControl)parent;
                if (!high.EnableClicking || parent != SelectedControl)
                {
                    high.UserLeave();
                }
            }
        }
예제 #5
0
        private void c_Click(object sender, EventArgs e)
        {
            Control parent = (Control)sender;

            for (int i = 0; i < this.Controls.Count; i++)
            {
                Control c = this.Controls[i];
                if (c is IRadioControl)
                {
                    IRadioControl high = (IRadioControl)c;
                    if (parent == c)
                    {
                        // highlight
                        high.RadioSelected();
                    }
                    else
                    {
                        high.RadioUnselected();
                    }
                }
            }

            if (parent != null &&
                parent != SelectedControl)
            {
                if (this.SelectedChanged != null)
                {
                    SelectedControl = parent;
                    this.SelectedChanged(SelectedControl, this);
                }
            }

            SelectedControl = parent;

            this.OnClick(e);
        }