Exemplo n.º 1
0
 /// <summary>
 /// Raises the <see cref="KeyDown" /> event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="OxyMouseEventArgs" /> instance containing the event data.</param>
 protected virtual void OnKeyDown(object sender, OxyKeyEventArgs e)
 {
     var handler = this.KeyDown;
     if (handler != null)
     {
         handler(sender, e);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Raises the <see cref="KeyDown" /> event.
        /// </summary>
        /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param>
        protected internal virtual void OnKeyDown(OxyKeyEventArgs e)
        {
            var handler = this.KeyDown;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 3
0
        protected override bool OnKey(SciterElement se, SciterXBehaviors.KEY_PARAMS prms)
        {
            if (prms.cmd == (uint)SciterXBehaviors.KEY_EVENTS.KEY_DOWN)
            {
                Keys key = (Keys)prms.key_code;

                var args = new OxyKeyEventArgs {
                    ModifierKeys = prms.alt_state.GetModifiers(), Key = key.Convert()
                };
                return(ActualController.HandleKeyDown(this, args));
            }
            return(false);
        }
Exemplo n.º 4
0
        public virtual void HandleKeyDown(object sender, OxyKeyEventArgs e)
        {
            foreach (var element in this.GetHitTestElements())
            {
                element.OnKeyDown(e);

                if (e.Handled)
                {
                    break;
                }
            }

            if (!e.Handled)
            {
                this.OnKeyDown(sender, e);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Handles key down events.
        /// </summary>
        /// <param name="view">The plot view.</param>
        /// <param name="args">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param>
        /// <returns><c>true</c> if the event was handled.</returns>
        public virtual bool HandleKeyDown(IView view, OxyKeyEventArgs args)
        {
            lock (this.GetSyncRoot(view))
            {
                if (view.ActualModel == null)
                {
                    return(false);
                }

                view.ActualModel.HandleKeyDown(this, args);
                if (args.Handled)
                {
                    return(true);
                }

                var command = this.GetCommand(new OxyKeyGesture(args.Key, args.ModifierKeys));
                return(this.HandleCommand(command, view, args));
            }
        }
        /// <summary>
        /// Handles key down events.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param>
        public virtual void HandleKeyDown(object sender, OxyKeyEventArgs e)
        {
            // Revert the order to handle the top-level elements first
            foreach (var element in this.GetElements().Reverse())
            {
                var uiElement = element as UIElement;
                if (uiElement == null)
                {
                    continue;
                }

                uiElement.OnKeyDown(e);

                if (e.Handled)
                {
                    break;
                }
            }

            if (!e.Handled)
            {
                this.OnKeyDown(sender, e);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Handles key down events.
        /// </summary>
        /// <param name="view">The plot view.</param>
        /// <param name="args">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param>
        /// <returns><c>true</c> if the event was handled.</returns>
        public virtual bool HandleKeyDown(IView view, OxyKeyEventArgs args)
        {
            lock (this.GetSyncRoot(view))
            {
                if (view.ActualModel == null)
                {
                    return false;
                }

                view.ActualModel.HandleKeyDown(this, args);
                if (args.Handled)
                {
                    return true;
                }

                var command = this.GetCommand(new OxyKeyGesture(args.Key, args.ModifierKeys));
                return this.HandleCommand(command, view, args);
            }
        }
Exemplo n.º 8
0
 private void onKeyDownCuttingInsidePolygon(OxyKeyEventArgs e)
 {
     bool cuttingInsidePolygon = CurMainStage == Stage.Cutting; //&& CurSubStage == SubStage.Half;
     if (!cuttingInsidePolygon)
         return;
     //if (e.Key == OxyKey.L || e.Key == OxyKey.R && e.IsControlDown)
     //{
     //    Selection2DeleteBoundary(e.Key);
     //    return;
     //}
     if (e.Key == OxyKey.P && e.IsControlDown)
     {
         CompletePolygon();//
         return;
     }
     if (e.Key == OxyKey.Delete)
     {
         DeleteInsidePolygon();
         return;
     }
     ExtendCuttingLine(e.Key);
 }
Exemplo n.º 9
0
 private void onKeyDown(OxyKeyEventArgs e)
 {
     //onKeyDownCuttingByPolygon(e);
     onKeyDownCuttingInsidePolygon(e);
 }
Exemplo n.º 10
0
 void plotModel_KeyDown(object sender, OxyKeyEventArgs e)
 {
     onKeyDown(e);
 }
Exemplo n.º 11
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.PreviewKeyDown" /> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PreviewKeyDownEventArgs" /> that contains the event data.</param>
        protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
        {
            base.OnPreviewKeyDown(e);

            var args = new OxyKeyEventArgs {ModifierKeys = GetModifiers(), Key = e.KeyCode.Convert()};
            this.ActualController.HandleKeyDown(this, args);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Raises the <see cref="KeyDown" /> event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="OxyMouseEventArgs" /> instance containing the event data.</param>
 protected virtual void OnKeyDown(object sender, OxyKeyEventArgs e)
 {
     var handler = this.KeyDown;
     if (handler != null)
     {
         handler(sender, e);
     }
 }
Exemplo n.º 13
0
        /// <summary>
        /// Handles key down events.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param>
        public virtual void HandleKeyDown(object sender, OxyKeyEventArgs e)
        {
            // Revert the order to handle the top-level elements first
            foreach (var element in this.GetElements().Reverse())
            {
                var uiElement = element as UIElement;
                if (uiElement == null)
                {
                    continue;
                }

                uiElement.OnKeyDown(e);

                if (e.Handled)
                {
                    break;
                }
            }

            if (!e.Handled)
            {
                this.OnKeyDown(sender, e);
            }
        }
Exemplo n.º 14
0
 /// <summary>
 /// Raises the <see cref="KeyDown" /> event.
 /// </summary>
 /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param>
 protected internal virtual void OnKeyDown(OxyKeyEventArgs e)
 {
     var handler = this.KeyDown;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Exemplo n.º 15
0
        /// <summary>
        /// Handles key down events.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param>
        public virtual void HandleKeyDown(object sender, OxyKeyEventArgs e)
        {
            foreach (var element in this.GetHitTestElements())
            {
                element.OnKeyDown(e);

                if (e.Handled)
                {
                    break;
                }
            }

            if (!e.Handled)
            {
                this.OnKeyDown(sender, e);
            }
        }