Beispiel #1
0
        protected override void onSetup(Screen screen)
        {
            window.area.set(0, 200, 320, 180);
            content.views.clear();

            Layout referenceLayout = Layout.makeHorizontal();

            referenceLayout.views.add(optionToggle("ORB", false));
            referenceLayout.views.add(optionToggle("SUR", true));
            referenceLayout.views.add(optionToggle("TRG", false));

            referenceLayout.views.add(new Space());

            _yawOn = optionToggle("YAW", true);
            _pitchOn = optionToggle("PCH", true);
            _rollOn = optionToggle("RLL", true);

            referenceLayout.views.add(_yawOn);
            referenceLayout.views.add(_pitchOn);
            referenceLayout.views.add(_rollOn);

            active = false;

            _yaw = new AxisController("YAW", true);
            _pitch = new AxisController("PITCH", false);
            _roll = new AxisController("ROLL", true);

            content.views.add(referenceLayout);
            content.views.add(new Space(10));
            content.views.add(_yaw.view);
            content.views.add(new Space(10));
            content.views.add(_pitch.view);
            content.views.add(new Space(10));
            content.views.add(_roll.view);
            content.views.add(new Space(10));

            content.views.add(makeOptionsLayout());
        }
Beispiel #2
0
        private View makeOptionsLayout()
        {
            Layout optionsLayout = Layout.makeHorizontal();

            switchToggle = new Toggle("OFF", false);
            switchToggle.onSwitch = (t =>
                    {
                        if(active)
                            deactivate();
                        else
                            activate();
                    });

            optionsLayout.views.add(switchToggle);
            optionsLayout.views.add(new Space());
            optionsLayout.views.add(new Button("SIM"));

            return optionsLayout;
        }
Beispiel #3
0
        private Toggle optionToggle(string name, bool on)
        {
            Toggle ret = new Toggle(name, on);
            ret.area.width = 40;
            ret.style = Style.Button;

            return ret;
        }
Beispiel #4
0
            public ModuleSwitch(Layout layout, Module module)
            {
                _toggle = new Toggle(module.name, false);

                _toggle.onSwitch = (m =>
                        {
                            if(m.toggled)
                                module.show();
                            else
                                module.hide();
                        });

                layout.views.add(_toggle);
            }