private void CreateToolOptions() { foreach (var enumOption in Enum.GetValues(typeof(ToolType)).Cast <ToolType>()) { var button = new Button(ControlManager.Manager) { Text = enumOption.ToString(), Left = Padding, Top = ToolOptionsY, Parent = _sideBar, Width = _sideBar.Width - Padding * 2 }; var enumType = enumOption; button.Click += (sender, args) => SetTool(enumType); button.Init(); _sideBar.Add(button); ToolOptionsY += button.Height + Padding; } var back = new Button(ControlManager.Manager) { Text = "Return to Menu", Top = ScreenHeight - Padding * 2, Left = Padding, Parent = _sideBar, Width = _sideBar.Width - Padding * 2 }; back.Init(); back.Text = "Back to previous screen"; back.Click += (sender, args) => ScreenManager.SwapScreens(this, Constants.ScreenNames.WorldEditorSetup); _sideBar.Add(back); }
/// <summary> /// Create GUI /// </summary> public void Create() { // information bar inforbar = new SideBar(manager); inforbar.Init(); inforbar.Height = 30; inforbar.Width = 800; lbDEBUGMODE = new Label(manager); lbDEBUGMODE.Init(); lbDEBUGMODE.Text = "Gadget Editor : " + playerinfo.player.DEBUGMODE.ToString(); lbDEBUGMODE.Top = 5; lbDEBUGMODE.Left = 5; lbDEBUGMODE.TextColor = Color.White; lbDEBUGMODE.Width = 150; lbWaring = new Label(manager); lbWaring.Init(); lbWaring.Text = ""; lbWaring.Top = 5; lbWaring.Left = 170; lbWaring.TextColor = Color.Blue; lbWaring.Width = 620; inforbar.Add(lbWaring); inforbar.Add(lbDEBUGMODE); // bottom bar bar = new SideBar(manager); bar.Init(); bar.Top = 380; bar.Height = 100; bar.Width = 800; // debug setting panel Panel panel1 = new Panel(manager); panel1.Init(); panel1.Top = 10; panel1.Left = 10; panel1.Width = 75; panel1.Height = 80; panel1.BevelBorder = BevelBorder.All; panel1.BevelStyle = BevelStyle.Bumped; panel1.BevelColor = Color.White; Button btnDebug = new Button(manager); btnDebug.Init(); btnDebug.Text = "Gadget"; btnDebug.Top = 5; // this is in pixels, top-left is the origin btnDebug.Left = 5; btnDebug.Width = 60; btnDebug.Height = 20; btnDebug.Click += new EventHandler(btnDebug_Click); panel1.Add(btnDebug); bar.Add(panel1); panel2 = new Panel(manager); panel2.Init(); panel2.Top = 10; panel2.Left = 100; panel2.Width = 100; panel2.Height = 80; panel2.BevelBorder = BevelBorder.All; panel2.BevelStyle = BevelStyle.Bumped; panel2.BevelColor = Color.White; panel2.Visible = false; lbselectgadget = new Label(manager); lbselectgadget.Init(); lbselectgadget.Text = "Select Gadget"; lbselectgadget.Top = 5; lbselectgadget.Left = 5; lbselectgadget.TextColor = Color.White; lbselectgadget.Width = 100; listgadget = new ListBox(manager); listgadget.Init(); listgadget.Top = 25; listgadget.Width = 100; listgadget.Height = 55; listgadget.ItemIndexChanged += new EventHandler(listgadget_ItemIndexChanged); panel2.Add(listgadget); panel2.Add(lbselectgadget); bar.Add(panel2); panel3 = new Panel(manager); panel3.Init(); panel3.Top = 10; panel3.Left = 210; panel3.Width = 100; panel3.Height = 80; panel3.BevelBorder = BevelBorder.All; panel3.BevelStyle = BevelStyle.Bumped; panel3.BevelColor = Color.White; panel3.Visible = false; lbselectaction = new Label(manager); lbselectaction.Init(); lbselectaction.Text = "Select Action"; lbselectaction.Top = 5; lbselectaction.Left = 5; lbselectaction.TextColor = Color.White; lbselectaction.Width = 100; listaction = new ListBox(manager); listaction.Init(); listaction.Top = 25; listaction.Width = 100; listaction.Height = 55; listaction.ItemIndexChanged += new EventHandler(listaction_ItemIndexChanged); panel3.Add(listaction); panel3.Add(lbselectaction); bar.Add(panel3); panel4 = new Panel(manager); panel4.Init(); panel4.Top = 10; panel4.Left = 320; panel4.Width = 255; panel4.Height = 80; panel4.BevelBorder = BevelBorder.All; panel4.BevelStyle = BevelStyle.Bumped; panel4.BevelColor = Color.White; panel4.Visible = false; Button btnper = new Button(manager); btnper.Init(); btnper.Text = "<"; btnper.Top = 5; // this is in pixels, top-left is the origin btnper.Left = 5; btnper.Width = 20; btnper.Height = 20; btnper.Click += new EventHandler(btnper_Click); Button btnnext = new Button(manager); btnnext.Init(); btnnext.Text = ">"; btnnext.Top = 5; // this is in pixels, top-left is the origin btnnext.Left = 30; btnnext.Width = 20; btnnext.Height = 20; btnnext.Click += new EventHandler(btnnext_Click); Button btnper1 = new Button(manager); btnper1.Init(); btnper1.Text = "<"; btnper1.Top = 55; // this is in pixels, top-left is the origin btnper1.Left = 160; btnper1.Width = 20; btnper1.Height = 20; btnper1.Click += new EventHandler(btnper1_Click); Button btnnext1 = new Button(manager); btnnext1.Init(); btnnext1.Text = ">"; btnnext1.Top = 55; // this is in pixels, top-left is the origin btnnext1.Left = 225; btnnext1.Width = 20; btnnext1.Height = 20; btnnext1.Click += new EventHandler(btnnext1_Click); Label lnface1 = new Label(manager); lnface1.Init(); lnface1.Text = "Set Face"; lnface1.Top = 30; lnface1.Left = 170; lnface1.TextColor = Color.White; lnface1.Width = 220; lnface = new Label(manager); lnface.Init(); lnface.Text = playerinfo.player.Facing; lnface.Top = 55; lnface.Left = 185; lnface.TextColor = Color.White; lnface.Width = 220; lntexturepostion = new Label(manager); lntexturepostion.Init(); lntexturepostion.Text = "Texture position is : " + playerinfo.player.texture_position.ToString(); lntexturepostion.Top = 5; lntexturepostion.Left = 55; lntexturepostion.TextColor = Color.White; lntexturepostion.Width = 220; Button btnSave = new Button(manager); btnSave.Init(); btnSave.Text = "Save this position"; btnSave.Top = 30; // this is in pixels, top-left is the origin btnSave.Left = 5; btnSave.Width = 150; btnSave.Height = 20; btnSave.Click += new EventHandler(btnSave_Click); Button btnExport = new Button(manager); btnExport.Init(); btnExport.Text = "Export XML"; btnExport.Top = 55; // this is in pixels, top-left is the origin btnExport.Left = 5; btnExport.Width = 150; btnExport.Height = 20; btnExport.Click += new EventHandler(btnExport_Click); panel4.Add(btnper1); panel4.Add(btnnext1); panel4.Add(lnface); panel4.Add(lnface1); panel4.Add(lntexturepostion); panel4.Add(btnper); panel4.Add(btnnext); panel4.Add(btnSave); panel4.Add(btnExport); bar.Add(panel4); manager.Add(bar); manager.Add(inforbar); bar.Visible = false; inforbar.Visible = false; }
/// <summary> /// Initializes UI elements /// </summary> private void InitControls() { //Map MapControl = new MapWindow(Manager); MapControl.Init(); MapControl.SetPosition(201, 0); MapControl.Environment = Environment; MapControl.Renderer = Renderers[0]; MapControl.SetSize(Height, Height); MapControl.Resizable = true; MapControl.Movable = true; Add(MapControl); //Left side bar SideBar = new SideBar(Manager); SideBar.Init(); SideBar.StayOnBack = true; SideBar.Passive = true; SideBar.SetSize(200, Height); SideBar.Anchor = Anchors.Left | Anchors.Top | Anchors.Bottom; Add(SideBar); NewMapBtn = new Button(Manager); NewMapBtn.Init(); NewMapBtn.Text = "New Map"; NewMapBtn.SetPosition(25, 10); NewMapBtn.SetSize(150, 25); NewMapBtn.Anchor = Anchors.Top | Anchors.Left; NewMapBtn.Click += new EventHandler(NewMapBtn_Click); SideBar.Add(NewMapBtn); SelectMapBtn = new Button(Manager); SelectMapBtn.Init(); SelectMapBtn.Text = "Select Map"; SelectMapBtn.Click += new EventHandler(selectMapBtn_Click); SelectMapBtn.SetPosition(25, 40); SelectMapBtn.SetSize(150, 25); SelectMapBtn.Anchor = Anchors.Top | Anchors.Left; SideBar.Add(SelectMapBtn); DoOneStepBtn = new Button(Manager); DoOneStepBtn.Init(); DoOneStepBtn.Text = "Do One Step"; DoOneStepBtn.SetPosition(25, 90); DoOneStepBtn.SetSize(150, 25); DoOneStepBtn.Anchor = Anchors.Top | Anchors.Left; DoOneStepBtn.Click += new EventHandler(DoOneStepBtn_Click); SideBar.Add(DoOneStepBtn); DoOneRunBtn = new Button(Manager); DoOneRunBtn.Init(); DoOneRunBtn.Text = "Do One Run"; DoOneRunBtn.SetPosition(25, 120); DoOneRunBtn.SetSize(150, 25); DoOneRunBtn.Anchor = Anchors.Top | Anchors.Left; DoOneRunBtn.Click += new EventHandler(DoOneRunBtn_Click); SideBar.Add(DoOneRunBtn); NextRunBtn = new Button(Manager); NextRunBtn.Init(); NextRunBtn.Text = "Next Run"; NextRunBtn.SetPosition(25, 150); NextRunBtn.SetSize(150, 25); NextRunBtn.Anchor = Anchors.Top | Anchors.Left; NextRunBtn.Click += new EventHandler(NextRunBtn_Click); SideBar.Add(NextRunBtn); DoAllRunBtn = new Button(Manager); DoAllRunBtn.Init(); DoAllRunBtn.Text = "Do All Run"; DoAllRunBtn.SetPosition(25, 180); DoAllRunBtn.SetSize(150, 25); DoAllRunBtn.Anchor = Anchors.Top | Anchors.Left; DoAllRunBtn.Click += new EventHandler(DoAllRunBtn_Click); SideBar.Add(DoAllRunBtn); GrpBox = new GroupBox(Manager); GrpBox.Init(); GrpBox.SetSize(SideBar.Width - 30, 135); GrpBox.SetPosition(5, 220); GrpBox.ClientWidth = 180; GrpBox.Text = "Display Options"; GrpBox.TextColor = Color.Wheat; SideBar.Add(GrpBox); Label stepsLbl = new Label(Manager); stepsLbl.Init(); stepsLbl.Text = "Steps:"; stepsLbl.SetPosition(5, 25); GrpBox.Add(stepsLbl); StepsTxt = new TextBox(Manager); StepsTxt.Init(); StepsTxt.Text = "100"; StepsTxt.SetSize(100, 25); StepsTxt.SetPosition(5 + stepsLbl.Width, 20); StepsTxt.TextColor = Color.WhiteSmoke; StepsTxt.TextChanged += new EventHandler(TimeTxt_TextChanged); GrpBox.Add(StepsTxt); Label timeLbl = new Label(Manager); timeLbl.Init(); timeLbl.Text = "Time:"; timeLbl.SetPosition(5, 60); GrpBox.Add(timeLbl); TimeTxt = new TextBox(Manager); TimeTxt.Init(); TimeTxt.Text = "20"; TimeTxt.SetSize(100, 25); TimeTxt.SetPosition(5 + stepsLbl.Width, 55); TimeTxt.TextChanged += new EventHandler(TimeTxt_TextChanged); TimeTxt.TextColor = Color.WhiteSmoke; GrpBox.Add(TimeTxt); DisplayBtn = new Button(Manager); DisplayBtn.Init(); DisplayBtn.Text = "Display"; DisplayBtn.Click += new EventHandler(displayBtn_Click); DisplayBtn.SetSize(120, 25); DisplayBtn.SetPosition(50, 90); GrpBox.Add(DisplayBtn); Label rendererLbl = new Label(Manager); rendererLbl.Init(); rendererLbl.Text = "Renderer:"; rendererLbl.SetPosition(25, 360); Add(rendererLbl); RenderersComboBox = new ComboBox(Manager); RenderersComboBox.Init(); RenderersComboBox.SetPosition(25, 385); RenderersComboBox.Width = 150; RenderersComboBox.TextColor = Color.Wheat; RenderersComboBox.Items.AddRange(Renderers); RenderersComboBox.ItemIndex = 0; RenderersComboBox.TextChanged += new EventHandler(RenderersComboBox_TextChanged); Add(RenderersComboBox); Button makeFullScreenBtn = new Button(Manager); makeFullScreenBtn.Init(); makeFullScreenBtn.Text = "Fullscreen"; makeFullScreenBtn.SetPosition(25, 475); makeFullScreenBtn.SetSize(150, 25); makeFullScreenBtn.Click += new EventHandler(makeFullScreenBtn_Click); makeFullScreenBtn.Anchor = Anchors.Top | Anchors.Left; SideBar.Add(makeFullScreenBtn); Button exitBtn = new Button(Manager); exitBtn.Init(); exitBtn.Text = "Quit"; exitBtn.SetPosition(25, 510); exitBtn.SetSize(150, 25); exitBtn.Click += new EventHandler(exitBtn_Click); exitBtn.Anchor = Anchors.Top | Anchors.Left; SideBar.Add(exitBtn); ExitDlg = new ExitDialog(Manager); ExitDlg.Init(); ExitDlg.Closed += new WindowClosedEventHandler(ExitDlg_Closed); Manager.Add(ExitDlg); ExitDlg.Hide(); //Right side bar SideBarRight = new SideBar(Manager); SideBarRight.Init(); SideBarRight.StayOnBack = true; SideBarRight.Resizable = true; SideBarRight.ResizeEdge = Anchors.Left; SideBarRight.SetSize(200, Height); SideBarRight.SetPosition(Width - SideBarRight.Width, 0); SideBarRight.Anchor = Anchors.Right | Anchors.Top | Anchors.Bottom; Add(SideBarRight); GroupBox runParamsGrpBox = new GroupBox(Manager); runParamsGrpBox.Init(); runParamsGrpBox.SetSize(SideBarRight.Width - 30, 155); runParamsGrpBox.SetPosition(5, 10); runParamsGrpBox.ClientWidth = 38; runParamsGrpBox.Text = "Run Statistics"; runParamsGrpBox.TextColor = Color.Wheat; runParamsGrpBox.Anchor = Anchors.Left | Anchors.Right | Anchors.Top; SideBarRight.Add(runParamsGrpBox); Label runLbl1 = new Label(Manager); runLbl1.Init(); runLbl1.Text = "Run:"; runLbl1.SetPosition(10, 20); runLbl1.Width = 120; runParamsGrpBox.Add(runLbl1); Label runLbl2 = new Label(Manager); runLbl2.Init(); runLbl2.Text = "0"; runLbl2.SetPosition(runLbl1.Left + runLbl1.Width + 10, 20); runParamsGrpBox.Add(runLbl2); RunStatsLbls.Add(runLbl2); Label timeStepLbl1 = new Label(Manager); timeStepLbl1.Init(); timeStepLbl1.Text = "Time step:"; timeStepLbl1.SetPosition(10, 35); timeStepLbl1.Width = 120; runParamsGrpBox.Add(timeStepLbl1); Label timeStepLbl2 = new Label(Manager); timeStepLbl2.Init(); timeStepLbl2.Text = "0"; timeStepLbl2.SetPosition(timeStepLbl1.Left + timeStepLbl1.Width + 10, 35); runParamsGrpBox.Add(timeStepLbl2); RunStatsLbls.Add(timeStepLbl2); Label actionLbl1 = new Label(Manager); actionLbl1.Init(); actionLbl1.Text = "Action:"; actionLbl1.SetPosition(10, 60); actionLbl1.Width = 120; runParamsGrpBox.Add(actionLbl1); Label actionLbl2 = new Label(Manager); actionLbl2.Init(); actionLbl2.Text = "0"; actionLbl2.SetPosition(actionLbl1.Left + actionLbl1.Width + 10, 60); runParamsGrpBox.Add(actionLbl2); RunStatsLbls.Add(actionLbl2); Label dirtyOnMapLbl1 = new Label(Manager); dirtyOnMapLbl1.Init(); dirtyOnMapLbl1.Text = "Dirty on map:"; dirtyOnMapLbl1.SetPosition(10, 85); dirtyOnMapLbl1.Width = 120; runParamsGrpBox.Add(dirtyOnMapLbl1); Label dirtyOnMapLbl2 = new Label(Manager); dirtyOnMapLbl2.Init(); dirtyOnMapLbl2.Text = "0"; dirtyOnMapLbl2.SetPosition(dirtyOnMapLbl1.Left + dirtyOnMapLbl1.Width + 10, 85); runParamsGrpBox.Add(dirtyOnMapLbl2); RunStatsLbls.Add(dirtyOnMapLbl2); Label overAllDirtyLbl1 = new Label(Manager); overAllDirtyLbl1.Init(); overAllDirtyLbl1.Text = "Overall dirty:"; overAllDirtyLbl1.SetPosition(10, 100); overAllDirtyLbl1.Width = 120; runParamsGrpBox.Add(overAllDirtyLbl1); Label overAllDirtyLbl2 = new Label(Manager); overAllDirtyLbl2.Init(); overAllDirtyLbl2.Text = "0"; overAllDirtyLbl2.SetPosition(overAllDirtyLbl1.Left + overAllDirtyLbl1.Width + 10, 100); runParamsGrpBox.Add(overAllDirtyLbl2); RunStatsLbls.Add(overAllDirtyLbl2); Label cleanedDirtyLbl1 = new Label(Manager); cleanedDirtyLbl1.Init(); cleanedDirtyLbl1.Text = "Cleaned dirty:"; cleanedDirtyLbl1.SetPosition(10, 115); cleanedDirtyLbl1.Width = 120; runParamsGrpBox.Add(cleanedDirtyLbl1); Label cleanedDirtyLbl2 = new Label(Manager); cleanedDirtyLbl2.Init(); cleanedDirtyLbl2.Text = "0"; cleanedDirtyLbl2.SetPosition(cleanedDirtyLbl1.Left + cleanedDirtyLbl1.Width + 10, 115); runParamsGrpBox.Add(cleanedDirtyLbl2); RunStatsLbls.Add(cleanedDirtyLbl2); Label consumedEnergyLbl1 = new Label(Manager); consumedEnergyLbl1.Init(); consumedEnergyLbl1.Text = "Consumed energy:"; consumedEnergyLbl1.SetPosition(10, 130); consumedEnergyLbl1.Width = 120; runParamsGrpBox.Add(consumedEnergyLbl1); Label consumedEnergyLbl2 = new Label(Manager); consumedEnergyLbl2.Init(); consumedEnergyLbl2.Text = "0"; consumedEnergyLbl2.SetPosition(consumedEnergyLbl1.Left + consumedEnergyLbl1.Width + 10, 130); runParamsGrpBox.Add(consumedEnergyLbl2); RunStatsLbls.Add(consumedEnergyLbl2); //// GroupBox totalParamsGrpBox = new GroupBox(Manager); totalParamsGrpBox.Init(); totalParamsGrpBox.SetSize(SideBarRight.Width - 30, 215); totalParamsGrpBox.SetPosition(5, runParamsGrpBox.Top + runParamsGrpBox.Height + 10); totalParamsGrpBox.ClientWidth = 38; totalParamsGrpBox.Text = "Total Statistics"; totalParamsGrpBox.TextColor = Color.Wheat; totalParamsGrpBox.Anchor = Anchors.Left | Anchors.Right | Anchors.Top; SideBarRight.Add(totalParamsGrpBox); Label completedRunsLbl1 = new Label(Manager); completedRunsLbl1.Init(); completedRunsLbl1.Text = "Completed Runs:"; completedRunsLbl1.SetPosition(10, 20); completedRunsLbl1.Width = 120; totalParamsGrpBox.Add(completedRunsLbl1); Label completedRunsLbl2 = new Label(Manager); completedRunsLbl2.Init(); completedRunsLbl2.Text = "0"; completedRunsLbl2.SetPosition(completedRunsLbl1.Left + completedRunsLbl1.Width + 10, 20); totalParamsGrpBox.Add(completedRunsLbl2); TotalStatsLbls.Add(completedRunsLbl2); Label totalDirtyLbl1 = new Label(Manager); totalDirtyLbl1.Init(); totalDirtyLbl1.Text = "Total dirty degree:"; totalDirtyLbl1.SetPosition(10, 35); totalDirtyLbl1.Width = 120; totalParamsGrpBox.Add(totalDirtyLbl1); Label totalDirtyLbl2 = new Label(Manager); totalDirtyLbl2.Init(); totalDirtyLbl2.Text = "0"; totalDirtyLbl2.SetPosition(totalDirtyLbl1.Left + totalDirtyLbl1.Width + 10, 35); totalParamsGrpBox.Add(totalDirtyLbl2); TotalStatsLbls.Add(totalDirtyLbl2); Label totalCleanedLbl1 = new Label(Manager); totalCleanedLbl1.Init(); totalCleanedLbl1.Text = "Total cleaned dirty:"; totalCleanedLbl1.SetPosition(10, 60); totalCleanedLbl1.Width = 120; totalParamsGrpBox.Add(totalCleanedLbl1); Label totalCleanedLbl2 = new Label(Manager); totalCleanedLbl2.Init(); totalCleanedLbl2.Text = "0"; totalCleanedLbl2.SetPosition(totalCleanedLbl1.Left + totalCleanedLbl1.Width + 10, 60); totalParamsGrpBox.Add(totalCleanedLbl2); TotalStatsLbls.Add(totalCleanedLbl2); Label totalConsumedLbl1 = new Label(Manager); totalConsumedLbl1.Init(); totalConsumedLbl1.Text = "Total consumed\nenergy:"; totalConsumedLbl1.SetPosition(10, 85); totalConsumedLbl1.SetSize(120, 30); totalParamsGrpBox.Add(totalConsumedLbl1); Label totalConsumedLbl2 = new Label(Manager); totalConsumedLbl2.Init(); totalConsumedLbl2.Text = "0"; totalConsumedLbl2.SetPosition(totalConsumedLbl1.Left + totalConsumedLbl1.Width + 10, 85); totalParamsGrpBox.Add(totalConsumedLbl2); TotalStatsLbls.Add(totalConsumedLbl2); Label avarageDirtyLbl1 = new Label(Manager); avarageDirtyLbl1.Init(); avarageDirtyLbl1.Text = "Average dirty\ndegree:"; avarageDirtyLbl1.SetPosition(10, 115); avarageDirtyLbl1.SetSize(120, 30); totalParamsGrpBox.Add(avarageDirtyLbl1); Label avarageDirtyLbl2 = new Label(Manager); avarageDirtyLbl2.Init(); avarageDirtyLbl2.Text = "0"; avarageDirtyLbl2.SetPosition(avarageDirtyLbl1.Left + avarageDirtyLbl1.Width + 10, 115); totalParamsGrpBox.Add(avarageDirtyLbl2); TotalStatsLbls.Add(avarageDirtyLbl2); Label avarageCleanedLbl1 = new Label(Manager); avarageCleanedLbl1.Init(); avarageCleanedLbl1.Text = "Average cleaned\ndirty:"; avarageCleanedLbl1.SetPosition(10, 145); avarageCleanedLbl1.SetSize(120, 30); totalParamsGrpBox.Add(avarageCleanedLbl1); Label avarageCleanedLbl2 = new Label(Manager); avarageCleanedLbl2.Init(); avarageCleanedLbl2.Text = "0"; avarageCleanedLbl2.SetPosition(avarageCleanedLbl1.Left + avarageCleanedLbl1.Width + 10, 145); totalParamsGrpBox.Add(avarageCleanedLbl2); TotalStatsLbls.Add(avarageCleanedLbl2); Label avarageConsumedLbl1 = new Label(Manager); avarageConsumedLbl1.Init(); avarageConsumedLbl1.Text = "Average consumed\nenergy:"; avarageConsumedLbl1.SetPosition(10, 175); avarageConsumedLbl1.Width = 120; avarageConsumedLbl1.Height = 30; totalParamsGrpBox.Add(avarageConsumedLbl1); Label avarageConsumedLbl2 = new Label(Manager); avarageConsumedLbl2.Init(); avarageConsumedLbl2.Text = "0"; avarageConsumedLbl2.SetPosition(avarageConsumedLbl1.Left + avarageConsumedLbl1.Width + 10, 175); totalParamsGrpBox.Add(avarageConsumedLbl2); TotalStatsLbls.Add(avarageConsumedLbl2); ///// //Select map OpenFileDialog = new Dialog(Manager); OpenFileDialog.Init(); OpenFileDialog.Text = "Select map file"; OpenFileDialog.Description.Visible = false; OpenFileDialog.Caption.Text = ""; OpenFileDialog.Width = 600; OpenFileDialog.Resize += new ResizeEventHandler(OpenFileDialog_Resize); Manager.Add(OpenFileDialog); OpenFileDialog.Hide(); FilesList = new ListBox(Manager); FilesList.Init(); FilesList.Tag = System.Environment.CurrentDirectory; FilesList.SetPosition(0, 40); FilesList.ClientWidth = OpenFileDialog.Width - 15; FilesList.ClientHeight = OpenFileDialog.ClientHeight - 40; FilesList.TextColor = Color.Wheat; FilesList.DoubleClick += new EventHandler(FilesList_DoubleClick); GetFilesAndFolders(); OpenFileDialog.Add(FilesList); LifeTimeLbl = new Label(Manager); LifeTimeLbl.Init(); LifeTimeLbl.Text = "Life Time:"; LifeTimeLbl.SetPosition(5, 10); OpenFileDialog.Add(LifeTimeLbl); LifeTimeTxt = new TextBox(Manager); LifeTimeTxt.Init(); LifeTimeTxt.Text = "2000"; LifeTimeTxt.SetSize(100, 25); LifeTimeTxt.SetPosition(5 + stepsLbl.Width, 5); LifeTimeTxt.TextColor = Color.WhiteSmoke; LifeTimeTxt.TextChanged += new EventHandler(TimeTxt_TextChanged); OpenFileDialog.Add(LifeTimeTxt); TestCaseLbl = new Label(Manager); TestCaseLbl.Init(); TestCaseLbl.Text = "Test Case:"; TestCaseLbl.SetPosition(LifeTimeTxt.Left + LifeTimeTxt.Width + 5, 10); OpenFileDialog.Add(TestCaseLbl); TestCaseTxt = new TextBox(Manager); TestCaseTxt.Init(); TestCaseTxt.Text = "10"; TestCaseTxt.SetSize(100, 25); TestCaseTxt.SetPosition(TestCaseLbl.Left + TestCaseLbl.Width + 5, 5); TestCaseTxt.TextColor = Color.WhiteSmoke; TestCaseTxt.TextChanged += new EventHandler(TimeTxt_TextChanged); OpenFileDialog.Add(TestCaseTxt); AgentLbl = new Label(Manager); AgentLbl.Init(); AgentLbl.Text = "Agent:"; AgentLbl.SetPosition(TestCaseTxt.Left + TestCaseTxt.Width + 5, 10); OpenFileDialog.Add(AgentLbl); AgentsComboBox = new ComboBox(Manager); AgentsComboBox.Init(); AgentsComboBox.SetPosition(AgentLbl.Left + AgentLbl.Width - 10, 5); AgentsComboBox.Width = 150; AgentsComboBox.Height = 25; AgentsComboBox.TextColor = Color.Wheat; AgentsComboBox.Items.Add("RandomAgent"); AgentsComboBox.Items.Add("ModelAgent"); AgentsComboBox.Items.Add("ModelAgentNoIdle"); AgentsComboBox.ItemIndex = 0; OpenFileDialog.Add(AgentsComboBox); NewGameDialog = new Dialog(Manager); NewGameDialog.Init(); NewGameDialog.Text = "Start new tests"; NewGameDialog.Description.Visible = false; NewGameDialog.BottomPanel.Visible = false; NewGameDialog.Caption.Text = ""; NewGameDialog.Width = 600; NewGameDialog.Height = 130; NewGameDialog.TopPanel.Height = 100; Manager.Add(NewGameDialog); NewGameDialog.Hide(); Button newGameOk = new Button(Manager); newGameOk.Init(); newGameOk.SetPosition(20, 50); newGameOk.Text = "Confirm"; newGameOk.Click += new EventHandler(newGameOk_Click); NewGameDialog.Add(newGameOk); EnableDisableMapControls(false); }