当前位置: 首页>>代码示例>>C#>>正文


C# EventButton.TriggersContextMenu方法代码示例

本文整理汇总了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);
			}
开发者ID:JamesChan,项目名称:monodevelop,代码行数:21,代码来源:BlameWidget.cs

示例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);
		}
开发者ID:OnorioCatenacci,项目名称:monodevelop,代码行数:21,代码来源:QuickTaskOverviewMode.cs

示例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);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:15,代码来源:QuickTaskStrip.cs

示例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);
			}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:8,代码来源:EditorCompareWidgetBase.cs

示例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);
			}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:25,代码来源:BlameWidget.cs

示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:16,代码来源:DockToolbar.cs


注:本文中的Gdk.EventButton.TriggersContextMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。