private void button1_Click(object sender, EventArgs e) { //Test button, creates forms using class names and coordinates. var GlitchHarvester = new CanvasGrid(6, 3); GlitchHarvester.SetTileForm("GH_SavestateManager", 0, 0); GlitchHarvester.SetTileForm("GH_Engine_Blast", 1, 0); GlitchHarvester.SetTileForm("GH_BlastManipulator", 2, 0); GlitchHarvester.SetTileForm("GH_BlastParameters", 1, 1); GlitchHarvester.SetTileForm("GH_StashHistory", 2, 1); GlitchHarvester.SetTileForm("GH_RenderOutput", 1, 2); GlitchHarvester.SetTileForm("GH_StockpileManager", 3, 0); var EngineForm = new CanvasGrid(4, 3); EngineForm.SetTileForm("GH_Engine_Intensity", 0, 0); EngineForm.SetTileForm("GH_Engine_MemoryDomains", 2, 1); var TestForm = new CanvasGrid(5, 4); TestForm.SetTileForm("GH_DummyTileForm3x1", 0, 0); TestForm.SetTileForm("GH_DummyTileForm2x1", 3, 2); TestForm.SetTileForm("GH_DummyTileForm2x2", 3, 0); TestForm.SetTileForm("GH_DummyTileForm1x1", 4, 3); TestForm.SetTileForm("GH_DummyTileForm3x3", 0, 1); var multiGrid = new MultiGrid( EngineForm, GlitchHarvester, TestForm ); multiGrid.Load(); }
public static void loadTileFormExtra(CanvasGrid canvasGrid) { GH_CanvasForm extraForm = new GH_CanvasForm(true); extraForm.Controls.Clear(); extraForms.Add(extraForm); extraForm.FormBorderStyle = FormBorderStyle.FixedSingle; extraForm.MaximizeBox = false; extraForm.Text = "RTC Extra Form"; loadTileForm(extraForm, canvasGrid); extraForm.Show(); }
public static void loadTileForm(GH_CanvasForm targetForm, CanvasGrid canvasGrid) { targetForm.ResizeCanvas(targetForm, canvasGrid); for (int x = 0; x < canvasGrid.x; x++) { for (int y = 0; y < canvasGrid.y; y++) { if (canvasGrid.grid[x, y] != null) { Form tileForm = getTileForm(canvasGrid.grid[x, y]); tileForm.TopLevel = false; targetForm.Controls.Add(tileForm); tileForm.Location = getTileLocation(x, y); tileForm.Show(); } } } }
public void ResizeCanvas(GH_CanvasForm targetForm, CanvasGrid canvasGrid) { this.SetSize(getTilePos(canvasGrid.x), getTilePos(canvasGrid.y)); }
public static void loadTileFormMain(CanvasGrid canvasGrid) { clearTileForms(); loadTileForm(thisForm, canvasGrid); }