private void CrearMesas(int tamanioMesa, int anchoMesas, int altoMesas) { ButtonMesa btnMesa = iniObject.CreateButtonMesa(tamanioMesa, escalarPlano, anchoMesas, altoMesas); Controls.Add(btnMesa); btnMesa.Location = new Point((panelPisoPn.Width - btnMesa.Width) / 2, (panelPisoPn.Height - btnMesa.Height) / 2); btnMesa.Parent = panelPisoPn; btnMesa.Text = btnMesa.numeroMesa.ToString(); btnMesa.BackColor = pisoPb.BackColor; btnMesa.FlatAppearance.BorderColor = pisoPb.BackColor; buttonMesaList.Add(btnMesa); btnMesa.BringToFront(); }
/**Inicializamos el Plano con todos sus elementos (Mesas y adornos)**/ private void CargarPlanoIni() { //Inicializamos el piso (picturebox) PictureBox piso = iniObject.IniPisoPlano(0); Point point = new Point(GestionJson.sueloTestJson[0].locationx, GestionJson.sueloTestJson[0].locationy); piso.Parent = pisoPanel; piso.Location = point; piso.Show(); piso.BringToFront(); // Inicializamos Las mesas for (int i = 0; i < GestionJson.mesasJson.Count; i++) { ButtonMesa btnMesa = iniObject.IniMesasPlano(i); btnMesa.Parent = pisoPanel; Point point1 = new Point(GestionJson.mesasJson[i].locationx, GestionJson.mesasJson[i].locationy); btnMesa.Location = point1; simulacionListMesa.Add(btnMesa); btnMesa.BringToFront(); } //Inicializamos los adornos if (GestionJson.adornosJsonList.Count > 0) { for (int i = 0; i < GestionJson.adornosJsonList.Count; i++) { PictureAdornos adornoPic = iniObject.IniAdornos(i); adornoPic.Parent = pisoPanel; Point point1 = new Point(GestionJson.adornosJsonList[i].locationX, GestionJson.adornosJsonList[i].locationY); adornoPic.Location = point1; adornoPic.BackColor = piso.BackColor; adornoPic.BringToFront(); } } //Cargamos por memoria los Mozos al bindingsource for (int i = 0; i < DatosEstaticos.mozosList.Count; i++) { mozosBindingSource.Add(DatosEstaticos.mozosList[i]); } }