public PageButton() { InitializeComponent(); mouseAction = MouseActionType.None; this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true); }
protected override void OnMouseLeave(EventArgs e) { if (this.ForeColor != Color.Red) { this.mouseAction = MouseActionType.None; base.OnMouseLeave(e); this.Invalidate(); } }
protected override void OnMouseDown(MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this.mouseAction = MouseActionType.BUTTON_DOWN; this.Invalidate(); } base.OnMouseDown(e); }
protected override void OnMouseDown(MouseEventArgs mevent) { if (mevent.Button == MouseButtons.Left) { this.mouseActionType = MouseActionType.Click; this.Invalidate(); } base.OnMouseDown(mevent); }
public GZXButton() { InitializeComponent(); mouseActionType = MouseActionType.None; this.SetStyle(ControlStyles.AllPaintingInWmPaint |//禁止擦除背景 ControlStyles.DoubleBuffer |//双缓冲 ControlStyles.UserPaint, true); this.Font = new Font("Aial Black", 12, FontStyle.Bold); this.BackColor = Color.DarkTurquoise; this.Size = new Size(112, 48); }
public CusButton() { InitializeComponent(); mouseAction = MouseActionType.BUTTON_UP; this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true); //The following defaults are better suited to draw the text outline //this.Font = new Font("宋体", 20); this.Size = new Size(90, 41); }
protected override void OnPaint(PaintEventArgs e) { Color backColor = this.BackColor; if (this.ForeColor != Color.Red && mouseAction == MouseActionType.Click) { mouseAction = MouseActionType.None; } if (this.ForeColor == Color.Red) { mouseAction = MouseActionType.Click; } switch (mouseAction) { case MouseActionType.None: backColor = Color.Transparent; this.Cursor = Cursors.Default; break; case MouseActionType.Hover: backColor = ColorTranslator.FromHtml("#417EB7"); //ColorTranslator.FromHtml("#ADA8AC"); 标签栏的背景色 this.Cursor = Cursors.Hand; break; case MouseActionType.Click: backColor = Color.Transparent; this.Cursor = Cursors.Default; break; } Brush backbrush = new SolidBrush(backColor); e.Graphics.FillRectangle(backbrush, ClientRectangle);//刷背景色 Color borderColor = ColorTranslator.FromHtml("#A6A6A6");// #F7F7F7是背景色 if (mouseAction == MouseActionType.None) //画边框 { ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle, borderColor, 1, ButtonBorderStyle.Solid, borderColor, 1, ButtonBorderStyle.Solid, borderColor, 1, ButtonBorderStyle.Solid, borderColor, 1, ButtonBorderStyle.Solid); } base.OnPaint(e); }
void Update() { if (Input.GetMouseButtonDown(0)) { RaycastHit hit; if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit)) { // If we've clicked on the model, then modify the model CurrentMouseActionType = MouseActionType.Edit; Client.SendTcp(VoxelCommand.Add(new Voxel(ConvertToWorldAdjPos(hit), _hsvColorPicker.currentColor))); } else { if (!EventSystem.current.IsPointerOverGameObject()) { // If we've clicked on nothing (the background), then move the camera CurrentMouseActionType = MouseActionType.CameraMove; } } } else if (Input.GetMouseButtonUp(0)) { CurrentMouseActionType = MouseActionType.None; } if (Input.GetMouseButtonDown(1)) { RaycastHit hit; if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit)) { // If we've clicked on the model, then modify the model Client.SendTcp(VoxelCommand.Remove(ConvertToWorldHitPos(hit))); } } // TODO: Only zoom when the app has focus float scroll = Input.GetAxis(Constants.Input.MouseScrollWheel); if (scroll > 0) { CameraController.Instance.IncrementCamDistance(); } else if (scroll < 0) { CameraController.Instance.DecrementCamDistance(); } }
public MousePoint(int x, int y, MouseActionType actionType, bool actualMousePoint) : this(x, y, actionType) { ActualMousePoint = actualMousePoint; }
protected override void OnMouseUp(MouseEventArgs mevent) { this.mouseActionType = MouseActionType.Hover; this.Invalidate(); base.OnMouseUp(mevent); }
public MouseFunction() { Action = MouseActionType.LeftClick; }
protected override void OnMouseLeave(EventArgs e) { this.mouseAction = MouseActionType.None; this.Invalidate(); base.OnMouseLeave (e); }
protected override void OnMouseEnter(EventArgs e) { this.mouseAction = MouseActionType.Hover; this.Invalidate(); base.OnMouseEnter (e); }
protected override void OnMouseUp(MouseEventArgs e) { if (this.Bounds.Contains(e.X, e.Y)) this.mouseAction = MouseActionType.Hover; else this.mouseAction = MouseActionType.None; this.Invalidate(); base.OnMouseUp (e); }
protected override void OnMouseUp(MouseEventArgs e) { this.mouseAction = MouseActionType.MOUSE_OVER; this.Invalidate(); base.OnMouseUp(e); }
public MouseFunction(MouseFunction other) { Action = other.Action; }
public override void Deserialize(BinaryReader reader) { Action = (MouseActionType)reader.ReadUInt32(); }
public MousePoint(int x, int y, MouseActionType actionType) : this(x, y) { MouseAction = actionType; }
protected override void OnMouseLeave(EventArgs e) { this.mouseAction = MouseActionType.None; this.Invalidate(); base.OnMouseLeave(e); }
protected override void OnMouseEnter(EventArgs e) { this.mouseAction = MouseActionType.Hover; this.Invalidate(); base.OnMouseEnter(e); }