Esempio n. 1
0
        public virtual void OnKeyUp(KeyEventArgs e)
        {
            RadCalculatorDropDownElement editorElement = this.EditorElement as RadCalculatorDropDownElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            int length = editorElement.EditorContentElement.Text.Length;

            switch (e.KeyCode)
            {
            case Keys.Left:
                if (this.selectionLength != 0 || (this.RightToLeft || this.selectionStart != 0) && (!this.RightToLeft || this.selectionStart != length))
                {
                    break;
                }
                base.OnKeyDown(e);
                break;

            case Keys.Right:
                if (this.selectionLength != 0 || (this.RightToLeft || this.selectionStart != length) && (!this.RightToLeft || this.selectionStart != 0))
                {
                    break;
                }
                base.OnKeyDown(e);
                break;
            }
        }
 protected override void CreateChildItems(RadElement parent)
 {
     base.CreateChildItems(parent);
     this.calculatorElement = this.CreateCalculatorDropDownElement();
     parent.Children.Add((RadElement)this.calculatorElement);
     this.calculatorElement.EditorContentElement.TextBoxItem.HostedControl.LostFocus += new EventHandler(this.HostedControl_LostFocus);
     this.calculatorElement.EditorContentElement.TextBoxItem.HostedControl.GotFocus  += new EventHandler(this.HostedControl_GotFocus);
 }
Esempio n. 3
0
        public override void BeginEdit()
        {
            base.BeginEdit();
            RadCalculatorDropDownElement editorElement = this.EditorElement as RadCalculatorDropDownElement;

            editorElement.CalculatorContentElement.Reset();
            editorElement.CalculatorContentElement.MemoryValue = new Decimal(0);
            editorElement.CalculatorValueChanging      += new ValueChangingEventHandler(this.editorElement_CalculatorValueChanging);
            editorElement.CalculatorValueChanged       += new EventHandler(this.editorElement_CalculatorValueChanged);
            editorElement.EditorContentElement.KeyUp   += new KeyEventHandler(this.editorElement_KeyUp);
            editorElement.EditorContentElement.KeyDown += new KeyEventHandler(this.editorElement_KeyDown);
            editorElement.EditorContentElement.Focus();
            editorElement.EditorContentElement.TextBoxItem.SelectAll();
        }
Esempio n. 4
0
        public override bool EndEdit()
        {
            base.EndEdit();
            RadCalculatorDropDownElement editorElement = this.EditorElement as RadCalculatorDropDownElement;

            if (editorElement.IsPopupOpen)
            {
                editorElement.ClosePopup();
            }
            editorElement.CalculatorValueChanging      -= new ValueChangingEventHandler(this.editorElement_CalculatorValueChanging);
            editorElement.CalculatorValueChanged       -= new EventHandler(this.editorElement_CalculatorValueChanged);
            editorElement.EditorContentElement.KeyUp   -= new KeyEventHandler(this.editorElement_KeyUp);
            editorElement.EditorContentElement.KeyDown -= new KeyEventHandler(this.editorElement_KeyDown);
            return(true);
        }
Esempio n. 5
0
        public override void OnKeyDown(KeyEventArgs e)
        {
            RadCalculatorDropDownElement editorElement = this.EditorElement as RadCalculatorDropDownElement;

            if (editorElement == null || !editorElement.IsInValidState(true))
            {
                return;
            }
            this.selectionStart  = editorElement.EditorContentElement.TextBoxItem.SelectionStart;
            this.selectionLength = editorElement.EditorContentElement.TextBoxItem.SelectionLength;
            if (e.KeyCode == Keys.Return && e.Modifiers != Keys.Control)
            {
                base.OnKeyDown(e);
            }
            else
            {
                if (e.KeyCode != Keys.Escape)
                {
                    return;
                }
                base.OnKeyDown(e);
                e.Handled = true;
            }
        }
Esempio n. 6
0
 public RadCalculatorEditorContentElement(RadCalculatorDropDownElement owner)
     : this()
 {
     this.owner = owner;
 }