Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 4549)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 4587)
@@ -1,3 +1,10 @@
                                                                   -*-*- END -*-*-
+
+ 2004/08/12 - Thomas Bretz
+
+   * tpoint/gui.C:
+     - implemented TGFSFileDialog for reading the star data
+
+
 
  2004/08/05 - Thomas Bretz
Index: trunk/MagicSoft/Cosy/tpoint/gui.C
===================================================================
--- trunk/MagicSoft/Cosy/tpoint/gui.C	(revision 4549)
+++ trunk/MagicSoft/Cosy/tpoint/gui.C	(revision 4587)
@@ -10,4 +10,5 @@
 #include <TGLabel.h>
 #include <TGButton.h>
+#include <TGFileDialog.h>
 
 #include <TF1.h>
@@ -749,9 +750,9 @@
     }
 
-    void LoadStars()
+    void LoadStars(TString fname="tpoint.txt")
     {
         const Int_t size = fOriginal.GetSize();
 
-        ifstream fin("tpoint.txt");
+        ifstream fin(fname);
 
         while (fin && fin.get()!='\n');
@@ -760,5 +761,5 @@
         if (!fin)
         {
-            cout << "File 'tpoint.txt' not found!" << endl;
+            cout << "File '" << fname << "' not found!" << endl;
             return;
         }
@@ -777,4 +778,34 @@
         cout << "Found " << fOriginal.GetSize()-size << " sets of coordinates ";
         cout << "(Total=" << fOriginal.GetSize() << ")" << endl;
+    }
+
+    // --------------------------------------------------------------------------
+    //
+    //  Opens an open dialog
+    //
+    TString OpenDialog()
+    {
+        static const char *gOpenTypes[] =
+        {
+            "TPoint files", "*.txt",
+            "All files",    "*",
+            NULL,           NULL
+        };
+
+        static TString dir(".");
+
+        TGFileInfo fi; // fFileName and fIniDir deleted in ~TGFileInfo
+
+        fi.fFileTypes = (const char**)gOpenTypes;
+        fi.fIniDir    = StrDup(dir);
+
+        new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
+
+        if (!fi.fFilename)
+            return 0;
+
+        dir = fi.fIniDir;
+
+        return fi.fFilename;
     }
 
@@ -809,5 +840,5 @@
                     return kTRUE;
                 case kTbLoadStars:
-                    LoadStars();
+                    LoadStars(OpenDialog());
                     DisplayData();
                     return kTRUE;
