Ejemplo 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);
            }
Ejemplo n.º 2
0
            internal void RefreshEnabled()
            {
                bool disabled = !CustomButton.EnabledNow(Core);

                if (mDrawDisabled != disabled)
                {
                    mDrawDisabled = disabled;
                    Refresh();
                }
            }
Ejemplo 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);
            }
Ejemplo n.º 4
0
            public void PerformMouseDown(MouseEventArgs e)
            {
                if (e.Button != MouseButtons.Left)
                {
                    return;
                }

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

                if (cb.ButtonType == CustomButton.ButtonTypes.PushButton && !PositionUnlocked)
                {
                    Core.ExecuteCustombutton(cb.GCode);
                    BackColor = Color.LightBlue;
                }

                base.OnMouseDown(e);
            }