Ejemplo n.º 1
0
 public CrewPantalla(IconButton boton, CrewPantalla padre, Panel panel, Color color, Form formulario, BTNtipo tipo)
 {
     Boton      = boton;
     Padre      = padre;
     Panel      = panel;
     Color      = color;
     Formulario = formulario;
     Tipo       = tipo;
 }
Ejemplo n.º 2
0
 private void CreaPantalla(IconButton sender, CrewPantalla padreb, Panel panel, Color color, BTNtipo tipo, Form formulario)
 {
     Program.pantallas.Add(new CrewPantalla(sender, padreb, panel, color, formulario, tipo));
     if (Program.pantallas.Count > nMaxAnt)
     {            //NUMERO COMO MAXIMO DE FORMULARIOS EN LA COLA
         Program.pantallas.RemoveAt(1);
     }
 }
Ejemplo n.º 3
0
        private void ClickBoton(IconButton sender, CrewPantalla padreb, Panel panel, Color color, BTNtipo tipo, Form formulario, bool n, bool a, bool e, bool b, bool f)
        {
            if (sender != null)            //si el boton existe
            {
                //BOTON DE CABECERA
                if (Program.pantallas.Last().Tipo == BTNtipo.cabecera)
                {
                    Program.pantallas.Last().Formulario.Hide();
                    Program.pantallas.Last().Formulario.Close();
                    Program.pantallas.RemoveAt(Program.pantallas.Count - 1);
                }
                //BOTON NUEVO
                if (Program.pantallas.Last().Boton != sender)
                {
                    if (tipo != BTNtipo.btnDePanel)                    //SI EL NUEVO NO ES DE PANEL
                    {
                        if (padre != null && padre.Boton == sender)    //SI ME HAGO CLICK SIENDO PADRE ACTIVO
                        {
                            DesactivaBoton(padre);
                            ActivaBoton(Program.pantallas.First());
                            return;
                        }
                        DesactivaBoton(Program.pantallas.Last());       //Desactivamos el anterior
                        DesactivaBoton(Program.pantallas.Last().Padre); //y su padre por si acaso
                    }
                    else                                                //SI ES DE PANEL
                    {
                        frmVentanaPrincipal.antBtn = 0;
                        if (Program.pantallas.Last().Tipo == BTNtipo.btnDePanel)
                        {
                            DesactivaBoton(Program.pantallas.Last());                                                                             //Desactivamos el anterior que sea de panel
                        }
                    }

                    CreaPantalla(sender, padreb, panel, color, tipo, formulario);
                    Program.pantallas.Last().SetCabecera(n, a, e, b, f);

                    //Activo lo que tiene que hacer ese botón y muestro su cabecera respectiva
                    ActivaBoton(Program.pantallas.Last());
                    ocultaBotonesCabecera(n, a, e, b, f);
                    if (Program.pantallas.Last().Tipo == BTNtipo.btnConPanel)
                    {
                        btnRecarga.Visible = true;
                    }
                }
                else                 //MISMO BOTON
                {
                    DesactivaBoton(Program.pantallas.Last());
                    Program.pantallas.RemoveAt(Program.pantallas.Count - 1);
                    ActivaBoton(Program.pantallas.First());
                }
                btnRight.Visible = btnLeft.Visible = false;
            }
        }