本文整理汇总了C#中MouseEvent.IsRightButtonPressed方法的典型用法代码示例。如果您正苦于以下问题:C# MouseEvent.IsRightButtonPressed方法的具体用法?C# MouseEvent.IsRightButtonPressed怎么用?C# MouseEvent.IsRightButtonPressed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MouseEvent
的用法示例。
在下文中一共展示了MouseEvent.IsRightButtonPressed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MouseDown
public override void MouseDown(MouseEvent ev)
{
base.MouseDown(ev);
IDrawingView view = ev.View;
IFigure figure = view.Drawing.FindFigure(ev.X, ev.Y);
if(ev.IsRightButtonPressed())
{
ITool defaultTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
if (figure != null)
{
DelegateTool = figure.CreateFigureTool(this, Editor, defaultTool, ev);
}
else
{
//if it didn't hit figure then allow panning
DelegateTool = defaultTool;
}
}
else
{
IHandle handle = view.FindHandle(ev.X, ev.Y);
if (handle != null)
{
DelegateTool = new HandleTracker(Editor, new UndoableHandle(handle));
}
else
{
if(figure != null)
{
ITool dragTool = new DragTool(Editor, figure);
DelegateTool = figure.CreateFigureTool(this, Editor, dragTool, ev);
}
else
{
DelegateTool = new SelectAreaTool(Editor);
}
}
}
if (DelegateTool != null)
{
DelegateTool.MouseDown (ev);
}
}
示例2: MouseDown
// END // HERZUM SPRINT 2.5 TLAB-136
// END HERZUM SPRINT 2.0 TLAB-136-2
public override void MouseDown(MouseEvent ev)
{
base.MouseDown(ev);
IDrawingView view = ev.View;
// HERZUM SPRINT 2.5 TLAB-136
if (!mouseUp){
return;
}
else
{
mouseUp = false;
mouseDown = true;
}
// HERZUM SPRINT 2.5 TLAB-136
// HERZUM SPRINT 2.0 TLAB-136-2
/*
if (x!=-1 && (x != ev.X || y != ev.Y)){
x = ev.X;
y = ev.Y;
}
else if (x == ev.X && y == ev.Y)
return;
else {
x = ev.X;
y = ev.Y;
}
*/
// END HERZUM SPRINT 2.5 TLAB-136
// END HERZUM SPRINT 2.2 TLAB-136-2
IFigure figure = view.Drawing.FindFigure(ev.X, ev.Y);
if(ev.IsRightButtonPressed())
{
ITool defaultTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
if (figure != null)
{
DelegateTool = figure.CreateFigureTool(this, Editor, defaultTool, ev);
}
else
{
//if it didn't hit figure then allow panning
DelegateTool = defaultTool;
}
}
else
{
IHandle handle = view.FindHandle(ev.X, ev.Y);
if (handle != null)
{
DelegateTool = new HandleTracker(Editor, new UndoableHandle(handle));
}
else
{
if(figure != null)
{
ITool dragTool = new DragTool(Editor, figure);
DelegateTool = figure.CreateFigureTool(this, Editor, dragTool, ev);
}
else
{
DelegateTool = new SelectAreaTool(Editor);
}
}
}
if (DelegateTool != null)
{
DelegateTool.MouseDown (ev);
}
}