public CanvasForm(bool extraForm = false) { InitializeComponent(); if (!extraForm) { thisForm = this; spacerSize = pnScale.Location.X; tileSize = pnScale.Size.Width; Controls.Remove(pnScale); } }
public static void loadTileFormExtraWindow(CanvasGrid canvasGrid, string WindowHeader = "RTC Extra Form") { CanvasForm extraForm = new CanvasForm(true); extraForm.Controls.Clear(); extraForms.Add(extraForm); extraForm.FormBorderStyle = FormBorderStyle.FixedSingle; extraForm.MaximizeBox = false; extraForm.Text = WindowHeader; loadTileForm(extraForm, canvasGrid); extraForm.Show(); }
public ShadowPanel(CanvasForm _parentForm, string _type) { InitializeComponent(); parentForm = _parentForm; UpdateBackground(); if (_type != null) { var subFormType = Type.GetType("RTCV.UI." + _type); //remove that and replace with componentform loader subForm = (Form)Activator.CreateInstance(subFormType); } UpdateSubForm(); }
public void Load() { //Deploys and loads all the grids in the multigrid object for (int i = 0; i < grids.Count(); i++) { if (i == 0) { CanvasForm.loadTileFormMain(grids[i]); } else { CanvasForm.loadTileFormExtraWindow(grids[i]); } } }
public static void loadTileForm(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.gridComponent[x, y] != null) { targetForm.Text = canvasGrid.GridName; bool DisplayHeader = (canvasGrid.gridComponentDisplayHeader[x, y].HasValue ? canvasGrid.gridComponentDisplayHeader[x, y].Value : false); var size = canvasGrid.gridComponentSize[x, y]; ComponentFormTile tileForm = getTileForm(canvasGrid.gridComponent[x, y], size?.Width, size?.Height, DisplayHeader); tileForm.TopLevel = false; targetForm.Controls.Add(tileForm); tileForm.Location = getTileLocation(x, y); tileForm.Show(); } } } }
internal void LoadToNewWindow() { CanvasForm.loadTileFormExtraWindow(this); }
internal void LoadToMain() { CanvasForm.loadTileFormMain(this); }
public void ResizeCanvas(CanvasForm targetForm, CanvasGrid canvasGrid) { this.SetSize(getTilePos(canvasGrid.x), getTilePos(canvasGrid.y)); }