Ejemplo n.º 1
0
        public void agregarNewTab()
        {
            String   nombre = "Nuevo Documento " + contador.ToString();
            TitusTab aux    = new TitusTab(nombre, "", "");

            this.Pages.Add(aux);
            contador++;
        }
Ejemplo n.º 2
0
        private void ejecutarArchivoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TitusTab aux = (TitusTab)TTControl.SelectedPage;

            if (aux != null)
            {
                aux.Analizar();
            }
        }
Ejemplo n.º 3
0
        public void guardarComoTab()
        {
            TitusTab TTaux = (TitusTab)this.SelectedPage;

            if (TTaux != null)
            {
                TTaux.guardarComoArchivo();
                this.Refresh();
                this.UpdateLayout();
            }
        }
Ejemplo n.º 4
0
        //evento para cerrar las pestañas
        private void TitusTabControl_TabButtonClicked(object sender, LidorSystems.IntegralUI.ObjectClickEventArgs e)
        {
            if (e.Object is LidorSystems.IntegralUI.Controls.CommandButton)
            {
                LidorSystems.IntegralUI.Controls.CommandButton btn = (LidorSystems.IntegralUI.Controls.CommandButton)e.Object;

                // Check whether the type of a button is a close button
                if (btn.Key == "TAB_CLOSE")
                {
                    // Locate the tab in which the command button was clicked
                    LidorSystems.IntegralUI.Containers.TabPage page = this.GetPageAt(e.Position);

                    if (page != null)
                    {
                        // Depending on the action, you can determine whether you want to hide or dispose the tab
                        switch (this.CloseAction)
                        {
                        case LidorSystems.IntegralUI.CloseAction.Hide:
                            page.Hide();
                            break;

                        default:
                            TitusTab TTaux = (TitusTab)this.SelectedPage;
                            //preguntamos si ha sido modificado el contenido para preguntar si desea guardar
                            if (TTaux.esModificado())
                            {
                                switch (MessageBox.Show("Desea guardar el archivo", "Guardar archivo", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk))
                                {
                                case DialogResult.Yes:
                                    guardarTab();
                                    page.Remove();
                                    break;

                                case DialogResult.No:
                                    page.Remove();
                                    break;

                                default:
                                    break;
                                }
                            }
                            else
                            {
                                page.Remove();
                            }
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public void abrirTab()
        {
            OpenFileDialog abrir = new OpenFileDialog();

            abrir.Filter           = Constante.DialogFilter;
            abrir.Title            = "Abrir";
            abrir.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            abrir.ShowDialog();

            if (abrir.FileName != "")
            {
                TitusTab aux = new TitusTab(abrir.SafeFileName, File.ReadAllText(abrir.FileName), abrir.FileName);
                this.Pages.Add(aux);
            }
        }