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


C# MouseEvent.IsRightButtonPressed方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:46,代码来源:SelectionTool.cs

示例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);
            }
        }
开发者ID:CoEST,项目名称:TraceLab,代码行数:76,代码来源:SelectionTool.cs


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