Пример #1
0
                private void FormPrincipal_Load(object sender, EventArgs e)
                {
                        this.CargarMenuPrincipal();

                        //De forma predeterminada, se usa modo maximizado
                        string ModoPredeterminado = "maximizado";
                        if (Lfx.Environment.SystemInformation.RunTime != Lfx.Environment.SystemInformation.RunTimes.DotNet) {
                                //Pero se usa el modo flotante fuera del entorno .NET ya que Mono no tiene buen soporte MDI
                                //y en Linux el modo MDI no es bienvenido
                                ModoPredeterminado = "flotante";
                        }

                        BarraInferior.Visible = Lfx.Workspace.Master.CurrentConfig.ReadLocalSettingInt("Sistema", "Apariencia.BarraInformacion", 1) != 0;
                        switch (Lfx.Workspace.Master.CurrentConfig.ReadGlobalSetting<string>("Sistema.Apariencia.ModoPantalla", ModoPredeterminado)) {
                                case "normal":
                                        this.Text = "Lázaro - " + Lbl.Sys.Config.Actual.UsuarioConectado.Persona.Nombres + " en " + Lfx.Workspace.Master.ToString();
                                        break;
                                case "maximizado":
                                        this.WindowState = FormWindowState.Maximized;
                                        this.Text = "Lázaro - " + Lbl.Sys.Config.Actual.UsuarioConectado.Persona.Nombres + " en " + Lfx.Workspace.Master.ToString();
                                        break;
                                case "completo":
                                        this.Text = "";
                                        this.ControlBox = false;
                                        this.WindowState = FormWindowState.Maximized;
                                        break;
                                case "flotante":
                                        Aplicacion.Flotante = true;
                                        this.BarraTareas.Visible = false;
                                        this.Height = 108;
                                        this.MinimumSize = new Size(128, 112);
                                        if (Lfx.Environment.SystemInformation.Platform == Lfx.Environment.SystemInformation.Platforms.Windows)
                                                //Sólo Windows permite la combinación de MaximumSize y Maximized
                                                this.WindowState = FormWindowState.Maximized;
                                        else
                                                this.Top = 20;
                                        break;
                        }

                        if (Lfx.Workspace.Master.CurrentConfig.ReadGlobalSetting<int>("Sistema.Apariencia.NoMostrarInicio", 0) == 0) {
                                FormInicio = new Lfc.Inicio.Inicio();
                                FormInicio.MdiParent = this;
                                FormInicio.Show();
                                MostrarAyuda("Bienvenido a Lázaro", "Pulse la tecla <F12> para mostrar la pantalla de inicio.");
                        } else {
                                MostrarAyuda("Bienvenido a Lázaro", "Pulse la tecla <F12> para activar el menú principal.");
                        }
                }
Пример #2
0
        private void FormPrincipal_Load(object sender, EventArgs e)
        {
            this.CargarMenuPrincipal();

            //De forma predeterminada, se usa modo maximizado
            string ModoPredeterminado = "maximizado";

            if (Lfx.Environment.SystemInformation.RunTime != Lfx.Environment.SystemInformation.RunTimes.DotNet)
            {
                //Pero se usa el modo flotante fuera del entorno .NET ya que Mono no tiene buen soporte MDI
                //y en Linux el modo MDI no es bienvenido
                ModoPredeterminado = "flotante";
            }

            BarraInferior.Visible = Lfx.Workspace.Master.CurrentConfig.ReadLocalSettingInt("Sistema", "Apariencia.BarraInformacion", 1) != 0;
            switch (Lfx.Workspace.Master.CurrentConfig.ReadGlobalSetting <string>("Sistema.Apariencia.ModoPantalla", ModoPredeterminado))
            {
            case "normal":
                this.Text = "Lázaro - " + Lbl.Sys.Config.Actual.UsuarioConectado.Persona.Nombres + " en " + Lfx.Workspace.Master.ToString();
                break;

            case "maximizado":
                this.WindowState = FormWindowState.Maximized;
                this.Text        = "Lázaro - " + Lbl.Sys.Config.Actual.UsuarioConectado.Persona.Nombres + " en " + Lfx.Workspace.Master.ToString();
                break;

            case "completo":
                this.Text        = "";
                this.ControlBox  = false;
                this.WindowState = FormWindowState.Maximized;
                break;

            case "flotante":
                Aplicacion.Flotante      = true;
                this.BarraTareas.Visible = false;
                this.Height      = 108;
                this.MinimumSize = new Size(128, 112);
                if (Lfx.Environment.SystemInformation.Platform == Lfx.Environment.SystemInformation.Platforms.Windows)
                {
                    //Sólo Windows permite la combinación de MaximumSize y Maximized
                    this.WindowState = FormWindowState.Maximized;
                }
                else
                {
                    this.Top = 20;
                }
                break;
            }

            if (Lfx.Workspace.Master.CurrentConfig.ReadGlobalSetting <int>("Sistema.Apariencia.NoMostrarInicio", 0) == 0)
            {
                FormInicio           = new Lfc.Inicio.Inicio();
                FormInicio.MdiParent = this;
                FormInicio.Show();
                MostrarAyuda("Bienvenido a Lázaro", "Pulse la tecla <F12> para mostrar la pantalla de inicio.");
            }
            else
            {
                MostrarAyuda("Bienvenido a Lázaro", "Pulse la tecla <F12> para activar el menú principal.");
            }
        }