/// <summary>
        /// Constructor for the KryptonDataGridViewMaskedTextBoxCell cell type
        /// </summary>
        public KryptonDataGridViewMaskedTextBoxCell()
        {
            // Create a thread specific KryptonMaskedTextBox control used for the painting of the non-edited cells
            if (_paintingMaskedTextBox == null)
            {
                _paintingMaskedTextBox = new KryptonMaskedTextBox();
                _paintingMaskedTextBox.SetLayoutDisplayPadding(new Padding(0, 0, 1, -1));
                _paintingMaskedTextBox.StateCommon.Border.Width = 0;
                _paintingMaskedTextBox.StateCommon.Border.Draw  = InheritBool.False;
                _paintingMaskedTextBox.StateCommon.Back.Color1  = Color.Empty;
            }

            // Set the default values of the properties:
            _promptChar         = '_';
            _allowPromptAsInput = true;
            _asciiOnly          = false;
            _beepOnError        = false;
            _cutCopyMaskFormat  = MaskFormat.IncludeLiterals;
            _hidePromptOnLeave  = false;
            _hideSelection      = true;
            _insertKeyMode      = InsertKeyMode.Default;
            _mask         = string.Empty;
            _passwordChar = '\0';
            _rejectInputOnFirstFailure = false;
            _resetOnPrompt             = true;
            _resetOnSpace          = true;
            _skipLiterals          = true;
            _textMaskFormat        = MaskFormat.IncludeLiterals;
            _useSystemPasswordChar = false;
        }
        internal void ValidateCore(string value)
        {
            StandartCharacterMaskEditBoxProvider standardProvider = this.TryGetStandardProvider();
            InsertKeyMode insertKeyMode = InsertKeyMode.Default;

            if (standardProvider != null)
            {
                insertKeyMode = standardProvider.InsertKeyMode;
                standardProvider.InsertKeyMode = InsertKeyMode.Overwrite;
            }
            this.provider.Set(value, out this.hintPos, out this.hint);
            if (standardProvider == null)
            {
                return;
            }
            standardProvider.InsertKeyMode = insertKeyMode;
        }
示例#3
0
        private void ToggleStatusBarControl_INS()
        {
            RPHexEditorForm child = (RPHexEditorForm)this.ActiveMdiChild;

            if (child != null)
            {
                InsertKeyMode ikm = child.GetInsertMode;

                if (ikm == InsertKeyMode.Insert)
                {
                    child.SetInsertMode(InsertKeyMode.Overwrite);
                }
                else
                {
                    child.SetInsertMode(InsertKeyMode.Insert);
                }
            }
        }
        /// <devdoc>
        ///     Initializes the object with the specified MaskedTextProvider object and default
        ///     property values.
        /// </devdoc>
        private void Initialize(MaskedTextProvider maskedTextProvider)
        {
            Debug.Assert(maskedTextProvider != null, "Initializing from a null MaskProvider ref.");

            this.maskedTextProvider = maskedTextProvider;

            // set the initial display text.
            if (!this.flagState[IS_NULL_MASK])
            {
                SetWindowText();
            }

            // set default values.
            this.passwordChar = this.maskedTextProvider.PasswordChar;
            this.insertMode   = InsertKeyMode.Default;

            this.flagState[HIDE_PROMPT_ON_LEAVE         ] = false;
            this.flagState[BEEP_ON_ERROR                ] = false;
            this.flagState[USE_SYSTEM_PASSWORD_CHAR     ] = false;
            this.flagState[REJECT_INPUT_ON_FIRST_FAILURE] = false;

            // CutCopyMaskFormat - set same defaults as TextMaskFormat (IncludePromptAndLiterals).
            // It is a lot easier to handle this flags individually since that's the way the MaskedTextProvider does it.
            this.flagState[CUTCOPYINCLUDEPROMPT         ] = this.maskedTextProvider.IncludePrompt;
            this.flagState[CUTCOPYINCLUDELITERALS       ] = this.maskedTextProvider.IncludeLiterals;

            // fields for internal use.
            this.flagState[HANDLE_KEY_PRESS] = true;
            this.caretTestPos           = 0; 
        }
示例#5
0
 public void SetInsertMode(InsertKeyMode mode)
 {
     rpHexEditor.InsertMode = mode;
 }