コード例 #1
0
        public MatchDialog() : base()
        {
            userNameTextBox = new TextBox()
            {
                MaxLength = 10
            };
            blackButton = new RadioButton()
            {
                Text    = "Black",
                Checked = true,
                Height  = userNameTextBox.Height
            };
            whiteButton = new RadioButton()
            {
                Text   = "White",
                Height = userNameTextBox.Height
            };
            boardSizeUpDown = new NumericUpDown()
            {
                Minimum = 2,
                Maximum = 19,
                Value   = 19
            };
            timeUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 1000,
                Value   = 30
            };
            byouyomiUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 1000
            };

            foreach (var item in new Control[]
            {
                userNameTextBox, blackButton, whiteButton,
                boardSizeUpDown, timeUpDown, byouyomiUpDown
            })
            {
                Layout.Resize(item);
            }

            table = Layout.PropertyTable(
                Layout.Label("Player name:"), userNameTextBox,
                Layout.Label("Your color:"), blackButton,
                null, whiteButton,
                Layout.Label("Board size:"), boardSizeUpDown,
                Layout.Label("Base time:"), timeUpDown,
                Layout.Label("Byouyomi:"), byouyomiUpDown);

            Layout.Bind(table, this);
        }
コード例 #2
0
ファイル: GameView.cs プロジェクト: momoewang/igoenchi
        public GameInfoDialog(GameInfo info, bool editBoardSize)
        {
            if (editBoardSize)
            {
                boardSizeUpDown = new NumericUpDown()
                {
                    Minimum = 2,
                    Maximum = 19,
                    Value   = 19,
                };
            }

            whitePlayerTextBox = new TextBox()
            {
                Text = info.WhitePlayer
            };
            blackPlayerTextBox = new TextBox()
            {
                Text = info.BlackPlayer
            };
            handicapUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 100,
                Value   = info.Handicap,
            };
            komiTextBox = new TextBox()
            {
                Text = ConfigManager.FloatToString(info.Komi)
            };

            foreach (var item in new Control[]
            {
                boardSizeUpDown, whitePlayerTextBox, blackPlayerTextBox,
                handicapUpDown, komiTextBox
            })
            {
                Layout.Resize(item);
            }

            Layout.Bind(
                Layout.PropertyTable(
                    editBoardSize ? Layout.Label("Board size") : null,
                    boardSizeUpDown,
                    Layout.Label("White"), whitePlayerTextBox,
                    Layout.Label("Black"), blackPlayerTextBox,
                    Layout.Label("Handicap"), handicapUpDown,
                    Layout.Label("Komi"), komiTextBox),
                this);
        }
コード例 #3
0
        public AccountDialog(IGSAccount account) : base()
        {
            var hostTextBox = new TextBox()
            {
                Text = account.Server
            };
            var portUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = UInt16.MaxValue,
                Value   = account.Port
            };
            var nameTextBox = new TextBox()
            {
                MaxLength = 10,
                Text      = account.Name
            };
            var passwordTextBox = new TextBox()
            {
                PasswordChar = '*',
                Text         = account.Password
            };
            var savePasswordCheckBox = new CheckBox()
            {
                Text    = "Save Password (plaintext)?",
                Checked = account.PasswordSpecified
            };

            getAccount = () =>
                         new IGSAccount(hostTextBox.Text,
                                        Convert.ToInt32(portUpDown.Value),
                                        nameTextBox.Text,
                                        passwordTextBox.Text,
                                        savePasswordCheckBox.Checked);

            foreach (var item in new Control[] { hostTextBox, portUpDown, nameTextBox, passwordTextBox, savePasswordCheckBox })
            {
                Layout.Resize(item);
            }

            Layout.Bind(
                Layout.PropertyTable(
                    Layout.Label("Host:"), hostTextBox,
                    Layout.Label("Port:"), portUpDown,
                    Layout.Label("Name:"), nameTextBox,
                    Layout.Label("Password:"), passwordTextBox,
                    null, savePasswordCheckBox),
                this);
        }
コード例 #4
0
ファイル: SeekDialog.cs プロジェクト: momoewang/igoenchi
        public SeekDialog() : base()
        {
            boardSizeUpDown = new NumericUpDown()
            {
                Minimum = 2,
                Maximum = 19,
                Value   = 19
            };
            handicapUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 9,
                Value   = 0
            };
            foreach (var item in new Control[] { boardSizeUpDown, handicapUpDown })
            {
                Layout.Resize(item);
            }

            timeRadioButtons = Collection.ToArray(Collection.Map(
                                                      SeekRequest.TimeLabels,
                                                      s => new RadioButton()
            {
                Text   = s,
                Height = boardSizeUpDown.Height
            }));



            var table = new LayoutTable(timeRadioButtons.Length + 1, 1);

            table.Fill(timeRadioButtons);

            table.PutLayout(Layout.PropertyTable(
                                Layout.Label("Board size:"), boardSizeUpDown,
                                Layout.Label("Handicap:"), handicapUpDown),
                            timeRadioButtons.Length, 0);
            table.FixRows();

            Layout.Bind(table, this);
        }
コード例 #5
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);
        }
コード例 #6
0
ファイル: GnuGoDialog.cs プロジェクト: momoewang/igoenchi
        public GnuGoDialog(GnuGoSettings defaults, bool resume)
        {
            boardSizeUpDown = new NumericUpDown()
            {
                Minimum = 5,
                Maximum = 19,
                Value   = defaults.BoardSize,
                Enabled = !resume
            };

            handicapUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 9,
                Value   = defaults.Handicap,
                Enabled = !resume
            };

            komiTextBox = new TextBox()
            {
                Text    = ConfigManager.FloatToString(defaults.Komi),
                Enabled = !resume
            };

            gnugoLevel = new TrackBar()
            {
                Minimum = 0,
                Maximum = 10,
                Value   = defaults.Level
            };

            gnugoBlack = new RadioButton()
            {
                Text    = "Black",
                Checked = defaults.Color == GnuGoColor.Black
            };

            gnugoWhite = new RadioButton()
            {
                Text    = "White",
                Checked = defaults.Color == GnuGoColor.White
            };

            gnugoBoth = new RadioButton()
            {
                Text    = "Both",
                Checked = defaults.Color == GnuGoColor.Both
            };

            gnugoNone = new RadioButton()
            {
                Text    = "None",
                Checked = defaults.Color == GnuGoColor.None
            };

            foreach (var item in new Control[]
            {
                boardSizeUpDown, komiTextBox, handicapUpDown,
                gnugoLevel, gnugoBlack, gnugoWhite, gnugoBoth, gnugoNone
            })
            {
                Layout.Resize(item);
            }

            Layout.Bind(
                Layout.PropertyTable(
                    Layout.Label("Board size"), boardSizeUpDown,
                    Layout.Label("Handicap"), handicapUpDown,
                    Layout.Label("Komi"), komiTextBox,
                    Layout.Label("GNU Go Level"), gnugoLevel,
                    Layout.Label("GNU Go Plays"), gnugoBlack,
                    null, gnugoWhite,
                    null, gnugoBoth,
                    null, gnugoNone),
                this);
        }