Changeset 8824 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 01/24/08 09:20:59 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r8376 r8824 37 37 #include "SlaStars.h" 38 38 39 #undef DEBUG 39 #define DEBUG 40 //#undef DEBUG 40 41 //#define EXPERT 41 42 //#define HAS_DEMO … … 84 85 void MGCosy::CreateMenu() 85 86 { 86 TGLayoutHints *laymenubar = new TGLayoutHints (kLHintsNormal | kLHintsExpandX); 87 TGLayoutHints *laymenuitem = new TGLayoutHints (kLHintsNormal, 0, 4, 0, 0); 88 fList->Add(laymenubar); 89 fList->Add(laymenuitem); 87 // 88 // the button messages are handled by main frame (this) 89 // 90 TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame); 91 TGPopupMenu *filemenu = menubar->AddPopup("&File"); 92 TGPopupMenu *logmenu = menubar->AddPopup("&Log"); 90 93 91 94 // 92 95 // crate the menu bar 93 96 // 94 TGPopupMenu *filemenu = new TGPopupMenu(gClient->GetRoot());95 97 filemenu->AddEntry("Set Aspect", IDM_ASPECT); 96 98 filemenu->AddEntry("Exit", IDM_EXIT); 97 99 filemenu->Associate(this); 98 fList->Add(filemenu);99 100 100 101 // 101 102 // Log Menu 102 103 // 103 TGPopupMenu *logmenu = new TGPopupMenu(gClient->GetRoot());104 104 logmenu->AddEntry("&Copy Selected", kLogCopy); 105 105 logmenu->AddEntry("&Select All", kLogSelect); 106 106 logmenu->AddSeparator(); 107 107 logmenu->AddEntry("Clear &all", kLogClear); 108 /* 109 logmenu->AddSeparator(); 110 logmenu->AddEntry("Search", kLogSearch); 111 */ 108 //logmenu->AddSeparator(); 109 //logmenu->AddEntry("Search", kLogSearch); 112 110 logmenu->AddSeparator(); 113 111 logmenu->AddEntry("Sa&ve", kLogSave); … … 116 114 117 115 // 118 // the button messages are handled by main frame (this)119 //120 TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame);121 menubar->AddPopup("File", filemenu, laymenuitem);122 menubar->AddPopup("Lo&g", logmenu, laymenuitem);123 AddFrame(menubar, laymenubar);124 fList->Add(menubar);125 126 //127 116 // Seperator beyond menubar 128 117 // 129 118 TGHorizontal3DLine *linesep = new TGHorizontal3DLine(this); 130 AddFrame(linesep, laymenubar); 131 fList->Add(linesep); 119 120 // 121 // Setup Frames 122 // 123 TGLayoutHints *laymenubar = new TGLayoutHints (kLHintsNormal | kLHintsExpandX); 124 125 AddFrame(menubar, (TGLayoutHints*)laymenubar->Clone()); 126 AddFrame(linesep, (TGLayoutHints*)laymenubar->Clone()); 127 128 delete laymenubar; 132 129 } 133 130 … … 449 446 l2->Move(x, y+h); 450 447 l3->Move(x, y+2*h); 451 l4->Move(x, y+3*h);448 //l4->Move(x, y+3*h); 452 449 fList->Add(l1); 453 450 fList->Add(l2); 454 451 fList->Add(l3); 455 fList->Add(l4);452 //fList->Add(l4); 456 453 457 454 #ifdef EXPERT … … 713 710 : TGMainFrame(p, w, h), fObservatory(key), fQueue(q) 714 711 { 712 // This means that all objects added with AddFrame are deleted 713 // automatically, including all LayoutHints. 714 SetCleanup(); 715 715 716 fList = new MGList; 717 fList->SetOwner(); 716 718 717 719 fFont = gVirtualX->LoadQueryFont("7x13bold"); 718 720 719 #ifdef DEBUG720 cout << "MGCosy: Creating Menu" << endl;721 #endif722 721 CreateMenu(); 723 722 724 #ifdef DEBUG725 cout << "MGCosy: Creating TGCompositeFrame" << endl;726 #endif727 723 TGHorizontalFrame *f1 = new TGHorizontalFrame(this, 0, 0); 728 724 TGHorizontalFrame *f2 = new TGHorizontalFrame(this, 0, 0); 729 fList->Add(f1); 730 fList->Add(f2); 731 732 #ifdef DEBUG 733 cout << "MGCosy: Creating TGTab" << endl; 734 #endif 725 f1->SetCleanup(); 726 f2->SetCleanup(); 727 //fList->Add(f1); 728 //fList->Add(f2); 729 735 730 fTab = new TGTab(f1, 300, 300); 736 fList->Add(fTab); 737 738 #ifdef DEBUG 739 cout << "MGCosy: Creating MGSkyPosition" << endl; 740 #endif 731 //fList->Add(fTab); 732 741 733 fSkyPosition = new MGSkyPosition(fObservatory, f1, 300); 742 #ifdef DEBUG 743 cout << "MGCosy: Creating MGAccuracy" << endl; 744 #endif 734 745 735 fAccuracy = new MGAccuracy(f1, 300); 746 736 fAccuracy->DrawText("0.5se", "1.0se", "2.0se", "Ctrl Deviation [min]"); 747 737 fAccuracy->DrawCircles(); 748 #ifdef DEBUG749 cout << "MGCosy: Creating MGVelocity" << endl;750 #endif751 738 752 739 fImage = new MGImage(f2, 768/2-1, 576/2-1, kRaisedFrame); 753 740 //fVelocity = new MGVelocity(f2, "Velocity [U_{mot}/min]", 300); 754 741 // fOffset = new MGVelocity (f, "Offset se-re [']", 300); 755 #ifdef DEBUG756 cout << "MGCosy: Creating MGVelocityTime" << endl;757 #endif758 742 // fAccuracyTime = new MGAccuracyTime(f2, 300); 759 743 760 fList->Add(fSkyPosition);761 fList->Add(fAccuracy);744 //fList->Add(fSkyPosition); 745 //fList->Add(fAccuracy); 762 746 // fList->Add(fAccuracyTime); 763 747 // fList->Add(fVelocity); 764 748 // fList->Add(fOffset); 765 fList->Add(fImage); 766 767 #ifdef DEBUG 768 cout << "MGCosy: Creating TGGroupFrame" << endl; 769 #endif 749 //fList->Add(fImage); 750 770 751 TGGroupFrame *frame = new TGGroupFrame(f2, "Status"); 771 fList->Add(frame); 772 773 #ifdef DEBUG 774 cout << "MGCosy: Creating TGTextView" << endl; 775 #endif 752 // frame->SetCleanup(); 753 //fList->Add(frame); 754 776 755 fLog = new TGTextView(f2, 300, 300); 777 756 if (fFont) 778 757 fLog->SetFont(fFont); 779 fList->Add(fLog);758 //fList->Add(fLog); 780 759 781 760 TGLayoutHints *hints1 = new TGLayoutHints(kLHintsNormal | kLHintsExpandX|kLHintsExpandY, 6, 6, 6, 3); … … 789 768 TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY); 790 769 770 /* 791 771 fList->Add(hints1); 792 772 fList->Add(hints2); … … 797 777 fList->Add(hints2b); 798 778 fList->Add(hints3b); 799 779 */ 800 780 // Layout upper frame 801 781 f1->AddFrame(fTab, hints1a); … … 814 794 AddFrame(f2, hints2); 815 795 816 #ifdef DEBUG817 cout << "MGCosy: Creating Tabs" << endl;818 #endif819 796 CreateTabs(); 820 #ifdef DEBUG821 cout << "MGCosy: Creating Label" << endl;822 #endif823 797 CreateLabel(frame); 824 798 … … 826 800 // Map the window, set up the layout, etc. 827 801 // 828 #ifdef DEBUG829 cout << "MGCosy: Setting Size" << endl;830 #endif831 802 const Int_t ww = 1010; 832 803 const Int_t hh = 700; … … 848 819 MGCosy::~MGCosy() 849 820 { 821 /* 822 TIter Next(fList); 823 TObject *o=0; 824 while((o=Next())) 825 { 826 cout << o << " " << flush; 827 cout << o->ClassName() << " " << flush; 828 cout << o->GetName() << " " << endl; 829 delete o; 830 } 831 */ 850 832 #ifdef DEBUG 851 833 cout << "MGCosy::~MGCosy called." << endl; … … 1466 1448 { 1467 1449 case kPB_RAp: 1468 xy. X(xy.X()+1./60);1450 xy.Set(xy.X()+1./60, xy.Y()); 1469 1451 break; 1470 1452 case kPB_RAm: 1471 xy. X(xy.X()-1./60);1453 xy.Set(xy.X()-1./60, xy.Y()); 1472 1454 break; 1473 1455 case kPB_DECp: 1474 xy. Y(xy.Y()+1./60);1456 xy.Set(xy.X(), xy.Y()+1./60); 1475 1457 break; 1476 1458 case kPB_DECm: 1477 xy. Y(xy.Y()-1./60);1459 xy.Set(xy.X(), xy.Y()-1./60); 1478 1460 break; 1479 1461 }
Note:
See TracChangeset
for help on using the changeset viewer.