private static LayoutTable Table(int rows, int columns, Control[] controls) { var table = new LayoutTable(rows, columns); table.Fill(controls); table.FixRows(); return(table); }
public static LayoutTable PropertyTable(params Control[] controls) { var height = controls.Length / 2; var table = new LayoutTable(height, 2); table.Fill(controls); table.FixRows(); table.FixColumns(0); return(table); }
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); }
public MatchDialog(MatchRequest request, IgsPlayerInfo stats) : this(request) { if (Environment.OSVersion.Platform == PlatformID.WinCE) { userNameTextBox.Width = 0; var statsButton = new Button() { Text = "?", Height = userNameTextBox.Height, Width = userNameTextBox.Height }; var innerTable = new LayoutTable(1, 2); innerTable.Fill(userNameTextBox, statsButton); innerTable.FixRows(); innerTable.FixColumns(1); table.PutLayout(innerTable, 0, 1); table.Apply(this, this.ClientRectangle); statsButton.Click += delegate { notification.Visible = true; }; notification = new Notification() { Text = "<html><body><form method='GET' action='notify'><hr/>" + "Name: " + stats.Name + "<br/>Rank: " + stats.Rank.ToString() + "<br/>Wins/Losses: " + stats.GamesWon + "/" + stats.GamesLost + "<hr/></form></body></html>", Caption = "Stats of " + stats.Name, InitialDuration = 10, Icon = ConfigManager.GetIcon("game") }; } }