/// <summary> /// UI Setup /// </summary> /// <param name="N">Bimatrix game participants number</param> void UI_FirstSetup(int N) { //Alignment Database.G.N = N; progressBar1.Maximum = 120; label1.Text = "Генерирование биматричных игр (1/" + (Database.G.N * (Database.G.N - 1) / 2).ToString() + ")"; //Grid settings UI.TWDNGrid G = new UI.TWDNGrid(D, Database.G.N, Database.G.N); G.InitializeHeaders("Выигрыши", "Игрок", "Игрок"); G.InitializeGrid(); D.ReadOnly = true; D.ForeColor = Color.Black; D.Enabled = false; outerblocks.Add(AddHeader()); outerblocks.Add(AddMainContent()); ControlsAligner GP = new ControlsAligner(GenerationPanel); GP.AddElement(label1); GP.AddElement(progressBar1); blocks.Add(GP); outerblocks.Add(GP); AlignForm(); //Alignment statusStrip1.Hide(); BW = new BackgroundWorker(); BW.WorkerReportsProgress = true; BW.DoWork += new DoWorkEventHandler(FindCombination); BW.ProgressChanged += new ProgressChangedEventHandler(StepComplete); BW.RunWorkerCompleted += new RunWorkerCompletedEventHandler(UI_SecondSetup); BW.RunWorkerAsync(); }
/// <summary> /// Align form content /// </summary> protected void AlignForm() { //Align panels for the first time foreach (ControlsAligner b in blocks) b.Align(); //Align the outer blocks width and set WidthFixed = True outerblocks.Align(); //Align Form itself ControlsAligner form = new ControlsAligner(this); foreach (ControlsAligner b in outerblocks.blocks) form.AddElement(b.container); form.Align(); ////Re-align blocks content with the new sizes //foreach (ControlsAligner b in blocks) // b.Align(); }