Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
        private void c_MouseEnter(object sender, EventArgs e)
        {
            Control parent = (Control)sender;

            if (parent != SelectedControl)
            {
                IRadioControl high = (IRadioControl)parent;
                high.UserOver();
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 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);
        }