Example #1
0
        private void AddAxle(JoystickAxle control, int idx)
        {
            var panel = new AxlePanel();

            panel.SetInfo(control, idx);
            AddPanel(panel);

            RegiseterLink(panel.GetLink());
        }
Example #2
0
        private void FillPanels(JoystickConfig joystickInfo)
        {
            foreach (var control in joystickInfo.Controls)
            {
                BaseControlPanel panel;

                if (control is JoystickAxle)
                {
                    panel = new AxlePanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is ButtonsCollection)
                {
                    panel = new ButtonsPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is HatSwitch)
                {
                    panel = new HatPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is LevelingBits)
                {
                    panel = new DummyPanel();
                    panel.FillFromJoyInfo(control);
                }
                else
                {
                    continue;
                }

                AddPanel(panel);
            }

            tbName.Text  = joystickInfo.Name;
            tbCName.Text = joystickInfo.Code;
        }
Example #3
0
        private void FillPanels(JoystickConfig joystickInfo)
        {
            foreach (var control in joystickInfo.Controls)
            {
                BaseControlPanel panel;

                if (control is JoystickAxle)
                {
                    panel = new AxlePanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is ButtonsCollection)
                {
                    panel = new ButtonsPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is HatSwitch)
                {
                    panel = new HatPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is LevelingBits)
                {
                    panel = new DummyPanel();
                    panel.FillFromJoyInfo(control);
                }
                else
                {
                    continue;
                }

                AddPanel(panel);
            }

            tbName.Text          = joystickInfo.Name;
            tbVendorProduct.Text = string.Format("{0:X4}:{1:X4}", joystickInfo.VendorID, joystickInfo.ProductID);
        }