Changeset 4587 for trunk/MagicSoft/Cosy/tpoint
- Timestamp:
- 08/12/04 09:16:13 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tpoint/gui.C
r4357 r4587 10 10 #include <TGLabel.h> 11 11 #include <TGButton.h> 12 #include <TGFileDialog.h> 12 13 13 14 #include <TF1.h> … … 749 750 } 750 751 751 void LoadStars( )752 void LoadStars(TString fname="tpoint.txt") 752 753 { 753 754 const Int_t size = fOriginal.GetSize(); 754 755 755 ifstream fin( "tpoint.txt");756 ifstream fin(fname); 756 757 757 758 while (fin && fin.get()!='\n'); … … 760 761 if (!fin) 761 762 { 762 cout << "File ' tpoint.txt' not found!" << endl;763 cout << "File '" << fname << "' not found!" << endl; 763 764 return; 764 765 } … … 777 778 cout << "Found " << fOriginal.GetSize()-size << " sets of coordinates "; 778 779 cout << "(Total=" << fOriginal.GetSize() << ")" << endl; 780 } 781 782 // -------------------------------------------------------------------------- 783 // 784 // Opens an open dialog 785 // 786 TString OpenDialog() 787 { 788 static const char *gOpenTypes[] = 789 { 790 "TPoint files", "*.txt", 791 "All files", "*", 792 NULL, NULL 793 }; 794 795 static TString dir("."); 796 797 TGFileInfo fi; // fFileName and fIniDir deleted in ~TGFileInfo 798 799 fi.fFileTypes = (const char**)gOpenTypes; 800 fi.fIniDir = StrDup(dir); 801 802 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi); 803 804 if (!fi.fFilename) 805 return 0; 806 807 dir = fi.fIniDir; 808 809 return fi.fFilename; 779 810 } 780 811 … … 809 840 return kTRUE; 810 841 case kTbLoadStars: 811 LoadStars( );842 LoadStars(OpenDialog()); 812 843 DisplayData(); 813 844 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.