Changeset 1760 for trunk/MagicSoft/Cosy/gui/MGCosy.cc
- Timestamp:
- 02/16/03 17:02:06 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r1758 r1760 14 14 #include <TGLabel.h> // TGLabel 15 15 #include <TGListBox.h> // TGListBox 16 #include <TGComboBox.h> // TGComboBox 16 17 #include <TG3DLine.h> // TGHorizontal3DLine (TGSplitter) 17 18 #include <TGTextEntry.h> // TGTextEntry … … 53 54 kPB_LoadBending, 54 55 kPB_ResetBending, 55 kPB_CALIBSE 56 kPB_CALIBSE, 57 kCB_PredefPos 58 56 59 }; 57 60 … … 306 309 } 307 310 311 void MGCosy::CreatePredefinedPos(TGCompositeFrame *tf1) 312 { 313 TGComboBox *box = new TGComboBox(tf1, kCB_PredefPos); 314 box->Resize(120, 20); 315 box->Associate(this); 316 317 TGLayoutHints *lay = new TGLayoutHints(kLHintsLeft|kLHintsTop, 318 27, 0, 200, 0); 319 tf1->AddFrame(box, lay); 320 321 fList->Add(box); 322 fList->Add(lay); 323 324 ifstream fin("prepos.txt"); 325 if (!fin) 326 { 327 cout << "ERROR: Predifined posiion in 'prepos.txt' not found." << endl; 328 return; 329 } 330 331 int i=0; 332 while (!fin.eof()) 333 { 334 TString str; 335 Double_t zd, az; 336 fin >> str >> zd >> az; 337 box->AddEntry(str, i++); 338 339 fStarList.Add(zd, az); 340 } 341 } 342 308 343 void MGCosy::CreateTabs(TGTab *fTab) 309 344 { … … 317 352 fCZdAz->Move(27, 105); 318 353 fList->Add(fCZdAz); 354 355 CreatePredefinedPos(tf1); 319 356 320 357 fCRaDec = new MGCoordinates(tf2, kETypeRaDec); … … 866 903 time.Now(); 867 904 905 static char oldtxt[256]; 906 868 907 char text[256]; 869 908 … … 875 914 dot[2] = 0; 876 915 877 fUtc->SetText(new TGString(text)); 878 916 if (strcmp(oldtxt, text)) 917 { 918 fUtc->SetText(new TGString(text)); 919 strcpy(oldtxt, text); 920 } 921 922 static long oldmjd; 879 923 double mjd = time.GetMjd(); 880 924 881 sprintf(text, "%12.6f", mjd); 882 fMjd->SetText(new TGString(text)); 925 if (oldmjd != 1000000*mjd) 926 { 927 sprintf(text, "%12.6f", mjd); 928 fMjd->SetText(new TGString(text)); 929 930 oldmjd = (long)(1000000*mjd); 931 } 883 932 884 933 return mjd; … … 1098 1147 switch (GET_SUBMSG(msg)) 1099 1148 { 1149 case kCM_COMBOBOX: 1150 if (mp1==kCB_PredefPos) 1151 { 1152 MStar *pos = fStarList[mp2]; 1153 if (!pos) 1154 return kTRUE; 1155 fCZdAz->SetCoordinates(ZdAz(pos->GetX(), pos->GetY())); 1156 } 1157 return kTRUE; 1158 1100 1159 case kCM_TAB: 1101 1160 //cout << "Tab: " << mp1 << endl;
Note:
See TracChangeset
for help on using the changeset viewer.