2003-03-17 Joel Basson <jstrike@mweb.co.za>
[mono.git] / mcs / class / System.Windows.Forms / Gtk / FileDialog.cs
1 //              
2 //                      System.Windows.Forms.FileDialog
3 //
4 //                      Author: 
5 //                                              Joel Basson             (jstrike@mweb.co.za)
6 //
7 //
8
9 using System.Drawing;\r
10 using System.Drawing.Printing;\r
11 using System.ComponentModel;
12 using Gtk;
13 using GtkSharp;
14
15 namespace System.Windows.Forms {
16
17         /// <summary>\r
18         /// Represents a Windows File Dialog.\r
19         ///\r
20         /// </summary>\r
21
22         public class FileDialog: Control{
23                 
24                 String name1; 
25                 Gtk.FileSelection file1 = new Gtk.FileSelection("");
26
27         public FileDialog () : base () {
28         }
29
30         
31         public void ShowDialog () {
32                 //Gtk.FileSelection file1 = new Gtk.FileSelection("");
33                 file1.OkButton.Clicked += new EventHandler (file_selection_ok);
34                 file1.CancelButton.Clicked += new EventHandler (file_selection_cancel);
35                 file1.Show();
36         }       
37
38         public string OpenFile {
39                 get {
40                                         return name1;
41                 }
42         }
43         
44         internal void file_selection_cancel (object o, EventArgs args){
45                         file1.Hide();
46         } 
47                 
48         internal void file_selection_ok (object o, EventArgs args){
49                         name1 = file1.Filename;
50                         file1.Hide();
51         }
52         
53         }
54         
55 }