示例#1
0
        public ToggleDialog(IGSToggleSettings settings) : base()
        {
            toggleBoxes = Collection.ToArray(Collection.Map(
                                                 toggleLabels, s => new CheckBox()
            {
                Text = s
            }));
            foreach (var item in toggleBoxes)
            {
                Layout.Resize(item);
            }

            toggleBoxes[0].Checked = settings.Open;
            toggleBoxes[1].Checked = settings.Looking;
            toggleBoxes[2].Checked = settings.Kibitz;

            Layout.Bind(Layout.Stack(toggleBoxes), this);
        }
示例#2
0
        private TabPage CreateNotificationPage()
        {
            friendsBox = new CheckBox()
            {
                Text    = "Friends' state changes",
                Checked = ConfigManager.Settings.FriendsNotify,
            };
            chatBox = new CheckBox()
            {
                Text    = "In-game chat messages arrive",
                Checked = ConfigManager.Settings.ChatNotify,
            };
            soundBox = new CheckBox()
            {
                Text    = "Enable",
                Checked = ConfigManager.Settings.Sound
            };

            foreach (var item in new [] { friendsBox, chatBox, soundBox })
            {
                Layout.Resize(item);
            }

            var notificationTable = Layout.Stack(
                Layout.Label("Notify when:"),
                friendsBox,
                chatBox,
                Layout.Label("Sound:"),
                soundBox);

            var page = new TabPage()
            {
                Text = "Notifications",
                Dock = DockStyle.Fill
            };

            Layout.Bind(notificationTable, page);
            return(page);
        }
示例#3
0
        private TabPage CreateButtonsPage()
        {
            bindings = Collection.ToArray(
                Collection.Range(4, () => new ComboBox()));
            var actions = HardwareButtonBindings.GetActions();
            var index   = 0;

            foreach (var item in bindings)
            {
                Layout.Resize(item);
                item.Items.Add("None");
                foreach (var name in actions)
                {
                    item.Items.Add(name);
                }
                var selected = HardwareButtonBindings.GetBinding(HardwareButtonBindings.Buttons[index]);
                item.SelectedItem =
                    (selected != string.Empty && item.Items.Contains(selected)) ?
                    selected : "None";
                index += 1;
            }

            var buttonsTable = Layout.Stack(
                Layout.Label("Hardware button 1"), bindings[0],
                Layout.Label("Hardware button 2"), bindings[1],
                Layout.Label("Hardware button 3"), bindings[2],
                Layout.Label("Hardware button 4"), bindings[3]);

            var page = new TabPage()
            {
                Text = "Buttons",
                Dock = DockStyle.Fill
            };

            Layout.Bind(buttonsTable, page);
            return(page);
        }
示例#4
0
        private TabPage CreateDisplayPage()
        {
            fontBox = new ComboBox();
            GetFonts(fontBox);

            encodingBox = new ComboBox();
            GetEncodings(encodingBox);

            gdiButton = new RadioButton()
            {
                Text    = "GDI",
                Checked = ConfigManager.Settings.Renderer == RendererType.GDI,
            };
            direct3DButton = new RadioButton()
            {
                Text    = "Direct3D",
                Checked = ConfigManager.Settings.Renderer == RendererType.Direct3D,
            };

            textureBox = new CheckBox()
            {
                Text    = "No textures (GDI only)",
                Checked = ConfigManager.Settings.NoTextures
            };

            cursorBox = new CheckBox()
            {
                Text    = "Keep cursor on board",
                Checked = ConfigManager.Settings.KeepCursor
            };

            moveMarkBox = new CheckBox()
            {
                Text    = "Use old last move mark",
                Checked = ConfigManager.Settings.OldMark
            };

            foreach (var item in new Control[] {
                fontBox, encodingBox, gdiButton, direct3DButton,
                cursorBox, moveMarkBox, textureBox
            })
            {
                Layout.Resize(item);
            }

            var displayTable = Layout.Stack(null, cursorBox, moveMarkBox, textureBox);

            displayTable.PutLayout(
                Layout.PropertyTable(
                    Layout.Label("Font:"), fontBox,
                    Layout.Label("Encoding:"), encodingBox,
                    Layout.Label("Renderer:"), gdiButton,
                    null, direct3DButton),
                0, 0);

            var page = new TabPage()
            {
                Text = "Display",
                Dock = DockStyle.Fill
            };

            Layout.Bind(displayTable, page);
            return(page);
        }