Ejemplo n.º 1
0
        private void AddBoolControl(Dsp dsp, ref DspParameterDesc info, int index)
        {
            var boolPanel = new IntParameterPanel();

            boolPanel.ComboBox.Items.AddRange(new object[] { "False", "True" });
            boolPanel.Description   = info.Description;
            boolPanel.Anchor        = AnchorStyles.Left | AnchorStyles.Right;
            boolPanel.ValueChanged += (s, e) => dsp.SetParameterBool(index, boolPanel.Value == 1);
            flowPanel.Controls.Add(boolPanel, 0, index);
        }
Ejemplo n.º 2
0
        private void AddIntControl(Dsp dsp, ref DspParameterDesc info, int index)
        {
            var intPanel = new IntParameterPanel();

            // ReSharper disable once CoVariantArrayConversion
            intPanel.ComboBox.Items.AddRange(info.IntDescription.ValueNames);
            intPanel.Description   = info.Description;
            intPanel.Anchor        = AnchorStyles.Left | AnchorStyles.Right;
            intPanel.Value         = dsp.GetParameterInt(index);
            intPanel.ValueChanged += (s, e) => dsp.SetParameterInt(index, intPanel.Value);
            flowPanel.Controls.Add(intPanel, 0, index);
        }
Ejemplo n.º 3
0
        // ReSharper disable once UnusedParameter.Local
        private void AddDataControl(Dsp dsp, ref DspParameterDesc info, int index)
        {
            var panel = new IntParameterPanel {
                Description = info.Description
            };

            panel.ComboBox.Visible = false;
            panel.Anchor           = AnchorStyles.Left | AnchorStyles.Right;
            var label = new Label
            {
                Text      = @"Unable to create dynamic control for ""Data"" parameters.",
                ForeColor = Color.Red,
                AutoSize  = false,
                TextAlign = ContentAlignment.MiddleCenter,
                Anchor    = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right,
                Size      = new Size(371, 45),
                Location  = new Point(6, 42)
            };

            panel.Controls.Add(label);
            flowPanel.Controls.Add(panel, 0, index);
        }