public MaterialTextBox()
        {
            // Material Properties
            Hint        = "";
            Password    = false;
            UseAccent   = true;
            UseTallSize = true;

            // Properties
            TabStop     = true;
            Multiline   = false;
            BorderStyle = BorderStyle.None;

            // Animations
            _animationManager = new AnimationManager
            {
                Increment     = 0.08,
                AnimationType = AnimationType.EaseInOut
            };
            _animationManager.OnAnimationProgress += sender => Invalidate();

            MaterialContextMenuStrip cms = new TextBoxContextMenuStrip();

            cms.Opening          += ContextMenuStripOnOpening;
            cms.OnItemClickStart += ContextMenuStripOnItemClickStart;

            ContextMenuStrip = cms;

            MaxLength = 50;
        }
        public MaterialTextBox()
        {
            // Material Properties
            Hint        = "";
            Password    = false;
            UseAccent   = true;
            UseTallSize = true;

            // Properties
            Font          = new Font(SkinManager.getFontByType(MaterialSkinManager.fontType.Subtitle1).FontFamily, 12f, FontStyle.Regular);
            base.AutoSize = false;
            TabStop       = true;
            Multiline     = false;
            BorderStyle   = BorderStyle.None;

            // Animations
            _animationManager = new AnimationManager
            {
                Increment     = 0.08,
                AnimationType = AnimationType.EaseInOut
            };
            _animationManager.OnAnimationProgress += sender => Invalidate();

            MaterialContextMenuStrip cms = new TextBoxContextMenuStrip();

            cms.Opening          += ContextMenuStripOnOpening;
            cms.OnItemClickStart += ContextMenuStripOnItemClickStart;

            ContextMenuStrip = cms;

            MaxLength = 50;
        }
Esempio n. 3
0
            public BaseTextBox()
            {
                MaterialContextMenuStrip cms = new TextBoxContextMenuStrip();

                cms.Opening          += ContextMenuStripOnOpening;
                cms.OnItemClickStart += ContextMenuStripOnItemClickStart;

                ContextMenuStrip = cms;
            }
Esempio n. 4
0
            private void ContextMenuStripOnOpening(object sender, CancelEventArgs cancelEventArgs)
            {
                TextBoxContextMenuStrip textBoxContextMenuStrip = sender as TextBoxContextMenuStrip;

                if (textBoxContextMenuStrip != null)
                {
                    textBoxContextMenuStrip.Undo.Enabled      = base.CanUndo;
                    textBoxContextMenuStrip.Cut.Enabled       = !string.IsNullOrEmpty(this.SelectedText);
                    textBoxContextMenuStrip.Copy.Enabled      = !string.IsNullOrEmpty(this.SelectedText);
                    textBoxContextMenuStrip.Paste.Enabled     = Clipboard.ContainsText();
                    textBoxContextMenuStrip.Delete.Enabled    = !string.IsNullOrEmpty(this.SelectedText);
                    textBoxContextMenuStrip.SelectAll.Enabled = !string.IsNullOrEmpty(this.Text);
                }
            }