protected virtual void OnMouseButtonUp(GUIMouseEventArgs e) { if (MouseButtonUp != null) { MouseButtonUp(this, e); } }
protected virtual void OnMouseDoubleClicked(GUIMouseEventArgs e) { if (MouseDoubleClicked != null) { MouseDoubleClicked(this, e); } }
protected internal override bool OnMouseMove(GUIMouseEventArgs e) { base.OnMouseMove(e); if (dragSizing) { DoDragSizing(e.Position); } else if (IsHit(e.Position)) { if (Sizable && (e.Position.x > (this.Rect.right - splitterSize))) { InitialiseSizingHoverState(); } else { splitterHover = false; } } else { splitterHover = false; } return(true); }
protected virtual void OnMouseWheel(GUIMouseEventArgs e) { if (MouseWheel != null) { MouseWheel(this, e); } }
protected virtual void OnMouseMove(GUIMouseEventArgs e) { if (MouseMove != null) { MouseMove(this, e); } }
protected internal override void OnMouseLeaves(GUIMouseEventArgs e) { base.OnMouseLeaves(e); hovering = false; RequestRedraw(); }
private void window_MouseMove(object sender, GUIMouseEventArgs e) { mouseValueDX = (int)(e.Position.x - mouseValueX); mouseValueDY = (int)(e.Position.y - mouseValueY); mouseValueX = (int)e.Position.x; mouseValueY = (int)e.Position.y; OnMouseMove(e); }
protected internal override bool OnMouseMove(GUIMouseEventArgs e) { if (!pushed) { UpdateInternalState(e.Position); } return(base.OnMouseMove(e)); }
protected override void OnMouseMove(GUIMouseEventArgs e) { base.OnMouseMove(e); if (dragMouse) { this.dragStartLocation = e.Position; } }
protected override void OnMouseButtonDown(GUIMouseEventArgs e) { base.OnMouseButtonDown(e); this.HostWindow.CaptureInput(); this.ClickLocationX = (int)e.Position.x; this.ClickLocationY = (int)e.Position.y; this.dragMouse = true; this.dragStartLocation = e.Position; }
public override bool OnMouseButtonDown(GUIMouseEventArgs e) { foreach (UIComp_TreeNodeBase node in treeNodes) { if (node.OnMouseButtonDown(e)) { return(true); } } return(false); }
void PlayerInput_MouseButtonDown(object sender, GUIMouseEventArgs e) { if (e.Button == MouseButtons.Left) { } else if (e.Button == MouseButtons.Right) { // todo: 测试释放技能 ClientUseSkill(1909162191); } }
protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonUp(e); if (e.Button == GUISystem.ClickButton) { ReleaseInput(); return(true); } return(ret); }
protected internal override bool OnMouseMove(GUIMouseEventArgs e) { bool ret = base.OnMouseMove(e); if (dragging) { CaratPosition = GetTextIndexFromPosition(e.Position); SetSelection(caratPosition, dragAnchorIndex); return(true); } return(ret); }
protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonDown(e); if (e.Button == GUISystem.ClickButton) { isBeingDragged = true; dragPosition = e.Position; return(true); } return(ret); }
protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonUp(e); if (e.Button == GUISystem.ClickButton) { // release our capture on the input data ReleaseInput(); isBeingSized = false; return(true); } return(ret); }
protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonDown(e); if (e.Button == GUISystem.ClickButton) { dragging = true; CaptureInput(); dragStartPosition = e.Position; return(true); } return(ret); }
protected internal override void OnMouseWheel(GUIMouseEventArgs e) { // base class processing base.OnMouseWheel(e); if (verticalScrollBar.Visible && (verticalScrollBar.DocumentSize > verticalScrollBar.PageSize)) { verticalScrollBar.ScrollPosition = verticalScrollBar.ScrollPosition + verticalScrollBar.StepSize * (e.Delta > 0 ? -1 : 1); } else if (horizontalScrollBar.Visible && (horizontalScrollBar.DocumentSize > horizontalScrollBar.PageSize)) { horizontalScrollBar.ScrollPosition = horizontalScrollBar.ScrollPosition + horizontalScrollBar.StepSize * (e.Delta > 0 ? -1 : 1); } }
protected internal override bool OnMouseMove(GUIMouseEventArgs e) { bool ret = base.OnMouseMove(e); if (isBeingDragged) { Vector2 delta = e.Position - dragPosition; dragPosition = e.Position; if (horzFree) { UIDim newX = this.X; newX.offest += delta.x; // limit value to within currently set range newX.offest = (newX.offest < horzMin) ? horzMin : (newX.offest > horzMax) ? horzMax : newX.offest; if (newX != this.X) { this.X = newX; // send notification as required if (hotTrack) { OnPositionChanged(new WindowEventArgs(this)); } } } if (vertFree) { UIDim newY = this.Y; newY.offest += delta.y; // limit new position to within currently set range newY.offest = (newY.offest < vertMin) ? vertMin : (newY.offest > vertMax) ? vertMax : newY.offest; if (newY != this.Y) { this.Y = newY; // send notification as required if (hotTrack) { OnPositionChanged(new WindowEventArgs(this)); } } } return(true); } return(ret); }
protected internal override bool OnMouseDoubleClicked(GUIMouseEventArgs e) { bool ret = base.OnMouseDoubleClicked(e); if (e.Button == GUISystem.ClickButton) { // 选择所有文本 dragAnchorIndex = 0; CaratPosition = text.Length; SetSelection(dragAnchorIndex, caratPosition); return(true); } return(ret); }
protected internal override bool OnMouseMove(GUIMouseEventArgs e) { bool ret = base.OnMouseMove(e); Window parentWindow = this.Parent; if (dragging && moveable && parentWindow != null && parentWindow != GUISystem.Instance.RootWindow) { parentWindow.AbsolutePosition += e.Position - dragStartPosition; dragStartPosition = e.Position; return(true); } return(ret); }
protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonDown(e); if (e.Button == GUISystem.ClickButton) { CaptureInput(); pushed = true; UpdateInternalState(e.Position); RequestRedraw(); return(true); } return(ret); }
protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e) { base.OnMouseButtonDown(e); if (e.Button == GUISystem.ClickButton) { dragPoint = e.Position; if (splitterHover) { if (Sizable) { dragSizing = true; } } } return(true); }
protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonDown(e); if (e.Button == GUISystem.ClickButton) { float adj = GetAdjustDirectionFromPoint(e.Position); // adjust scroll bar position in whichever direction as required. if (adj != 0) { ScrollPosition = (position + ((pageSize - overlapSize) * adj)); } return(true); } return(ret); }
protected internal override bool OnMouseMove(GUIMouseEventArgs e) { bool ret = base.OnMouseMove(e); if (SizingEnabled && isBeingSized && sizingLocation != SizingLocation.None) { Vector2 deltaVector = e.Position - dragStartPosition; dragStartPosition = e.Position; // 左边 UIDim xOffest = new UIDim(0, deltaVector.x); UIDim yOffest = new UIDim(0, deltaVector.y); if (sizingLocation == SizingLocation.Left || sizingLocation == SizingLocation.TopLeft || sizingLocation == SizingLocation.BottomLeft) { this.X += xOffest; this.Width -= xOffest; } // 右边 if (sizingLocation == SizingLocation.Right || sizingLocation == SizingLocation.TopRight || sizingLocation == SizingLocation.BottomRight) { this.Width += xOffest; } // 上方 if (sizingLocation == SizingLocation.Top || sizingLocation == SizingLocation.TopLeft || sizingLocation == SizingLocation.TopRight) { this.Y += yOffest; this.Height -= yOffest; } // 下方 if (sizingLocation == SizingLocation.Bottom || sizingLocation == SizingLocation.BottomLeft || sizingLocation == SizingLocation.BottomRight) { this.Height += yOffest; } return(true); } return(ret); }
protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonDown(e); if (e.Button == GUISystem.ClickButton) { // grab input CaptureInput(); // 处理鼠标点击响应 ClearSelection(); dragging = true; dragAnchorIndex = GetTextIndexFromPosition(e.Position); CaratPosition = dragAnchorIndex; return(true); } return(ret); }
protected internal override bool OnMouseDoubleClicked(GUIMouseEventArgs e) { base.OnMouseDoubleClicked(e); ClearAllSelections(); // get mouse position as a local pixel value UIComp_TreeNodeBase node = GetNodeAtPoint(e.Position); if (node != null) { BeginUpdate(); node.Selected = true; node.Expand = !node.Expand; EndUpdate(); } return(true); }
private void window_MouseButtonUp(object sender, GUIMouseEventArgs e) { // 显示鼠标并设置鼠标位置到按下时的位置 NativeMethods.CaptureMouse(Program.game.GameWindow.ViewportControl.Handle, false); switch (e.Button) { case MouseButtons.Left: keyState[(int)System.Windows.Forms.Keys.LButton] = false; break; case MouseButtons.Right: keyState[(int)System.Windows.Forms.Keys.RButton] = false; break; case MouseButtons.Middle: keyState[(int)System.Windows.Forms.Keys.MButton] = false; break; } OnMouseButtonUp(e); }
protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e) { bool ret = base.OnMouseButtonUp(e); if (e.Button == GUISystem.ClickButton) { ReleaseInput(); Window sheet = GUISystem.Instance.RootWindow; if (sheet != null) { if (this == sheet.GetChildAtPosition(e.Position)) { OnCliked(new GUIEventArgs()); return(true); } } } return(ret); }
/// <summary> /// When the mouse up occurs, we change the selected state. /// </summary> /// <param name="e"></param> protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e) { if (e.Button == GUISystem.ClickButton) { Window sheet = GUISystem.Instance.RootWindow; if (sheet != null) { // if mouse was released over this widget if (this == sheet.GetChildAtPosition(e.Position)) { // toggle selected state Checked = !isChecked; return(true); } } } // default processing return(base.OnMouseButtonUp(e)); }