예제 #1
0
 protected override bool OnButtonPressEvent(Gdk.EventButton e)
 {
     this.GrabFocus();
     HideTooltipWindow();
     if (this.mouseOverItem is ToolboxWidgetCategory)
     {
         if (!e.TriggersContextMenu() && e.Button == 1 && e.Type == EventType.ButtonPress)
         {
             ToolboxWidgetCategory mouseOverCateogry = (ToolboxWidgetCategory)this.mouseOverItem;
             SetCategoryExpanded(mouseOverCateogry, !mouseOverCateogry.IsExpanded);
             return(true);
         }
         this.SelectedItem = mouseOverItem;
         this.QueueResize();
     }
     else
     {
         this.SelectedItem = mouseOverItem;
         this.QueueDraw();
     }
     if (e.TriggersContextMenu())
     {
         if (DoPopupMenu != null)
         {
             DoPopupMenu(e);
             return(true);
         }
     }
     else if (e.Type == EventType.TwoButtonPress && this.SelectedItem != null)
     {
         this.OnActivateSelectedItem(EventArgs.Empty);
         return(true);
     }
     return(base.OnButtonPressEvent(e));
 }
예제 #2
0
        protected override bool OnButtonPressEvent(Gdk.EventButton ev)
        {
            if (!ev.TriggersContextMenu() && ev.Button == 1)
            {
                foreach (ChartCursor cursor in cursors)
                {
                    int cx, cy;
                    GetPoint(cursor.Value, cursor.Value, out cx, out cy);
                    if (cursor.Dimension == AxisDimension.X)
                    {
                        if (Math.Abs(ev.X - cx) <= 2 || (ev.Y < top && (Math.Abs(ev.X - cx) <= cursor.HandleSize / 2)))
                        {
                            activeCursor   = cursor;
                            draggingCursor = true;
                            activeCursor.ShowValueLabel = true;
                            QueueDraw();
                            break;
                        }
                    }
                    else
                    {
                        // Implement
                    }
                }

                if (enableSelection && !draggingCursor)
                {
                    selectionStart.Visible = true;
                    selectionEnd.Visible   = true;

                    double x, y;
                    GetValue((int)ev.X, (int)ev.Y, out x, out y);
                    // avoid cursor swaping
                    ChartCursor c1 = selectionStart;
                    ChartCursor c2 = selectionEnd;
                    c1.Value     = x;
                    c2.Value     = x;
                    activeCursor = selectionEnd;
                    activeCursor.ShowValueLabel = true;
                    draggingCursor = true;
                    QueueDraw();
                }

                if (draggingCursor)
                {
                    return(true);
                }
            }
            return(base.OnButtonPressEvent(ev));
        }
        protected override bool OnButtonPressEvent(Gdk.EventButton e)
        {
            if (e.TriggersContextMenu())
            {
                int sx, sy;
                this.GdkWindow.GetOrigin(out sx, out sy);
                int rx = (int)e.XRoot - sx;
                int ry = (int)e.YRoot - sy;

                foreach (DockToolbarPanel p in panels)
                {
                    if (p.Allocation.Contains(rx, ry))
                    {
                        OnPanelClick(e, p.Placement);
                    }
                }
            }
            return(base.OnButtonPressEvent(e));
        }
예제 #4
0
			protected override bool OnButtonPressEvent (EventButton evnt)
			{
				if (evnt.TriggersContextMenu ()) {
					CommandEntrySet opset = new CommandEntrySet ();
					opset.AddItem (BlameCommands.ShowDiff);
					opset.AddItem (BlameCommands.ShowLog);
					opset.AddItem (Command.Separator);
					opset.AddItem (BlameCommands.CopyRevision);
					IdeApp.CommandService.ShowContextMenu (this, evnt, opset, this);
					return true;
				} else {
					if (evnt.X < leftSpacer) {
						grabTime = evnt.Time;
						var status = Gdk.Pointer.Grab (this.GdkWindow, false, EventMask.PointerMotionHintMask | EventMask.Button1MotionMask | EventMask.ButtonReleaseMask | EventMask.EnterNotifyMask | EventMask.LeaveNotifyMask, null, null, grabTime);
						if (status == GrabStatus.Success) {
							dragPosition = evnt.X;
						}
					}
				}
				return base.OnButtonPressEvent (evnt);
			}
		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			button |= evnt.Button;

			if (!evnt.TriggersContextMenu () && evnt.Button == 1 && evnt.Type == EventType.ButtonPress) {
				if (hoverOverIndicator) {
					parentStrip.GotoTask (parentStrip.SearchNextTask (currentHoverMode));
					return base.OnButtonPressEvent (evnt);
				} else  if (hoverTask != null) {
					TextEditor.Caret.Location = new DocumentLocation (hoverTask.Location.Line, Math.Max (DocumentLocation.MinColumn, hoverTask.Location.Column));
					TextEditor.CenterToCaret ();
					TextEditor.StartCaretPulseAnimation ();
					TextEditor.GrabFocus ();
				} 
			}

			if (evnt.Type == EventType.ButtonPress)
				MouseMove (evnt.Y);
			
			return base.OnButtonPressEvent (evnt);
		}
예제 #6
0
		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			button |= evnt.Button;
			
			if (!evnt.TriggersContextMenu () && evnt.Button == 1 && hoverTask != null) {
				TextEditor.Caret.Location = new DocumentLocation (hoverTask.Location.Line, Math.Max (DocumentLocation.MinColumn, hoverTask.Location.Column));
				TextEditor.CenterToCaret ();
				TextEditor.StartCaretPulseAnimation ();
				TextEditor.GrabFocus ();
			} 
			
			MouseMove (evnt.Y);
			
			return base.OnButtonPressEvent (evnt);
		}
예제 #7
0
			protected override bool OnButtonPressEvent (EventButton evnt)
			{
				if (!evnt.TriggersContextMenu () && evnt.Button == 1 && !selectedHunk.IsEmpty) {
					widget.UndoChange (fromEditor, toEditor, selectedHunk);
					return true;
				}
				return base.OnButtonPressEvent (evnt);
			}
예제 #8
0
			protected override bool OnButtonPressEvent (EventButton evnt)
			{
				if (evnt.TriggersContextMenu ()) {
					int startLine = widget.Editor.YToLine (widget.Editor.VAdjustment.Value + evnt.Y);
					menuAnnotation = startLine > 0 && startLine <= annotations.Count ? annotations[startLine - 1] : null;

					CommandEntrySet opset = new CommandEntrySet ();
					opset.AddItem (BlameCommands.ShowDiff);
					opset.AddItem (BlameCommands.ShowLog);
					opset.AddItem (BlameCommands.ShowBlameBefore);
					opset.AddItem (Command.Separator);
					opset.AddItem (BlameCommands.CopyRevision);
					IdeApp.CommandService.ShowContextMenu (this, evnt, opset, this);
					return true;
				} else {
					if (evnt.X < leftSpacer) {
						grabTime = evnt.Time;
						var status = Gdk.Pointer.Grab (this.GdkWindow, false, EventMask.PointerMotionHintMask | EventMask.Button1MotionMask | EventMask.ButtonReleaseMask | EventMask.EnterNotifyMask | EventMask.LeaveNotifyMask, null, null, grabTime);
						if (status == GrabStatus.Success) {
							dragPosition = evnt.X;
						}
					}
				}
				return base.OnButtonPressEvent (evnt);
			}
예제 #9
0
		protected override bool OnButtonPressEvent (EventButton e)
		{
			if (parentFrame != null && e.Button == 1 && !e.TriggersContextMenu ()) {
				if (Orientation == Orientation.Horizontal && e.X <= 10) {
					dragging = true;
					parentFrame.StartDragBar (this, (int)e.X, (int)e.Y, e.Time);
					return true;
				}
				else if (Orientation == Orientation.Vertical && e.Y <= 10) {
					dragging = true;
					parentFrame.StartDragBar (this, (int)e.X, (int)e.Y, e.Time);
					return true;
				}
			}
			return base.OnButtonPressEvent (e);
		}