Exemplo n.º 1
0
            public void PerformClick(EventArgs e)
            {
                if (((MouseEventArgs)e).Button != MouseButtons.Left)
                {
                    return;
                }

                if (mDrawDisabled || !CustomButton.EnabledNow(Core))
                {
                    return;
                }

                if (cb.ButtonType == CustomButton.ButtonTypes.Button)
                {
                    Core.ExecuteCustombutton(cb.GCode);
                }

                if (cb.ButtonType == CustomButton.ButtonTypes.TwoStateButton)
                {
                    on = !on;
                    Core.ExecuteCustombutton(on ? cb.GCode : cb.GCode2);
                    BackColor = on ? Color.Orange : Parent.BackColor;
                }

                base.OnClick(e);
            }
Exemplo n.º 2
0
            internal void RefreshEnabled()
            {
                bool disabled = !CustomButton.EnabledNow(Core);

                if (mDrawDisabled != disabled)
                {
                    mDrawDisabled = disabled;
                    Refresh();
                }
            }
Exemplo n.º 3
0
            public void PerformMouseUp(MouseEventArgs e)
            {
                if (e.Button != MouseButtons.Left)
                {
                    return;
                }

                if (mDrawDisabled || !CustomButton.EnabledNow(Core))
                {
                    return;
                }

                if (cb.ButtonType == CustomButton.ButtonTypes.PushButton)
                {
                    Core.ExecuteCustombutton(cb.GCode2);
                    BackColor = Parent.BackColor;
                }

                base.OnMouseUp(e);
            }