コード例 #1
0
        protected override void OnKeyUp(KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            if (!(this.OwnerElement is BaseListViewVisualItem))
            {
                return;
            }
            switch (e.KeyCode)
            {
            case Keys.Left:
                if ((!this.RightToLeft || this.selectionStart != editorElement.Text.Length) && (this.RightToLeft || this.selectionStart != 0 || this.selectionLength != 0))
                {
                    break;
                }
                editorElement.Validate();
                break;

            case Keys.Right:
                if ((!this.RightToLeft || this.selectionStart != 0) && (this.RightToLeft || this.selectionStart != editorElement.Text.Length))
                {
                    break;
                }
                editorElement.Validate();
                break;
            }
        }
コード例 #2
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            BaseListViewVisualItem itemElement = this.OwnerElement as BaseListViewVisualItem;

            if (itemElement != null)
            {
                switch (e.KeyCode)
                {
                case Keys.Return:
                    if (e.Modifiers != Keys.Control)
                    {
                        editorElement.Validate();
                        itemElement.Data.Owner.EndEdit();
                    }
                    break;

                case Keys.Escape:
                    itemElement.Data.Owner.CancelEdit();
                    break;

                case Keys.Delete:
                    if (selectionLength == editorElement.TextBoxItem.TextLength)
                    {
                        editorElement.Text = null;
                    }
                    break;
                }
            }
        }
コード例 #3
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            BaseSpinEditorElement  editorElement = this.EditorElement as BaseSpinEditorElement;
            BaseListViewVisualItem ownerElement  = this.OwnerElement as BaseListViewVisualItem;

            if (ownerElement == null)
            {
                return;
            }
            switch (e.KeyCode)
            {
            case Keys.Return:
                if (e.Modifiers == Keys.Control)
                {
                    break;
                }
                editorElement.Validate();
                ownerElement.Data.Owner.EndEdit();
                break;

            case Keys.Escape:
                ownerElement.Data.Owner.CancelEdit();
                break;

            case Keys.Delete:
                if (this.selectionLength != editorElement.TextBoxItem.TextLength)
                {
                    break;
                }
                editorElement.Text = (string)null;
                break;
            }
        }
コード例 #4
0
        protected override void OnKeyUp(KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            PropertyGridItemElement visualItem = this.OwnerElement as PropertyGridItemElement;

            if (visualItem != null)
            {
                switch (e.KeyCode)
                {
                case Keys.Right:
                    if ((RightToLeft && selectionStart == 0) || (!RightToLeft && selectionStart == editorElement.Text.Length))
                    {
                        editorElement.Validate();
                    }
                    break;

                case Keys.Left:
                    if ((RightToLeft && selectionStart == editorElement.Text.Length) || (!RightToLeft && selectionStart == 0 && selectionLength == 0))
                    {
                        editorElement.Validate();
                    }
                    break;
                }
            }
        }
コード例 #5
0
        protected virtual void OnKeyUp(KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            BaseListViewVisualItem itemElement = this.OwnerElement as BaseListViewVisualItem;

            if (itemElement != null)
            {
                switch (e.KeyCode)
                {
                case Keys.Right:
                    if ((RightToLeft && selectionStart == 0) || (!RightToLeft && selectionStart == editorElement.Text.Length))
                    {
                        editorElement.Validate();
                    }
                    break;

                case Keys.Left:
                    if ((RightToLeft && selectionStart == editorElement.Text.Length) || (!RightToLeft && selectionStart == 0 && selectionLength == 0))
                    {
                        editorElement.Validate();
                    }
                    break;
                }
            }
        }
コード例 #6
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            PropertyGridItemElement visualItem = this.OwnerElement as PropertyGridItemElement;

            if (visualItem != null)
            {
                switch (e.KeyCode)
                {
                case Keys.Return:
                    if (e.Modifiers != Keys.Control)
                    {
                        editorElement.Validate();
                        visualItem.PropertyTableElement.EndEdit();
                    }
                    break;

                case Keys.Escape:
                    visualItem.Data.PropertyGridTableElement.CancelEdit();
                    break;

                case Keys.Delete:
                    if (selectionLength == editorElement.TextBoxItem.TextLength)
                    {
                        editorElement.Text = null;
                    }
                    break;
                }
            }
        }
コード例 #7
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            TreeNodeElement treeNodeElement = this.OwnerElement as TreeNodeElement;

            if (treeNodeElement != null)
            {
                switch (e.KeyCode)
                {
                case Keys.Return:
                    if (e.Modifiers != Keys.Control)
                    {
                        editorElement.Validate();
                        treeNodeElement.TreeViewElement.EndEdit();
                    }
                    break;

                case Keys.Escape:
                    treeNodeElement.TreeViewElement.CancelEdit();
                    break;

                case Keys.Delete:
                    if (selectionLength == editorElement.TextBoxItem.TextLength)
                    {
                        editorElement.Text = null;
                    }
                    break;
                }
            }
        }
コード例 #8
0
ファイル: BaseSpinEditor.cs プロジェクト: RichardHaggard/BDC
        private void spinElement_KeyUp(object sender, KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            this.OnKeyUp(e);
        }
コード例 #9
0
ファイル: BaseSpinEditor.cs プロジェクト: RichardHaggard/BDC
        private void spinElement_KeyDown(object sender, KeyEventArgs e)
        {
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            this.selectionStart  = editorElement.TextBoxItem.SelectionStart;
            this.selectionLength = editorElement.TextBoxItem.SelectionLength;
            this.OnKeyDown(e);
        }
コード例 #10
0
ファイル: BaseSpinEditor.cs プロジェクト: configare/hispeed
        public override bool EndEdit()
        {
            base.EndEdit();
            BaseSpinEditorElement spinElement = this.EditorElement as BaseSpinEditorElement;

            spinElement.ValueChanging -= new ValueChangingEventHandler(spinElement_ValueChanging);
            spinElement.ValueChanged  -= new EventHandler(spinElement_ValueChanged);
            spinElement.KeyDown       -= new KeyEventHandler(spinElement_KeyDown);
            spinElement.KeyUp         -= new KeyEventHandler(spinElement_KeyUp);
            spinElement.TextBoxItem.HostedControl.LostFocus -= new EventHandler(HostedControl_LostFocus);
            spinElement.EnableValueChangingOnTextChanging    = false;
            spinElement.Value = spinElement.MinValue;
            return(true);
        }
コード例 #11
0
ファイル: BaseSpinEditor.cs プロジェクト: configare/hispeed
        public override void BeginEdit()
        {
            base.BeginEdit();
            BaseSpinEditorElement spinElement = this.EditorElement as BaseSpinEditorElement;

            spinElement.ValueChanging += new ValueChangingEventHandler(spinElement_ValueChanging);
            spinElement.ValueChanged  += new EventHandler(spinElement_ValueChanged);
            spinElement.KeyDown       += new KeyEventHandler(spinElement_KeyDown);
            spinElement.KeyUp         += new KeyEventHandler(spinElement_KeyUp);
            spinElement.BackColor      = Color.White;
            spinElement.TextBoxItem.SelectAll();
            spinElement.TextBoxItem.TextBoxControl.Focus();
            spinElement.RightToLeft = RightToLeft;
            spinElement.TextBoxItem.HostedControl.LostFocus += new EventHandler(HostedControl_LostFocus);
        }
コード例 #12
0
ファイル: BaseSpinEditor.cs プロジェクト: RichardHaggard/BDC
        public override void BeginEdit()
        {
            base.BeginEdit();
            BaseSpinEditorElement editorElement = this.EditorElement as BaseSpinEditorElement;

            editorElement.ValueChanging      += new ValueChangingEventHandler(this.spinElement_ValueChanging);
            editorElement.ValueChanged       += new EventHandler(this.spinElement_ValueChanged);
            editorElement.KeyDown            += new KeyEventHandler(this.spinElement_KeyDown);
            editorElement.KeyUp              += new KeyEventHandler(this.spinElement_KeyUp);
            editorElement.RadPropertyChanged += new RadPropertyChangedEventHandler(this.spinElement_RadPropertyChanged);
            if (!BaseTextBoxEditor.IsDarkTheme(this.OwnerElement))
            {
                int num = (int)editorElement.SetDefaultValueOverride(VisualElement.BackColorProperty, (object)Color.White);
            }
            editorElement.TextBoxItem.SelectAll();
            editorElement.TextBoxItem.TextBoxControl.Focus();
            editorElement.RightToLeft = this.RightToLeft;
            editorElement.TextBoxItem.HostedControl.LostFocus += new EventHandler(this.HostedControl_LostFocus);
        }