public override void MouseButtonUp(MouseButtonEventArgs args) { if (PointInside (args.X, args.Y)) { Console.WriteLine ("Activating!"); OnActivate (); } }
private void OnListBoxDoubleClick(object sender, MouseButtonEventArgs args) { var listBoxItem = args.Source as RadListBoxItem; if (listBoxItem != null && CanDoubleClick(listBoxItem)) { ListBoxDoubleClick(listBoxItem); } }
private void OnListBoxDoubleClick(object sender, MouseButtonEventArgs args) { var listBoxItem = args.Source as System.Windows.Controls.ListBoxItem; if (listBoxItem != null && CanDoubleClick(listBoxItem)) { ListBoxDoubleClick(listBoxItem); } }
// ====================================================== private void CommandsButton_MouseDown(object sender, MouseButtonEventArgs e) { if (((Button) sender).Text == "Show Commands") { ((Button) sender).Text = "Hide Commands"; commandsLabel.Visible = true; } else { ((Button) sender).Text = "Show Commands"; commandsLabel.Visible = false; } }
public Mouse( IWindow window ) { w = window.Handle as OpenTK.GameWindow; w.Mouse.ButtonDown += Mouse_ButtonDown; w.Mouse.ButtonUp += Mouse_ButtonUp; w.Mouse.Move += Mouse_Move; w.Mouse.WheelChanged += Mouse_WheelChanged; buttonEvent = new MouseButtonEventArgs ( GetState () ); wheelEvent = new MouseWheelEventArgs ( 0 ); }
/// <summary> /// Since character selection at the moment is the final stage in the menus, this loads the new level based on the previous /// level selection and current character selection /// </summary> void OnCharacterSelect(Button button, MouseButtonEventArgs eventArgs, string characterSelection) { if (LKernel.Get<MainMenuUIHandler>().GameType == GameTypeEnum.SinglePlayer) { this.characterSelection = characterSelection; LevelChangeRequest request = new LevelChangeRequest() { NewLevelName = levelSelection, CharacterNames = new string[] { characterSelection }, IsMultiplayer = false, }; LKernel.GetG<LevelManager>().LoadLevel(request); } }
public Mouse( IWindow window ) { this.window = window; Form w = window.Handle as Form; w.MouseDown += ButtonDownEvent; w.MouseUp += ButtonUpEvent; w.MouseMove += MoveEvent; w.MouseWheel += WheelEvent; w.MouseHover += HoverEvent; w.MouseLeave += LeaveEvent; buttonEvent = new MouseButtonEventArgs ( new MouseState () ); wheelEvent = new MouseWheelEventArgs ( 0 ); }
string MouseEventToKeyName(MouseButtonEventArgs e) { if (e.Button == MouseButton.PrimaryButton) { return "leftmousebutton"; } if (e.Button == MouseButton.MiddleButton) { return "middlemousebutton"; } if (e.Button == MouseButton.SecondaryButton) { return "rightmousebutton"; } return ""; }
// this is kinda useless tbh but oh well private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e) { ViewModel.OurClipboard.ShowClipboardWindow(); }
private void DataGridRowHeader_MouseDoubleClick(object sender, MouseButtonEventArgs e) { }
private void Volume_MouseUp(object sender, MouseButtonEventArgs e) { }
private void Clock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { }
private void MouseUpPreview(object sender, MouseButtonEventArgs e) { _clickCounter.CountClick(sender, e); }
public override void MouseButtonUp(MouseButtonEventArgs args) { if (PointInside (args.X, args.Y)) OnActivate (); }
/// <summary> /// Check if the control's MouseLeftButtonDown event should be handled. /// </summary> /// <param name="e">Event arguments.</param> /// <returns> /// A value indicating whether the event should be handled. /// </returns> public bool AllowMouseLeftButtonDown(MouseButtonEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } bool enabled = Control.IsEnabled; if (enabled) { // Get the current position and time DateTime now = DateTime.UtcNow; Point position = e.GetPosition(Control); // Compute the deltas from the last click double timeDelta = (now - LastClickTime).TotalMilliseconds; Point lastPosition = LastClickPosition; double dx = position.X - lastPosition.X; double dy = position.Y - lastPosition.Y; double distance = dx * dx + dy * dy; // Check if the values fall under the sequential click temporal // and spatial thresholds if (timeDelta < SequentialClickThresholdInMilliseconds && distance < SequentialClickThresholdInPixelsSquared) { ClickCount++; } else { ClickCount = 1; } // Set the new position and time LastClickTime = now; LastClickPosition = position; // Raise the event IsPressed = true; } else { ClickCount = 1; } return enabled; }
public void HeaderMouseUp(object sender, MouseButtonEventArgs e) { base.OnMouseUp(e); }
public void InputMouseDown(object sender, MouseButtonEventArgs e) { this.Cursor = Cursors.Arrow; }
private void letter_MouseDown(object sender, MouseButtonEventArgs e) { Level3 l = new Level3(Convert.ToInt16(((Image)sender).Name.Substring(6))); l.Show(); this.Close(); }
private void GoToMouseError(object sender, MouseButtonEventArgs mouseButtonEventArgs) { _errorListView.SelectError(_colorizeErrorForPopUp.Error, true, false); AvalonEditor.PreviewMouseLeftButtonDown -= GoToMouseError; //mouseButtonEventArgs.Handled = true; }
private void PublicIP_MouseUp(object sender, MouseButtonEventArgs e) => Clipboard.SetText(PublicIP.Content.ToString(), TextDataFormat.UnicodeText);
private void chCrosshair_CrosshairDragged(object sender, MouseButtonEventArgs e) { _processInfoMap = null; }
private void DragEvent(object sender, MouseButtonEventArgs e) { this.DragMove(); }
void btnMyHouse_Click(object sender, MouseButtonEventArgs e) { Messenger.SendHouseVisitRequest(Players.PlayerManager.MyPlayer.Name); MenuSwitcher.CloseAllMenus(); Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav"); }
public void OutputMouseUp(object sender, MouseButtonEventArgs e) { }
void Events_MouseButtonUp(object sender, MouseButtonEventArgs e) { if (MouseUp != null) { MouseUp(sender, e); } }
public void BodyMouseDown(object sender, MouseButtonEventArgs e) { //Manager.canMove = true; canMove = true; test = e.GetPosition(this); }
public void onScrollBack(object sender, MouseButtonEventArgs e) { Value -= SmallIncrement; }
void MainPage_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { // If the Canvas containing the TextBox is visible, ignore // this event. /* if (TextBoxCanvas.Visibility == Visibility.Visible) { return; } // Save the location where the user touched the screen. pointOnScreen = e.GetPosition(LayoutRoot); // Save the device attitude when the user touched the screen. attitude = motion.CurrentValue.Attitude.RotationMatrix; // Make the Canvas containing the TextBox visible and // give the TextBox focus. TextBoxCanvas.Visibility = Visibility.Visible; txtName.Focus(); */ }
void btnAccept_Click(object sender, MouseButtonEventArgs e) { Messenger.SendAddSignRequest(txtHouse1.Text, txtHouse2.Text, txtHouse3.Text); MenuSwitcher.CloseAllMenus(); Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav"); }
/// <summary> /// helper /// </summary> void Invoke(MainMenuButtonPressEvent e, object sender, MouseButtonEventArgs args) { if (e != null && (sender as Button) != null) e.Invoke(sender as Button, args); }
private void HeaderMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { e.Handled = true; _dragWidget.ReleaseMouseCapture(); _isMouseCaptured = false; }
/// <summary> /// helper /// </summary> void Invoke(MainMenuCharacterSelectEvent e, object sender, MouseButtonEventArgs args, string characterSelection) { if (e != null && (sender as Button) != null) e.Invoke(sender as Button, args, characterSelection); }
void child_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) { this.Reset(); }
public virtual void MouseButtonUp(MouseButtonEventArgs args) { }
private void dg_f_MouseDoubleClick(object sender, MouseButtonEventArgs e) { f_number = ((BE.Fault)dg_f.SelectedItem).fault_number; }
public override void MouseButtonDown(MouseButtonEventArgs args) { ShowDropdown(); }
public void BodyMouseUp(object sender, MouseButtonEventArgs e) { }
private void paintCanvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { capture = false; if (curShape != null) { if (doc.drawType == DrawType.ellipse || doc.drawType == DrawType.rectangle || doc.drawType == DrawType.triangle || doc.drawType == DrawType.arrow || doc.drawType == DrawType.heart) { Shape temp; if (doc.drawType == DrawType.ellipse) { temp = new Ellipse(); } else if (doc.drawType == DrawType.rectangle) { temp = new Rectangle(); } else if (doc.drawType == DrawType.triangle) { temp = new Triangle(); } else if (doc.drawType == DrawType.arrow) { temp = new Arrow(); } else { temp = new Heart(); } temp.Stroke = new SolidColorBrush(penColor); temp.StrokeThickness = penThickness; curControl = new ContentControl(); temp.IsHitTestVisible = true; if (doc.drawType == DrawType.triangle) { ((Triangle)temp).Start = ((Triangle)curShape).Start; temp.Width = curShape.Width; temp.Height = curShape.Height; } if (doc.drawType == DrawType.arrow) { ((Arrow)temp).Start = ((Arrow)curShape).Start; temp.Width = curShape.Width; temp.Height = curShape.Height; } if (doc.drawType == DrawType.heart) { ((Heart)temp).Start = ((Heart)curShape).Start; temp.Width = curShape.Width; temp.Height = curShape.Height; } Canvas.SetLeft(curControl, curShape.Margin.Left); Canvas.SetTop(curControl, curShape.Margin.Top); curControl.Width = curShape.Width; curControl.Height = curShape.Height; curControl.Content = temp; curControl.Style = FindResource("DesignerItemStyle") as Style; curControl.Background = new SolidColorBrush(Colors.White); doc.DrawShape(curControl, GetOutline()); } curShape = null; } else if (doc.drawType == DrawType.line && curLine != null) { Line line = new Line(); line.Stroke = new SolidColorBrush(penColor); line.StrokeThickness = penThickness; line.X1 = curLine.X1; line.X2 = curLine.X2; line.Y1 = curLine.Y1; line.Y2 = curLine.Y2; doc.DrawShape(line, GetOutline()); curLine = null; } }
void btnAccept_Click(object sender, MouseButtonEventArgs e) { Messenger.SendExpansionRequest(nudAmountX.Value-1, nudAmountY.Value-1); MenuSwitcher.CloseAllMenus(); Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav"); }
protected virtual void OnHeaderMouseUp(object sender, MouseButtonEventArgs e) { isMouseDown = false; ReleaseMouseCapture(); }
/// <summary> /// helper /// </summary> void Invoke(MainMenuLevelSelectEvent e, object sender, MouseButtonEventArgs args, string levelSelection) { if (e != null && (sender as Button) != null) e.Invoke(sender as Button, args, levelSelection); }
private void OutsideCapturedElementHandler(object sender, MouseButtonEventArgs e) { this.IsDropDownOpen = false; }
void pixServer1_Click(object sender, MouseButtonEventArgs e) { IO.Options.ConnectionIP = "game.pmuniverse.net"; IO.Options.ConnectionPort = 4001; IO.Options.SaveXml(); pnlSelectServer.Visible = false; btnSelectServer.Selected = false; ((winUpdates)WindowManager.FindWindow("winUpdates")).ClearNews(); NetworkManager.Disconnect(); NetworkManager.Connect(); }
private void ZoomViewer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { ZoomViewer.Cursor = Cursors.Arrow; ZoomViewer.ReleaseMouseCapture(); _lastDragPoint = null; }
public virtual void MouseWheel(MouseButtonEventArgs args) { }
private void Mok1_MouseDoubleClick(object sender, MouseButtonEventArgs e) { listdh(); }
public override void MouseButtonUp(MouseButtonEventArgs args) { HideDropdown (); }
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { DragMove(); }
void Events_MouseButtonDown(object sender, MouseButtonEventArgs e) { if (MouseDown != null) { MouseDown(sender, e); } }
private void ChangeProfilePicture_MouseDown(object sender, MouseButtonEventArgs e) { profileWindowVM.UpdateProfilePicture(); }
public override void MouseButtonDown(MouseButtonEventArgs args) { }
private void Window_Move(object sender, MouseButtonEventArgs e) { this.DragMove(); }
void lblAllMoves_MouseDown(object sender, MouseButtonEventArgs e) { if (Windows.WindowSwitcher.GameWindow.MenuManager.FindMenu("mnuMoveSelected") == null) { Label label = (Label)sender; SdlDotNet.Graphics.Surface dragSurf = new SdlDotNet.Graphics.Surface(label.Buffer.Size); dragSurf.Fill(Color.Black); dragSurf.Blit(label.Buffer, new Point(0, 0)); label.DoDragDrop(Array.IndexOf(lblAllMoves, sender), DragDropEffects.Copy, dragSurf); } }
private void search_MouseDown(object sender, MouseButtonEventArgs e) { SearchItem(); }
public void onScrollForth(object sender, MouseButtonEventArgs e) { Value += SmallIncrement; }
private void item6C_Click(object sender, MouseButtonEventArgs e) { AddToCart(itemList[setToLoad * 9 + 5]); }
/// <summary> /// Check if the control's MouseLeftButtonUp event should be handled. /// </summary> /// <param name="e">Event arguments.</param> /// <returns> /// A value indicating whether the event should be handled. /// </returns> public bool AllowMouseLeftButtonUp(MouseButtonEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } bool enabled = Control.IsEnabled; if (enabled) { IsPressed = false; } return enabled; }
private void item7H_Click(object sender, MouseButtonEventArgs e) { AddToFavorites(itemList[setToLoad * 9 + 6]); }
void btnCancel_Click(object sender, MouseButtonEventArgs e) { MenuSwitcher.CloseAllMenus(); Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav"); }
private void TreePreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { _startPoint = e.GetPosition(sender as IInputElement); }