private void HandleButtonPressed(object sender, ButtonEventArgs e) { if(!e.Handled) { handler.ButtonPressed(e.Button); e.Handled = true; } }
protected override void OnButtonPressed(ButtonEventArgs args) { base.OnButtonPressed(args); if (args.Button == PointerButton.Left) mDown = true; QueueDraw(); }
protected override void OnButtonReleased(ButtonEventArgs args) { if (args.X > 16) base.OnButtonReleased(args); if (args.Button == PointerButton.Left) { mDown = false; QueueDraw(); } }
protected override void OnButtonPressed(ButtonEventArgs args) { GradientButton B = Buttons.FirstOrDefault(X => CheckIfIn(args.Position, X)); try { B.ButtonPressed(); } catch (Exception e) { Xwt.MessageDialog.ShowError(String.Format("Не удается выполнить {0}: {1}", B.Text, e.Message)); } }
protected override void OnButtonReleased(ButtonEventArgs args) { base.OnButtonReleased(args); if (args.Button == PointerButton.Left) { if (Click != null) Click(this, EventArgs.Empty); mDown = false; QueueDraw(); } }
protected override void OnButtonPressed(ButtonEventArgs args) { base.OnButtonPressed(args); if (PluginType == FPlug.PluginType.Hud) { new Task(() => { System.Threading.Thread.Sleep(50); Application.Invoke(() => { var d = new HudsTFDisplay(); d.Show(); d.Present(); }); }).Start(); } }
/// <summary> /// OnButtonPressed method for AxisDrag interaction /// </summary> public override bool OnButtonPressed(ButtonEventArgs args, PlotCanvas pc) { // if the mouse is inside the plot area (the tick marks may be here, // and are counted as part of the axis), then *don't* invoke scaling if (pc.PlotAreaBoundingBoxCache.Contains(args.X, args.Y)) { return false; } if (args.Button == PointerButton.Left) { // see if hit with axis. NB Only one axis object will be returned ArrayList objects = pc.HitTest (new Point(args.X, args.Y)); foreach (object o in objects) { if (o is Axis) { dragging = true; Axis axis = (Axis)o; if (pc.PhysicalXAxis1Cache.Axis == axis) { physicalAxis = pc.PhysicalXAxis1Cache; translateX = true; } else if (pc.PhysicalXAxis2Cache.Axis == axis) { physicalAxis = pc.PhysicalXAxis2Cache; translateX = true; } else if (pc.PhysicalYAxis1Cache.Axis == axis) { physicalAxis = pc.PhysicalYAxis1Cache; translateY = true; } else if (pc.PhysicalYAxis2Cache.Axis == axis) { physicalAxis = pc.PhysicalYAxis2Cache; translateY = true; } lastPoint = new Point (args.X, args.Y); return false; } } } return false; }
void HandleButtonPressed (object sender, ButtonEventArgs e) { if (e.Button != PointerButton.Right) return; var rows = view.SelectedRows; if (rows.Length > 1) { // this is a multiple selection // waiting in this case means the selection disappears ShowBatchFixContextMenu (e.X, e.Y, rows); // Don't let the selection be reset e.Handled = true; handledByPress = true; } else { handledByPress = false; } }
// Event handling of right click on the TreeView is split in two parts // This is because no single handler can support intuitive behavior regarding // what happens to the selection when the right mouse button is pressed: // if only a single row is selected: change the selection and then show menu // if multiple rows are selected: show the menu directly void HandleButtonReleased (object sender, ButtonEventArgs e) { if (e.Button != PointerButton.Right || handledByPress) return; var rows = view.SelectedRows; if (rows.Length <= 1) { // Single row or no row ShowBatchFixContextMenu (e.X, e.Y, view.SelectedRows); } }
void HandleButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args) { var a = new ButtonEventArgs (); a.X = args.Event.X; a.Y = args.Event.Y; a.Button = (PointerButton) args.Event.Button; ApplicationContext.InvokeUserCode (delegate { EventSink.OnButtonReleased (a); }); if (a.Handled) args.RetVal = true; }
void HandleButtonPressEvent(object o, Gtk.ButtonPressEventArgs args) { var a = new ButtonEventArgs (); a.X = args.Event.X; a.Y = args.Event.Y; a.Button = (PointerButton) args.Event.Button; if (args.Event.Type == Gdk.EventType.TwoButtonPress) a.MultiplePress = 2; else if (args.Event.Type == Gdk.EventType.ThreeButtonPress) a.MultiplePress = 3; else a.MultiplePress = 1; ApplicationContext.InvokeUserCode (delegate { EventSink.OnButtonPressed (a); }); if (a.Handled) args.RetVal = true; }
void HandleButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args) { var sc = ConvertToScreenCoordinates (new Point (0, 0)); var a = new ButtonEventArgs (); a.X = args.Event.XRoot - sc.X; a.Y = args.Event.YRoot - sc.Y; a.Button = (PointerButton) args.Event.Button; ApplicationContext.InvokeUserCode (delegate { EventSink.OnButtonReleased (a); }); if (a.Handled) args.RetVal = true; }
void HandleButtonPressed (object sender, ButtonEventArgs e) { if (e.Button == PointerButton.Right) menu.Popup (); }
void HandleButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args) { var a = new ButtonEventArgs (); a.X = args.Event.X; a.Y = args.Event.Y; a.Button = (PointerButton) args.Event.Button; Toolkit.Invoke (delegate { EventSink.OnButtonReleased (a); }); }
public void OnButtonReleased(ButtonEventArgs args) { Parent.OnButtonReleased (args); }
public void OnButtonPressed(ButtonEventArgs args) { Parent.OnButtonPressed (args); }
void HandleButtonPressEvent(object o, Gtk.ButtonPressEventArgs args) { var sc = ConvertToScreenCoordinates (new Point (0, 0)); var a = new ButtonEventArgs (); a.X = args.Event.XRoot - sc.X; a.Y = args.Event.YRoot - sc.Y; a.Button = (PointerButton) args.Event.Button; if (args.Event.Type == Gdk.EventType.TwoButtonPress) a.MultiplePress = 2; else if (args.Event.Type == Gdk.EventType.ThreeButtonPress) a.MultiplePress = 3; else a.MultiplePress = 1; Toolkit.Invoke (delegate { EventSink.OnButtonPressed (a); }); if (a.Handled) args.RetVal = true; }
protected virtual ButtonEventArgs GetButtonReleaseEventArgs(Gtk.ButtonReleaseEventArgs args) { var a = new ButtonEventArgs (); var pointer_coords = EventsRootWidget.CheckPointerCoordinates (args.Event.Window, args.Event.X, args.Event.Y); a.X = pointer_coords.X; a.Y = pointer_coords.Y; a.Button = (PointerButton) args.Event.Button; return a; }
protected virtual ButtonEventArgs GetButtonPressEventArgs(Gtk.ButtonPressEventArgs args) { var a = new ButtonEventArgs (); var pointer_coords = EventsRootWidget.CheckPointerCoordinates (args.Event.Window, args.Event.X, args.Event.Y); a.X = pointer_coords.X; a.Y = pointer_coords.Y; a.Button = (PointerButton) args.Event.Button; if (args.Event.Type == Gdk.EventType.TwoButtonPress) a.MultiplePress = 2; else if (args.Event.Type == Gdk.EventType.ThreeButtonPress) a.MultiplePress = 3; else a.MultiplePress = 1; return a; }
protected override void OnButtonReleased(ButtonEventArgs args) { bool modified = false; foreach (Interaction interaction in plotCanvas.interactions) { modified |= interaction.OnButtonReleased (args, plotCanvas); } CheckForRedraw (modified); }
void HandleButtonPressEvent(object o, Gtk.ButtonPressEventArgs args) { var a = new ButtonEventArgs (); a.X = args.Event.X; a.Y = args.Event.Y; a.Button = (PointerButton) args.Event.Button; if (args.Event.Type == Gdk.EventType.TwoButtonPress) a.MultiplePress = 2; else if (args.Event.Type == Gdk.EventType.ThreeButtonPress) a.MultiplePress = 3; else a.MultiplePress = 1; Toolkit.Invoke (delegate { EventSink.OnButtonPressed (a); }); }
protected override void OnButtonPressed (ButtonEventArgs args) { PackageViewModel packageViewModel = GetValue (PackageField); if (packageViewModel == null) { base.OnButtonPressed (args); return; } double x = args.X - Bounds.X; double y = args.Y - Bounds.Y; if (checkBoxImageClickableRectangle.Contains (x, y)) { packageViewModel.IsChecked = !packageViewModel.IsChecked; OnPackageChecked (packageViewModel); } }
protected override void OnButtonReleased(ButtonEventArgs args) { Console.WriteLine ("Release: " + args.Position); base.OnButtonReleased (args); }
protected override void OnButtonPressed (ButtonEventArgs args) { base.OnButtonPressed (args); buttonPressed = true; OnSelectionChanged ((int)args.Y - padding); QueueDraw (); }
protected virtual void OnButtonReleased(ButtonEventArgs args) { if (buttonReleased != null) buttonReleased (this, args); }
public MarginMouseEventArgs (HexEditor editor, Margin margin, ButtonEventArgs args) { this.Editor = editor; this.margin = margin; this.Args = args; }
protected override void OnButtonPressed (ButtonEventArgs args) { base.OnButtonPressed (args); buttonDown = true; selection = new Point (args.X - padding, args.Y - padding); OnSelectionChanged (); QueueDraw (); }
public override bool OnButtonReleased(ButtonEventArgs args, PlotCanvas pc) { if (dragging) { lastPoint = unset; dragging = false; //pc.plotCursor = CursorType.LeftPointer; } return false; }
protected override void OnButtonReleased (ButtonEventArgs args) { base.OnButtonReleased (args); buttonPressed = false; QueueDraw (); }
public override bool OnButtonPressed(ButtonEventArgs args, PlotCanvas pc) { // Only start drag if mouse is inside plot area (excluding axes) Rectangle area = pc.PlotAreaBoundingBoxCache; if (area.Contains (args.Position)) { dragging = true; lastPoint = new Point (args.X, args.Y); if (args.Button == PointerButton.Left) { if (Horizontal || Vertical) { //pc.plotCursor = CursorType.Hand; } } } return false; }