Exemplo n.º 1
0
 protected void OnButton1Clicked(object sender, EventArgs e)
 {
     FileChooserDialog Dlg;
     Dlg = new FileChooserDialog ("Directorio Inicial", null, FileChooserAction.SelectFolder, Stock.Open, ResponseType.Ok, Stock.Cancel, ResponseType.Cancel);
     Dlg.ShowAll ();
     if (Dlg.Run () == (int)ResponseType.Ok) {
         E1.Text = Dlg.Filename;
     }
     Dlg.HideAll ();
     Dlg.Destroy ();
 }
Exemplo n.º 2
0
        protected virtual void OnCreateButtonClicked(object sender, System.EventArgs e)
        {
            savePathChooser = new FileChooserDialog(_("Save Torrent As..."), this, FileChooserAction.Save, Gtk.Stock.Cancel, ResponseType.Cancel, Gtk.Stock.Save, ResponseType.Accept);
            ResponseType result = (ResponseType) savePathChooser.Run();
            if(result == ResponseType.Accept){
                savePathChooser.HideAll();
                createTorrent();
            }

            if(result == ResponseType.Cancel || result == ResponseType.DeleteEvent){
                savePathChooser.Destroy();
                //createTorrentDialog.Destroy();
                return;
            }
        }
Exemplo n.º 3
0
 private void openLibFile(object s, EventArgs e)
 {
     FileChooserDialog fcd = new FileChooserDialog("Open Library File...", this, FileChooserAction.Open);
     fcd.TransientFor = this;
     fcd.AddButton(Stock.Cancel, ResponseType.Cancel);
     fcd.AddButton(Stock.Ok, ResponseType.Ok);
     FileFilter ff = new FileFilter();
     ff.Name = "Dynamic Link Library (.dll,.exe)";
     ff.AddPattern(@"*.dll");
     ff.AddPattern(@"*.exe");
     fcd.AddFilter(ff);
     int result = fcd.Run();
     fcd.HideAll();
     if(result == (int)ResponseType.Ok) {
         ss.ConnectAlgorithmLibrary(fcd.Filename);
     }
     fcd.Dispose();
 }
Exemplo n.º 4
0
 private void openConfigFile(object s, EventArgs e)
 {
     FileChooserDialog fcd = new FileChooserDialog("Open Config File...", this, FileChooserAction.Open);
     fcd.TransientFor = this;
     fcd.AddButton(Stock.Cancel, ResponseType.Cancel);
     fcd.AddButton(Stock.Ok, ResponseType.Ok);
     FileFilter ff = new FileFilter();
     ff.Name = "Config file (.xml)";
     ff.AddMimeType("text/xml");
     ff.AddMimeType("application/xml");
     fcd.AddFilter(ff);
     int result = fcd.Run();
     fcd.HideAll();
     if(result == (int)ResponseType.Ok) {
         try {
             ss.ReadConfigFile(fcd.Filename);
             this.sr = ss.Simulator.CollectResults();
             this.bs.SetMinCurrentMax(1, 1, this.sr.ChapterCount);
             this.bpsp.SimulatorResult = sr;
         }
         catch(Exception ex) {
             Console.Error.WriteLine(ex);
             MessageDialog md = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok, true, ex.Message);
             md.Run();
             md.Destroy();
         }
         this.bpsp.Reload();
     }
     fcd.Dispose();
 }
Exemplo n.º 5
0
 private void tool_saveaspdf(object sender, EventArgs e)
 {
     using(FileChooserDialog fcd_pdf = new FileChooserDialog("PDF File",this,FileChooserAction.Save)) {
         FileFilter ff = new FileFilter();
         ff.AddPattern("*.pdf");
         ff.Name = "PDF file";
         fcd_pdf.AddFilter(ff);
         fcd_pdf.AddButton("OK",ResponseType.Ok);
         int result = fcd_pdf.Run();
         if(result == (int) ResponseType.Ok) {
             PointD siz = this.sketchpad.MeasureSize();
             using(PdfSurface pdfs = new PdfSurface(fcd_pdf.Filename,siz.X,siz.Y)) {
                 using(Context ctx = new Context(pdfs)) {
                     this.sketchpad.PaintContext(ctx,(int) Math.Ceiling(siz.X),(int) Math.Ceiling(siz.Y));
                 }
             }
         }
         fcd_pdf.HideAll();
     }
 }
Exemplo n.º 6
0
        void window_Shown(object sender, EventArgs e)
        {
            FileChooserDialog dialog = new FileChooserDialog("Choose a directory", (Window)sender, FileChooserAction.SelectFolder);

            Button button = (Button)dialog.AddButton("OK", ResponseType.Ok);
            dialog.TransientFor = (Window)sender;

            ResponseType result = (ResponseType)dialog.Run();
            dialog.HideAll();

            if (result == ResponseType.Ok)
            {
                RunDirectoryScan(dialog.Filename);
            }
        }