Example #1
0
 private void HandleButtonPressed(object sender, ButtonEventArgs e)
 {
     if(!e.Handled)
     {
         handler.ButtonPressed(e.Button);
         e.Handled = true;
     }
 }
Example #2
0
        protected override void OnButtonPressed(ButtonEventArgs args)
        {
            base.OnButtonPressed(args);

            if (args.Button == PointerButton.Left)
                mDown = true;

            QueueDraw();
        }
Example #3
0
        protected override void OnButtonReleased(ButtonEventArgs args)
        {
            if (args.X > 16)
                base.OnButtonReleased(args);

            if (args.Button == PointerButton.Left)
            {
                mDown = false;
                QueueDraw();
            }
        }
Example #4
0
 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));
     }
 }
Example #5
0
        protected override void OnButtonReleased(ButtonEventArgs args)
        {
            base.OnButtonReleased(args);

            if (args.Button == PointerButton.Left)
            {
                if (Click != null)
                    Click(this, EventArgs.Empty);

                mDown = false;
                QueueDraw();
            }
        }
Example #6
0
        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();
            }
        }
Example #7
0
        /// <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);
			}
		}
Example #10
0
 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;
 }
Example #11
0
        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;
        }
Example #12
0
 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;
 }
Example #13
0
		void HandleButtonPressed (object sender, ButtonEventArgs e)
		{
			if (e.Button == PointerButton.Right)
				menu.Popup ();
		}
Example #14
0
 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);
     });
 }
Example #15
0
 public void OnButtonReleased(ButtonEventArgs args)
 {
     Parent.OnButtonReleased (args);
 }
Example #16
0
 public void OnButtonPressed(ButtonEventArgs args)
 {
     Parent.OnButtonPressed (args);
 }
Example #17
0
 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;
 }
Example #18
0
        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;
        }
Example #19
0
        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;
        }
Example #20
0
 protected override void OnButtonReleased(ButtonEventArgs args)
 {
     bool modified = false;
     foreach (Interaction interaction in plotCanvas.interactions) {
         modified |= interaction.OnButtonReleased (args, plotCanvas);
     }
     CheckForRedraw (modified);
 }
Example #21
0
 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);
			}
		}
Example #23
0
 protected override void OnButtonReleased(ButtonEventArgs args)
 {
     Console.WriteLine ("Release: " + args.Position);
     base.OnButtonReleased (args);
 }
Example #24
0
		protected override void OnButtonPressed (ButtonEventArgs args)
		{
			base.OnButtonPressed (args);
			buttonPressed = true;
			OnSelectionChanged ((int)args.Y - padding);
			QueueDraw ();
		}
Example #25
0
 protected virtual void OnButtonReleased(ButtonEventArgs args)
 {
     if (buttonReleased != null)
         buttonReleased (this, args);
 }
Example #26
0
		public MarginMouseEventArgs (HexEditor editor, Margin margin, ButtonEventArgs args)
		{
			this.Editor = editor;
			this.margin = margin;
			this.Args = args;
		}
Example #27
0
		protected override void OnButtonPressed (ButtonEventArgs args)
		{
			base.OnButtonPressed (args);
			buttonDown = true;
			selection = new Point (args.X - padding, args.Y - padding);
			OnSelectionChanged ();
			QueueDraw ();
		}
Example #28
0
 public override bool OnButtonReleased(ButtonEventArgs args, PlotCanvas pc)
 {
     if (dragging) {
         lastPoint = unset;
         dragging = false;
         //pc.plotCursor = CursorType.LeftPointer;
     }
     return false;
 }
Example #29
0
		protected override void OnButtonReleased (ButtonEventArgs args)
		{
			base.OnButtonReleased (args);
			buttonPressed = false;
			QueueDraw ();
		}
Example #30
0
 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;
 }