本文整理汇总了C#中Gdk.EventButton.TriggersContextMenu方法的典型用法代码示例。如果您正苦于以下问题:C# EventButton.TriggersContextMenu方法的具体用法?C# EventButton.TriggersContextMenu怎么用?C# EventButton.TriggersContextMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.EventButton
的用法示例。
在下文中一共展示了EventButton.TriggersContextMenu方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnButtonPressEvent
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);
}
示例2: OnButtonPressEvent
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);
}
示例3: OnButtonPressEvent
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);
}
示例4: OnButtonPressEvent
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);
}
示例5: OnButtonPressEvent
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);
}
示例6: OnButtonPressEvent
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);
}