Changeset 3525 for trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
- Timestamp:
- 03/16/04 18:00:25 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
r3519 r3525 445 445 line->SetLineColor(kWhite+type*2); 446 446 line->SetBit(kCannotPick); 447 fMapG.Add((Long_t)line, 0);447 AddMap(line); 448 448 449 449 const TVector2 deg = v*TMath::RadToDeg(); … … 456 456 tip->SetBit(kCannotPick); 457 457 tip->SetMarkerColor(kWhite+type*2); 458 fMapG.Add((Long_t)tip, (Long_t)new TString(txt));458 AddMap(tip, new TString(txt)); 459 459 460 460 return kTRUE; … … 585 585 tip->SetBit(kCanDelete); 586 586 tip->SetBit(kCannotPick); 587 fMapG.Add((Long_t)tip, (Long_t)new TString(str));587 AddMap(tip, new TString(str)); 588 588 } 589 589 … … 674 674 } 675 675 676 void MAstroCatalog::DrawMap() 677 { 678 Long_t key, val; 679 TExMapIter map(&fMapG); 680 while (map.Next(key, val)) 681 ((TObject*)key)->Draw(); 682 } 683 676 684 void MAstroCatalog::Draw(Option_t *o) 677 685 { … … 679 687 AppendPad(o); 680 688 689 // If contents have not previously changed make sure that 690 // all primitives are recreated. 681 691 if (!TestBit(kHasChanged)) 682 692 DrawPrimitives(o); … … 705 715 void MAstroCatalog::EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected) 706 716 { 717 TCanvas *c = (TCanvas*)gTQSender; 718 719 gPad = c ? c->GetSelectedPad() : NULL; 720 if (!gPad) 721 return; 722 707 723 // Try to find a corresponding object with kCannotPick set and 708 724 // an available TString (for a tool tip) 725 TString *str=0; 709 726 if (!selected || selected==this) 710 727 { … … 721 738 722 739 selected = o; 740 str = (TString*)val; 723 741 break; 724 742 } … … 728 746 return; 729 747 730 TCanvas *c = (TCanvas*)gTQSender;731 732 TVirtualPad* save=gPad;733 734 gPad = c ? c->GetSelectedPad() : NULL;735 if (!gPad)736 return;737 738 748 switch (event) 739 749 { 740 750 case kMouseMotion: 741 { 742 TString *s = (TString*)fMapG.GetValue((Long_t)selected); 743 if (!fToolTip->IsMapped() && s) 744 ShowToolTip(px, py, *s); 745 } 751 if (!fToolTip->IsMapped() && str) 752 ShowToolTip(px, py, *str); 746 753 break; 747 754 … … 751 758 break; 752 759 753 case kKeyPress: // Unresolved keyboard event 754 /* 755 switch (px) 756 { 757 case kKey_Plus: 758 case kKey_Minus:*/ 759 ExecuteEvent(kKeyPress, px, py);/* 760 break; 761 } 762 break;*/ 763 } 764 765 gPad=save; 760 case kKeyPress: 761 ExecuteEvent(kKeyPress, px, py); 762 break; 763 } 766 764 } 767 765 … … 815 813 if (event==kKeyPress) 816 814 ExecuteEventKbd(mp1, mp2); 817 818 815 } 819 816
Note:
See TracChangeset
for help on using the changeset viewer.