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


C# MouseEventArgs.ToTEMouseArgs方法代码示例

本文整理汇总了C#中MouseEventArgs.ToTEMouseArgs方法的典型用法代码示例。如果您正苦于以下问题:C# MouseEventArgs.ToTEMouseArgs方法的具体用法?C# MouseEventArgs.ToTEMouseArgs怎么用?C# MouseEventArgs.ToTEMouseArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MouseEventArgs的用法示例。


在下文中一共展示了MouseEventArgs.ToTEMouseArgs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMouseDown

        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            this.Focus();

            if (e.Button.HasFlag(MouseButtons.Left))
            {
                // call left down-method in the current tool
                var mousep = e.Location.ToPoint();
                var oo = ObjectAtCursor;
                TEMouseArgs ee = e.ToTEMouseArgs();
                TheOverlayModel.CurrentTool.OnLeftMouseButtonDown(oo, new System.Windows.Point(mousep.X, Height - mousep.Y), ee);
                //e.Handled = ee.Handled;
            }
            else if (e.Button.HasFlag(MouseButtons.Right))
            {
                // call right down-method in the current tool
                var mousep = e.Location.ToPoint();
                var oo = ObjectAtCursor;
                TEMouseArgs ee = e.ToTEMouseArgs();
                TheOverlayModel.CurrentTool.OnRightMouseButtonDown(oo, new System.Windows.Point(mousep.X, Height - mousep.Y), ee);
                //e.Handled = ee.Handled;

                // if the tool didn't use the click-> proceed with standard handling
                if (!ee.Handled)
                {
                    if (Tool == OverlayToolType.move)
                    {
                        //canvas1.ContextMenu.IsEnabled = true;
                        if (TheOverlayModel.CurEditing != null)
                        {
                            TheOverlayModel.CurEditing = null;
                            //PreventContextMenuOpening = true;
                        }
                        else
                        {
                            // right click not consumed yet -> open context menu
                            TheContextMenu.Show(this, e.Location);
                        }
                    }
                    else
                    {
                        Tool = OverlayToolType.move;
                        //PreventContextMenuOpening = true;
                    }
                }
            }

        }
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:49,代码来源:PdfOverlay.cs

示例2: OnMouseUp

        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);

            if (e.Button.HasFlag(MouseButtons.Left))
            {
                if (MouseCaptured)
                    MouseCaptured = false;  // release mouse capture here to make sure the tools cannot forget
                var mousep = e.Location.ToPoint();
                TEMouseArgs ee = e.ToTEMouseArgs();
                TheOverlayModel.CurrentTool.OnLeftMouseButtonUp(new System.Windows.Point(mousep.X, Height - mousep.Y), ee);
                //e.Handled = ee.Handled;

            }
            else if (e.Button.HasFlag(MouseButtons.Right))
            {

            }

        }
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:20,代码来源:PdfOverlay.cs

示例3: OnMouseMove

        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            var mousep = e.Location.ToPoint();
            // convert to bottom left coordinates
            var p = new System.Windows.Point(mousep.X, Height - mousep.Y);

            TEMouseArgs ee = e.ToTEMouseArgs();
            TheOverlayModel.CurrentTool.OnMouseMove(p, ee);
            //GlobalUI.UI.AddStatusLine(this, "mm " + mousep+" " + CursorPosition);
            //e.Handled = ee.Handled;
        }
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:13,代码来源:PdfOverlay.cs


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