Beispiel #1
0
 private void textBox1_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         Ok.Execute();
     }
 }
Beispiel #2
0
        public DefaultStringEditor()
        {
            InitializeComponent();

            m_textBox = new MyTextBox(drawWindow1, () => new RectangleF(0, 0, drawWindow1.Width, drawWindow1.Height), MyTextBox.InputFormEnum.Text, AutoCompleteSuggestions, x => MyTextBox.TextBoxBorderDaniel, 4, Fonts.Default);
            m_textBox.RequestedAreaChanged += () =>
            {
                //Draw window is the whole control so we can just modify the control
                MinimumSize = new Size(0, (int)m_textBox.RequestedArea.Height);
                Size        = m_textBox.RequestedArea.ToSize();
            };
            m_textBox.EnterPressed += () => Ok.Execute();
            m_textBox.SpecialEnter  = true;
            MyTextBox.SetupCallbacks(drawWindow1, m_textBox);
        }
Beispiel #3
0
        public DefaultEnumEditor()
        {
            InitializeComponent();
            drawWindow1.SizeChanged += (a, args) => m_comboBox.AreaChanged();

            m_comboBox = new TControl(drawWindow1, () => new RectangleF(0, 0, drawWindow1.Width, drawWindow1.Height), true, m_comboBoxItems, Fonts.Default);
            m_comboBox.SetupCallbacks();
            m_comboBox.RequestedAreaChanged += () =>
            {
                MinimumSize      = new Size(0, (int)m_comboBox.RequestedArea.Height);
                Size             = m_comboBox.RequestedArea.ToSize();
                drawWindow1.Size = Size; //This should not be necessary, due to docking, but for some reason is.
            };
            m_comboBox.SelectionChanged += () => m_parameter.EditorSelected = m_comboBox.SelectedItem.Contents;
            m_comboBox.EnterPressed     += () => { Ok.Execute(); };
        }
        public DefaultDynamicEnumEditor()
        {
            InitializeComponent();

            m_comboBoxItems = (new ExtraLazyEnumerable <TItem>(() => m_parameter.Options.Select(ch => new TItem(ch, ch))));
            m_comboBox      = new TControl(drawWindow1, () => new RectangleF(0, 0, drawWindow1.Width, drawWindow1.Height), true, m_comboBoxItems, Fonts.Default);
            m_comboBox.SetupCallbacks();
            m_comboBox.RequestedAreaChanged += () =>
            {
                //Draw window is the whole control so we can just modify the control
                MinimumSize = new Size(0, (int)m_comboBox.RequestedArea.Height);
                Size        = m_comboBox.RequestedArea.ToSize();
                Invalidate(true);
            };
            m_comboBox.EnterPressed += () => { Ok.Execute(); };
        }
Beispiel #5
0
        public DefaultAudioEditor()
        {
            InitializeComponent();

            //TODO: AUDIO: Suggest paths that exist for autoCompleteSuggestions
            m_textBox = new MyTextBox(drawWindow1, () => new RectangleF(0, 0, drawWindow1.Width, drawWindow1.Height), MyTextBox.InputFormEnum.Path, null, x => MyTextBox.TextBoxBorderDaniel, 4, Fonts.Default);
            m_textBox.RequestedAreaChanged += () =>
            {
                int extraHeight = (Size.Height - drawWindow1.Size.Height).Clamp(0, int.MaxValue);
                drawWindow1.MinimumSize = new Size(0, (int)m_textBox.RequestedArea.Height);
                MinimumSize             = new Size(MinimumSize.Width, (int)m_textBox.RequestedArea.Height + extraHeight);
                drawWindow1.Size        = m_textBox.RequestedArea.ToSize();
                Size = new Size(Width, m_textBox.RequestedArea.ToSize().Height + extraHeight);
            };
            m_textBox.EnterPressed += () => Ok.Execute();
            m_textBox.SpecialEnter  = true;
            MyTextBox.SetupCallbacks(drawWindow1, m_textBox);
            drawWindow1.SizeChanged += new EventHandler(drawWindow1_SizeChanged);
        }