Exemple #1
0
        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);
        }
Exemple #2
0
        public NMatchDialog() : base()
        {
            userNameTextBox = new TextBox()
            {
                MaxLength = 10
            };
            blackButton = new RadioButton()
            {
                Text    = "Black",
                Checked = true,
                Height  = userNameTextBox.Height
            };
            whiteButton = new RadioButton()
            {
                Text   = "White",
                Height = userNameTextBox.Height
            };
            nigiriButton = new RadioButton()
            {
                Text   = "Nigiri",
                Height = userNameTextBox.Height
            };
            handicapUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 9,
                Value   = 0
            };
            boardSizeUpDown = new NumericUpDown()
            {
                Minimum = 2,
                Maximum = 19,
                Value   = 19
            };
            timeUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 15,
                Value   = 10
            };
            byouyomiTimeUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 60
            };
            byouyomiStonesUpDown = new NumericUpDown()
            {
                Minimum = 0,
                Maximum = 25,
                Value   = 25
            };

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

            table = Layout.PropertyTable(
                Layout.Label("Player name:"), userNameTextBox,
                Layout.Label("Your color:"), blackButton,
                null, whiteButton,
                null, nigiriButton,
                Layout.Label("Handicap:"), handicapUpDown,
                Layout.Label("Board size:"), boardSizeUpDown,
                Layout.Label("Base time:"), timeUpDown,
                Layout.Label("Byouyomi:"), byouyomiTimeUpDown,
                Layout.Label("Stones:"), byouyomiStonesUpDown);

            Layout.Bind(table, this);
        }