Esempio n. 1
0
        protected AdvancedReshapeToolBase()
        {
            // This is our property:
            RequiresSelection = true;

            SelectionCursor      = ToolUtils.GetCursor(Resources.AdvancedReshapeToolCursor);
            SelectionCursorShift = ToolUtils.GetCursor(Resources.AdvancedReshapeToolCursorShift);

            HandledKeys.Add(_keyToggleNonDefaultSide);
        }
Esempio n. 2
0
        protected override void OnToolKeyDown(MapViewKeyEventArgs k)
        {
            _msg.VerboseDebug("OnToolKeyDown");

            try
            {
                PressedKeys.Add(k.Key);

                if (IsModifierKey(k.Key) || HandledKeys.Contains(k.Key))
                {
                    k.Handled = true;
                }

                if (k.Key == _keyShowOptionsPane)
                {
                    ShowOptionsPane();
                }

                // Cancel outside a queued task otherwise the current task that blocks the queue
                // cannot be cancelled.
                if (k.Key == Key.Escape)
                {
                    HandleEscape();
                }

                QueuedTaskUtils.Run(
                    delegate
                {
                    if (IsShiftKey(k.Key) &&
                        SelectionCursorShift != null && IsInSelectionPhase())
                    {
                        SetCursor(SelectionCursorShift);
                    }

                    OnKeyDownCore(k);

                    return(true);
                });
            }
            catch (Exception e)
            {
                HandleError($"Error in tool key down ({Caption}): {e.Message}", e, true);
            }
        }
Esempio n. 3
0
        protected override void OnToolKeyDown(MapViewKeyEventArgs k)
        {
            _msg.VerboseDebug("OnToolKeyDown");

            try
            {
                if (IsModifierKey(k.Key) || HandledKeys.Contains(k.Key))
                {
                    k.Handled = true;
                }

                if (k.Key == _keyShowOptionsPane)
                {
                    ShowOptionsPane();
                }

                QueuedTaskUtils.Run(
                    delegate
                {
                    if (k.Key == Key.Escape)
                    {
                        return(HandleEscape());
                    }

                    if ((k.Key == Key.LeftShift || k.Key == Key.RightShift) &&
                        SelectionCursorShift != null && IsInSelectionPhase())
                    {
                        SetCursor(SelectionCursorShift);
                    }

                    OnKeyDownCore(k);

                    return(true);
                });
            }
            catch (Exception e)
            {
                HandleError($"Error in tool key down ({Caption}): {e.Message}", e, true);
            }
        }
Esempio n. 4
0
 protected OneClickToolBase()
 {
     UseSnapping = false;
     HandledKeys.Add(Key.Escape);
     HandledKeys.Add(_keyShowOptionsPane);
 }