示例#1
0
        public FlexControlAdvancedForm(Console c)
        {
            InitializeComponent();

            console = c;

            fc_interface = new FlexControlInterface1(c);

            comboModeA1.Items.Clear();
            comboModeA2.Items.Clear();
            comboModeB1.Items.Clear();
            comboModeB2.Items.Clear();

            comboModeADouble.Items.Clear();
            comboModeBDouble.Items.Clear();

            foreach (Control ctrl in grpButton.Controls)
            {
                if (ctrl.GetType() == typeof(ComboBoxTS))
                {
                    ComboBoxTS combo = (ComboBoxTS)ctrl;
                    combo.Items.Clear();
                }
            }

            // populate knob combobox controls
            foreach (FlexControlKnobFunction function in Enum.GetValues(typeof(FlexControlKnobFunction)))
            {
                string s = KnobFunction2String(function);
                comboModeA1.Items.Add(s);
                comboModeA2.Items.Add(s);
                comboModeB1.Items.Add(s);
                comboModeB2.Items.Add(s);
            }

            // populate button combobox controls
            foreach (FlexControlButtonFunction function in Enum.GetValues(typeof(FlexControlButtonFunction)))
            {
                string s = ButtonFunction2String(function);

                comboModeADouble.Items.Add(s);
                comboModeBDouble.Items.Add(s);

                foreach (Control ctrl in grpButton.Controls)
                {
                    if (ctrl.GetType() == typeof(ComboBoxTS))
                    {
                        ComboBoxTS combo = (ComboBoxTS)ctrl;
                        combo.Items.Add(s);
                    }
                }
            }

            SetupDefaults();

            Common.RestoreForm(this, "FlexControlAdvancedForm", false);

            comboModeA1_SelectedIndexChanged(this, EventArgs.Empty);
            comboModeA2_SelectedIndexChanged(this, EventArgs.Empty);
            comboModeB1_SelectedIndexChanged(this, EventArgs.Empty);
            comboModeB2_SelectedIndexChanged(this, EventArgs.Empty);


            fc_interface.CurrentKnobModeChanged += new FlexControlInterface1.KnobModeChanged(UpdateCurrentKnobMode);

            hlKnobA1      = new PanelHighlighter(panelModeA1);
            hlKnobA2      = new PanelHighlighter(panelModeA2);
            hlKnobB1      = new PanelHighlighter(panelModeB1);
            hlKnobB2      = new PanelHighlighter(panelModeB2);
            hlKnobADouble = new PanelHighlighter(panelModeADouble);
            hlKnobBDouble = new PanelHighlighter(panelModeBDouble);

            hlLeftSingle  = new PanelHighlighter(panelLeftSingle);
            hlLeftDouble  = new PanelHighlighter(panelLeftDouble);
            hlLeftLong    = new PanelHighlighter(panelLeftLong);
            hlMidSingle   = new PanelHighlighter(panelMidSingle);
            hlMidDouble   = new PanelHighlighter(panelMidDouble);
            hlMidLong     = new PanelHighlighter(panelMidLong);
            hlRightSingle = new PanelHighlighter(panelRightSingle);
            hlRightDouble = new PanelHighlighter(panelRightDouble);
            hlRightLong   = new PanelHighlighter(panelRightLong);
        }
        public FlexControlAdvancedForm(Console c)
        {
            InitializeComponent();

            console = c;

            fc_interface = new FlexControlInterface1(c);

            comboModeA1.Items.Clear();
            comboModeA2.Items.Clear();
            comboModeB1.Items.Clear();
            comboModeB2.Items.Clear();

            comboModeADouble.Items.Clear();
            comboModeBDouble.Items.Clear();

            foreach (Control ctrl in grpButton.Controls)
            {
                if (ctrl.GetType() == typeof(ComboBoxTS))
                {
                    ComboBoxTS combo = (ComboBoxTS)ctrl;
                    combo.Items.Clear();
                }
            }

            // populate knob combobox controls
            foreach (FlexControlKnobFunction function in Enum.GetValues(typeof(FlexControlKnobFunction)))
            {
                string s = KnobFunction2String(function);
                comboModeA1.Items.Add(s);
                comboModeA2.Items.Add(s);
                comboModeB1.Items.Add(s);
                comboModeB2.Items.Add(s);
            }           

            // populate button combobox controls
            foreach (FlexControlButtonFunction function in Enum.GetValues(typeof(FlexControlButtonFunction)))
            {
                string s = ButtonFunction2String(function);

                comboModeADouble.Items.Add(s);
                comboModeBDouble.Items.Add(s);

                foreach (Control ctrl in grpButton.Controls)
                {
                    if (ctrl.GetType() == typeof(ComboBoxTS))
                    {
                        ComboBoxTS combo = (ComboBoxTS)ctrl;
                        combo.Items.Add(s);
                    }
                }
            }

            SetupDefaults();

            Common.RestoreForm(this, "FlexControlAdvancedForm", false);

            comboModeA1_SelectedIndexChanged(this, EventArgs.Empty);
            comboModeA2_SelectedIndexChanged(this, EventArgs.Empty);
            comboModeB1_SelectedIndexChanged(this, EventArgs.Empty);
            comboModeB2_SelectedIndexChanged(this, EventArgs.Empty);

            
            fc_interface.CurrentKnobModeChanged += new FlexControlInterface1.KnobModeChanged(UpdateCurrentKnobMode);

            hlKnobA1 = new PanelHighlighter(panelModeA1);
            hlKnobA2 = new PanelHighlighter(panelModeA2);
            hlKnobB1 = new PanelHighlighter(panelModeB1);
            hlKnobB2 = new PanelHighlighter(panelModeB2);
            hlKnobADouble = new PanelHighlighter(panelModeADouble);
            hlKnobBDouble = new PanelHighlighter(panelModeBDouble);

            hlLeftSingle = new PanelHighlighter(panelLeftSingle);
            hlLeftDouble = new PanelHighlighter(panelLeftDouble);
            hlLeftLong = new PanelHighlighter(panelLeftLong);
            hlMidSingle = new PanelHighlighter(panelMidSingle);
            hlMidDouble = new PanelHighlighter(panelMidDouble);
            hlMidLong = new PanelHighlighter(panelMidLong);
            hlRightSingle = new PanelHighlighter(panelRightSingle);
            hlRightDouble = new PanelHighlighter(panelRightDouble);
            hlRightLong = new PanelHighlighter(panelRightLong);
        }