Пример #1
0
        private void CrearAdornos(int altoAdorno, int anchoAdorno, int tipoAdorno)
        {
            PictureAdornos adornoPicture = iniObject.CreateAdornos(tipoAdorno, escalarPlano, anchoAdorno, altoAdorno);

            //adornoPicture.ContextMenuStrip = ContextMenuFijar;
            Controls.Add(adornoPicture);
            adornoPicture.Location  = new Point((panelPisoPn.Width - adornoPicture.Width) / 2, (panelPisoPn.Height - adornoPicture.Height) / 2);
            adornoPicture.Parent    = panelPisoPn;
            adornoPicture.BackColor = pisoPb.BackColor;
            adornosList.Add(adornoPicture);
            adornoPicture.BringToFront();
        }
Пример #2
0
        /**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]);
            }
        }