예제 #1
0
        private void Automation_SetCursor(object sender, AnnCursorEventArgs e)
        {
            Cursor newCursor = null;

            if (e.IsRotateCenter)
            {
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateCenterControlPoint];
            }
            else if (e.IsRotateGripper)
            {
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateGripperControlPoint];
            }
            else if (e.ThumbIndex < 0)
            {
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectedObject];
            }
            else
            {
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.ControlPoint];
            }
            if (_viewer.Cursor != newCursor)
            {
                _viewer.Cursor = newCursor;
            }
        }
예제 #2
0
        private void _annAutomation_SetCursor(object sender, AnnCursorEventArgs e)
        {
            // If there's an interactive mode working and its not automation, then don't do anything
            if (!_automationInteractiveMode.IsEnabled)
            {
                return;
            }

            Cursor newCursor = null;

            switch (e.DesignerType)
            {
            case AnnDesignerType.Draw:
            {
                newCursor = Cursors.Cross;
            }
            break;

            case AnnDesignerType.Edit:
            {
                if (e.IsRotateCenter)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateCenterControlPoint];
                }
                else if (e.IsRotateGripper)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateGripperControlPoint];
                }
                else if (e.ThumbIndex < 0)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectedObject];
                }
                else
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.ControlPoint];
                }
            }
            break;

            case AnnDesignerType.Run:
            {
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.Run];
            }
            break;

            default:
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectObject];
                break;
            }

            if (_rasterImageViewer.Cursor != newCursor)
            {
                _rasterImageViewer.Cursor = newCursor;
            }
        }
예제 #3
0
        void automation_SetCursor(object sender, AnnCursorEventArgs e)
        {
            Cursor newCursor = null;

            switch (e.DesignerType)
            {
            case AnnDesignerType.Draw:
            {
                AnnAutomationObject annAutomationObject = _automationManager.FindObjectById(e.Id);
                if (annAutomationObject != null && annAutomationObject.UserData != null)
                {
                    newCursor = annAutomationObject.DrawCursor as Cursor;
                }
            }
            break;

            case AnnDesignerType.Edit:
            {
                if (e.IsRotateCenter)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateCenterControlPoint];
                }
                else if (e.IsRotateGripper)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateGripperControlPoint];
                }
                else if (e.ThumbIndex < 0)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectedObject];
                }
                else
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.ControlPoint];
                }
            }
            break;

            case AnnDesignerType.Run:
            {
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.Run];
            }
            break;

            default:
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectObject];
                break;
            }

            if (_imageViewer.Cursor != newCursor)
            {
                _imageViewer.Cursor = newCursor;
            }
        }
예제 #4
0
        private void automation_SetCursor(object sender, AnnCursorEventArgs e)
        {
            // If there's an interactive mode working and its not automation, then dont do anything
            var imageViewer = _documentViewer.View.ImageViewer;

            if (imageViewer.WorkingInteractiveMode != null && imageViewer.WorkingInteractiveMode.Id != DocumentViewer.AnnotationsInteractiveModeId)
            {
                return;
            }

            var    automation = sender as AnnAutomation;
            Cursor newCursor  = null;

            if (automation.ActiveContainer == null || !automation.ActiveContainer.IsEnabled)
            {
                newCursor = Cursors.Default;
            }
            else
            {
                switch (e.DesignerType)
                {
                case AnnDesignerType.Draw:
                {
                    var allow = true;

                    var drawDesigner = automation.CurrentDesigner as AnnDrawDesigner;
                    if (drawDesigner != null && !drawDesigner.IsTargetObjectAdded && e.PointerEvent != null)
                    {
                        // See if we can draw or not
                        var container = automation.ActiveContainer;

                        allow = false;

                        if (automation.HitTestContainer(e.PointerEvent.Location, false) != null)
                        {
                            allow = true;
                        }
                    }

                    if (allow)
                    {
                        var annAutomationObject = automation.Manager.FindObjectById(e.Id);
                        if (annAutomationObject != null)
                        {
                            newCursor = annAutomationObject.DrawCursor as Cursor;
                        }
                    }
                    else
                    {
                        newCursor = Cursors.No;
                    }
                }
                break;

                case AnnDesignerType.Edit:
                    if (e.IsRotateCenter)
                    {
                        newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateCenterControlPoint];
                    }
                    else if (e.IsRotateGripper)
                    {
                        newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateGripperControlPoint];
                    }
                    else if (e.ThumbIndex < 0)
                    {
                        if (e.DragDropEvent != null && !e.DragDropEvent.Allowed)
                        {
                            newCursor = Cursors.No;
                        }
                        else
                        {
                            newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectedObject];
                        }
                    }
                    else
                    {
                        newCursor = AutomationManagerHelper.AutomationCursors[CursorType.ControlPoint];
                    }
                    break;

                case AnnDesignerType.Run:
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.Run];
                    break;

                default:
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectObject];
                    break;
                }
            }

            if (imageViewer.Cursor != newCursor)
            {
                imageViewer.Cursor = newCursor;
            }
        }
예제 #5
0
        void automation_SetCursor(object sender, AnnCursorEventArgs e)
        {
            if (!_automationInteractiveMode.IsEnabled)
            {
                return;
            }

            var    automation = sender as AnnAutomation;
            Cursor newCursor  = null;

            switch (e.DesignerType)
            {
            case AnnDesignerType.Draw:
            {
                var allow = true;

                var drawDesigner = automation.CurrentDesigner as AnnDrawDesigner;
                if (drawDesigner != null && !drawDesigner.IsTargetObjectAdded && e.PointerEvent != null)
                {
                    // See if we can draw or not
                    var container = automation.ActiveContainer;

                    allow = false;

                    if (automation.HitTestContainer(e.PointerEvent.Location, false) != null)
                    {
                        allow = true;
                    }
                }

                if (allow)
                {
                    var annAutomationObject = automation.Manager.FindObjectById(e.Id);
                    if (annAutomationObject != null)
                    {
                        newCursor = annAutomationObject.DrawCursor as Cursor;
                    }
                }
                else
                {
                    newCursor = Cursors.No;
                }
            }
            break;

            case AnnDesignerType.Edit:
            {
                if (e.IsRotateCenter)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateCenterControlPoint];
                }
                else if (e.IsRotateGripper)
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.RotateGripperControlPoint];
                }
                else if (e.ThumbIndex < 0)
                {
                    if (e.DragDropEvent != null && !e.DragDropEvent.Allowed)
                    {
                        newCursor = Cursors.No;
                    }
                    else
                    {
                        newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectedObject];
                    }
                }
                else
                {
                    newCursor = AutomationManagerHelper.AutomationCursors[CursorType.ControlPoint];
                }
            }
            break;

            case AnnDesignerType.Run:
            {
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.Run];
            }
            break;

            default:
                newCursor = AutomationManagerHelper.AutomationCursors[CursorType.SelectObject];
                break;
            }

            if (Viewer.Cursor != newCursor)
            {
                Viewer.Cursor = newCursor;
            }
        }