Ejemplo n.º 1
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;
                }
            }
        }
Ejemplo n.º 2
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;
            }
        }
Ejemplo n.º 3
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;
                }
            }
        }
Ejemplo n.º 4
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;
            }
        }
Ejemplo n.º 5
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;
                }
            }
        }
Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 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;
                }
            }
        }