/// <summary>Carga un documento de texto.</summary> private void VentanaAbrir() { if (textoCodigo.Modified) { MessageDialog m = new MessageDialog(this, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, GetText("Ventana_AbrirModificado")); int respuesta = m.Run(); m.Hide(); m = null; if (!(respuesta == (int)Gtk.ResponseType.Yes)) { return; } } if (selectorAbrir == null) { selectorAbrir = new Gtk.FileSelection(GetText("Ventana_DialogoA")); selectorAbrir.Modal = true; selectorAbrir.OkButton.Clicked += new EventHandler(SelectorAbrirOKPulsado); selectorAbrir.CancelButton.Clicked += new EventHandler(SelectorCancelPulsado); selectorAbrir.DeleteEvent += new DeleteEventHandler(OcultarVentana); selectorAbrir.Icon = IconManager.GetPixmap("gears.png"); } selectorAbrir.ShowAll(); }
private void create_with_file_selection(string title, Gtk.Window parent, Action action) { filesel = new Gtk.FileSelection(title); filesel.TransientFor = parent; /* We try to present as similar a UI as possible with both file * selection widgets, so we frob the file operation buttons for * each special case. */ switch (action) { case Action.Open: filesel.ShowFileops = false; break; case Action.Save: filesel.FileopDelFile.Hide(); filesel.FileopRenFile.Hide(); break; case Action.SelectFolder: filesel.FileList.Parent.Hide(); filesel.SelectionEntry.Hide(); filesel.FileopDelFile.Hide(); filesel.FileopRenFile.Hide(); break; } }
static void Window_Open() { selections = new Gtk.FileSelection("Open... "); selections.Modal = true; selections.OkButton.Clicked += new EventHandler(OK_Clicked); selections.CancelButton.Clicked += new EventHandler(Cancel_Clicked); selections.ShowAll(); }
/// <summary>Función que se ejecuta al pulsar sobre el botón /// para seleccionar fichero. Muestra el diálogo de selección /// de archivos.</summary> /// <param name="o">El objeto que llama a la función.</param> /// <param name="args">Los argumentos que se le pasan a la /// función.</param> private void btnFicheroClicked(object o, System.EventArgs args) { if (selectorFicheros == null) { selectorFicheros = new Gtk.FileSelection( Ventana.GetText("D_Conf_Selector")); selectorFicheros.Modal = true; selectorFicheros.OkButton.Clicked += new EventHandler(SelectorFicherosOkPulsado); selectorFicheros.CancelButton.Clicked += new EventHandler(SelectorFicherosCancelPulsado); selectorFicheros.DeleteEvent += new DeleteEventHandler(Ventana.OcultarVentana); selectorFicheros.Icon = IconManager.GetPixmap("gears.png"); } selectorFicheros.ShowAll(); }
public G_GetFilename(string title, string dir) { fs = new FileSelection(title); fs.Filename = dir; fs.Modal = true; fs.HideFileopButtons (); fs.OkButton.Clicked += new EventHandler (ok); fs.CancelButton.Clicked += new EventHandler (cancel); /* check_button = new CheckButton ("Show Fileops"); check_button.Toggled += new EventHandler (show_fileops); fs.ActionArea.PackStart (check_button, false, false, 0); toggle_button = new ToggleButton ("Select Multiple"); toggle_button.Clicked += new EventHandler (select_multiple); fs.ActionArea.PackStart (toggle_button, false, false, 0); */ fs.ShowAll(); fs.Run (); }
public G_GetFilename(string title, string dir) { fs = new FileSelection(title); fs.Filename = dir; fs.Modal = true; fs.HideFileopButtons(); fs.OkButton.Clicked += new EventHandler(ok); fs.CancelButton.Clicked += new EventHandler(cancel); /* * check_button = new CheckButton ("Show Fileops"); * check_button.Toggled += new EventHandler (show_fileops); * fs.ActionArea.PackStart (check_button, false, false, 0); * * toggle_button = new ToggleButton ("Select Multiple"); * toggle_button.Clicked += new EventHandler (select_multiple); * fs.ActionArea.PackStart (toggle_button, false, false, 0); */ fs.ShowAll(); fs.Run(); }
/// <summary>Guarda el documento actual, preguntando el nombre del /// del fichero en el que se quiere guardar.</summary> private void VentanaGuardarComo() { if (selectorGuardar == null) { selectorGuardar = new Gtk.FileSelection(GetText("Ventana_DialogoG")); selectorGuardar.Modal = true; selectorGuardar.OkButton.Clicked += new EventHandler (SelectorGuardarOKPulsado); selectorGuardar.CancelButton.Clicked += new EventHandler(SelectorCancelPulsado); selectorGuardar.DeleteEvent += new DeleteEventHandler(OcultarVentana); selectorGuardar.Icon = IconManager.GetPixmap("gears.png"); } selectorGuardar.ShowAll(); }
private void create_with_file_selection (string title, Gtk.Window parent, Action action) { filesel = new Gtk.FileSelection (title); filesel.TransientFor = parent; /* We try to present as similar a UI as possible with both file * selection widgets, so we frob the file operation buttons for * each special case. */ switch (action) { case Action.Open: filesel.ShowFileops = false; break; case Action.Save: filesel.FileopDelFile.Hide (); filesel.FileopRenFile.Hide (); break; case Action.SelectFolder: filesel.FileList.Parent.Hide (); filesel.SelectionEntry.Hide (); filesel.FileopDelFile.Hide (); filesel.FileopRenFile.Hide (); break; } }