상속: System.Windows.Forms.UserControl
예제 #1
0
        public dlJoysticks()
        {
            InitializeComponent();

            _mUpdateJoysticks          = new Timer();
            _mUpdateJoysticks.Interval = 25;
            _mUpdateJoysticks.Tick    += _mUpdateJoysticks_Tick;
            _mUpdateJoysticks.Start();

            Main.Setup();

            for (int c_ = 0; c_ < (int)(JoyControls.NUM_OF_CONTROLS); c_++)
            {
                JoyControls c = (JoyControls)c_;

                var ucIn  = new ucJoystickChannel(c, true);
                var ucOut = new ucJoystickChannel(c, false);

                ucIn.Location  = new Point(3, 23 + ucIn.Height * c_);
                ucOut.Location = new Point(3, 23 + ucOut.Height * c_);

                controlsIn.Add(ucIn);
                controlsOut.Add(ucOut);

                gbIn.Controls.Add(ucIn);
                gbOut.Controls.Add(ucOut);

                // add to combobox
                cbControl.Items.Add(((int)c).ToString() + ", " + c.ToString());
            }

            var a = 0;

            for (a = 0; a < 8; a++)
            {
                var uc = new ucJoystickChannel(true, a);
                uc.Location = new Point(3, 23 + uc.Height * a);

                joysticks.Add(uc);
                gbController.Controls.Add(uc);
            }

            for (int b = 0; b < 32; b++)
            {
                var uc = new ucJoystickChannel(false, b);
                uc.Location = new Point(3, 23 + uc.Height * (a + b));

                joysticks.Add(uc);
                gbController.Controls.Add(uc);
            }
        }
예제 #2
0
        public dlJoysticks()
        {
            InitializeComponent();

            _mUpdateJoysticks = new Timer();
            _mUpdateJoysticks.Interval = 25;
            _mUpdateJoysticks.Tick += _mUpdateJoysticks_Tick;
            _mUpdateJoysticks.Start();

            Main.Setup();

            for (int c_ = 0; c_ < (int) (JoyControls.NUM_OF_CONTROLS); c_++)
            {
                JoyControls c = (JoyControls) c_;

                var ucIn = new ucJoystickChannel(c, true);
                var ucOut = new ucJoystickChannel(c, false);

                ucIn.Location = new Point(3, 23 + ucIn.Height*c_);
                ucOut.Location = new Point(3, 23 + ucOut.Height*c_);

                controlsIn.Add(ucIn);
                controlsOut.Add(ucOut);

                gbIn.Controls.Add(ucIn);
                gbOut.Controls.Add(ucOut);

                // add to combobox
                cbControl.Items.Add(((int) c).ToString() + ", " + c.ToString());
            }

            var a = 0;
            for (a = 0; a < 8;a++)
            {
                var uc = new ucJoystickChannel(true, a);
                uc.Location = new Point(3, 23 + uc.Height * a);

                joysticks.Add(uc);
                gbController.Controls.Add(uc);
            }

            for (int b = 0; b < 32; b++)
            {
                var uc = new ucJoystickChannel(false, b);
                uc.Location = new Point(3, 23 + uc.Height*(a + b));

                joysticks.Add(uc);
                gbController.Controls.Add(uc);
            }
        }