コード例 #1
0
ファイル: Model.MouseEvents.cs プロジェクト: hcoona/OneDotNet
 /// <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);
     }
 }
コード例 #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);
            }
        }
コード例 #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);
        }
コード例 #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);
            }
        }
コード例 #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));
            }
        }
コード例 #6
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);
            }
        }
コード例 #7
0
ファイル: ControllerBase.cs プロジェクト: Keyabob/MMG
        /// <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);
            }
        }
コード例 #8
0
ファイル: Model.cs プロジェクト: kingofcrabs/NetDesigner
 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);
 }
コード例 #9
0
ファイル: Model.cs プロジェクト: kingofcrabs/NetDesigner
 private void onKeyDown(OxyKeyEventArgs e)
 {
     //onKeyDownCuttingByPolygon(e);
     onKeyDownCuttingInsidePolygon(e);
 }
コード例 #10
0
ファイル: Model.cs プロジェクト: kingofcrabs/NetDesigner
 void plotModel_KeyDown(object sender, OxyKeyEventArgs e)
 {
     onKeyDown(e);
 }
コード例 #11
0
ファイル: PlotView.cs プロジェクト: Keyabob/MMG
        /// <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);
        }
コード例 #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);
     }
 }
コード例 #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);
            }
        }
コード例 #14
0
ファイル: UIElement.cs プロジェクト: Celderon/oxyplot
 /// <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);
     }
 }
コード例 #15
0
ファイル: Model.MouseEvents.cs プロジェクト: Keyabob/MMG
        /// <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);
            }
        }