Changeset 2087 for trunk/MagicSoft
- Timestamp:
- 05/07/03 11:32:44 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2086 r2087 1 1 -*-*- END OF LINE -*-*- 2 3 2003/05/07: Thomas Bretz 4 5 * mmain/Makefile, mmain/MainLinkDef.h: 6 - added MSearch 7 8 * mmain/MSearch.[h,cc]: 9 - added 10 11 * mmmain/MStatusDisplay.[h,cc]: 12 - implemented Search 13 14 2 15 3 16 2003/05/07: Abelardo Moralejo … … 5 18 * mranforest/Makefile 6 19 - fixed typo. 20 21 7 22 8 23 2003/05/06: Abelardo Moralejo … … 23 38 events, including non-triggers (while we usually run over files 24 39 containing only triggers). 40 41 25 42 26 43 2003/05/06: Thomas Bretz -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r2082 r2087 90 90 #include "MGList.h" // MGList 91 91 #include "MGMenu.h" // MGMenu, TGMenu 92 #include "MSearch.h" // MSearch 92 93 #include "MParContainer.h" // MParContainer::GetDescriptor 93 94 … … 96 97 97 98 ClassImp(MStatusDisplay); 99 100 // ------------ Workaround for a non working TGTextView::Search ------------- 101 class MGTextView : public TGTextView 102 { 103 public: 104 MGTextView(const TGWindow *parent, UInt_t w, UInt_t h, Int_t id = -1, 105 UInt_t sboptions = 0, ULong_t back = GetWhitePixel()) : 106 TGTextView(parent, w, h, id, sboptions, back) {} 107 MGTextView(const TGWindow *parent, UInt_t w, UInt_t h, TGText *text, 108 Int_t id = -1, UInt_t sboptions = 0, ULong_t back = GetWhitePixel()) : 109 TGTextView(parent, w, h, text, id, sboptions, back) {} 110 MGTextView(const TGWindow *parent, UInt_t w, UInt_t h, const char *string, 111 Int_t id = -1, UInt_t sboptions = 0, ULong_t back = GetWhitePixel()) : 112 TGTextView(parent, w, h, string, id, sboptions, back) {} 113 114 void Mark(Long_t xPos, Long_t yPos) { TGTextView::Mark(xPos, yPos); } 115 void UnMark() { TGTextView::UnMark(); } 116 117 Bool_t Search(const char *string, Bool_t direction, Bool_t caseSensitive) 118 { 119 // Taken from TGTextView::Search and modified. 120 121 TGLongPosition pos, pos2; 122 pos2.fX = pos2.fY = 0; 123 if (fIsMarked) { 124 if (!direction) 125 { 126 pos2.fX = fMarkedStart.fX; 127 pos2.fY = fMarkedStart.fY; 128 } 129 else 130 { 131 pos2.fX = fMarkedEnd.fX + 1; 132 pos2.fY = fMarkedEnd.fY; 133 } 134 } 135 if (!fText->Search(&pos, pos2, string, direction, caseSensitive)) 136 return kFALSE; 137 UnMark(); 138 fIsMarked = kTRUE; 139 fMarkedStart.fY = fMarkedEnd.fY = pos.fY; 140 fMarkedStart.fX = pos.fX; 141 fMarkedEnd.fX = fMarkedStart.fX + strlen(string); 142 pos.fY = ToObjYCoord(fVisible.fY); 143 if ((fMarkedStart.fY < pos.fY) || 144 (ToScrYCoord(fMarkedStart.fY) >= (Int_t)fCanvas->GetHeight())) 145 pos.fY = fMarkedStart.fY; 146 pos.fX = ToObjXCoord(fVisible.fX, pos.fY); 147 if ((fMarkedStart.fX < pos.fX) || 148 (ToScrXCoord(fMarkedStart.fX, pos.fY) >= (Int_t)fCanvas->GetWidth())) 149 pos.fX = fMarkedStart.fX; 150 151 SetVsbPosition((ToScrYCoord(pos.fY) + fVisible.fY)/fScrollVal.fY); 152 SetHsbPosition((ToScrXCoord(pos.fX, pos.fY) + fVisible.fX)/fScrollVal.fX); 153 DrawRegion(0, (Int_t)ToScrYCoord(fMarkedStart.fY), fCanvas->GetWidth(), 154 UInt_t(ToScrYCoord(fMarkedEnd.fY+1) - ToScrYCoord(fMarkedEnd.fY))); 155 156 return kTRUE; 157 } 158 }; 159 // -------------------------------------------------------------------------- 98 160 99 161 // -------------------------------------------------------------------------- … … 163 225 logmenu->AddSeparator(); 164 226 logmenu->AddEntry("Select &All", kLogSelect); 165 /* 166 logmenu->AddSeparator(); 167 logmenu->AddEntry("Search", kLogSearch); 168 */ 227 logmenu->AddSeparator(); 228 logmenu->AddEntry("&Find...", kLogFind); 169 229 logmenu->AddSeparator(); 170 230 logmenu->AddEntry("&Save", kLogSave); … … 280 340 281 341 // Create Text View 282 fLogBox = new TGTextView(f, 1, 1); // , -1, 0, TGFrame::GetDefaultFrameBackground());342 fLogBox = new MGTextView(f, 1, 1); // , -1, 0, TGFrame::GetDefaultFrameBackground()); 283 343 if (fFont) 284 344 fLogBox->SetFont(fFont); … … 782 842 fLogBox->SelectAll(); 783 843 return kTRUE; 784 case kLog Search:785 //virtual Bool_t Search(const char *string, Bool_t direction, Bool_t caseSensitive);844 case kLogFind: 845 new MSearch(this); 786 846 return kTRUE; 787 847 case kLogSave: … … 939 999 // -------------------------------------------------------------------------- 940 1000 // 1001 // Process the kC_USER messages 1002 // 1003 Bool_t MStatusDisplay::ProcessMessageUser(Long_t submsg, Long_t mp1, Long_t mp2) 1004 { 1005 // kS_START, case sensitive | backward<<1, char *txt 1006 switch (submsg) 1007 { 1008 case kS_START: 1009 fLogBox->Search((char*)mp2, !(mp1&2>>1), mp1&1); 1010 return kTRUE; 1011 #ifdef DEBUG 1012 default: 1013 cout << "User: " << "Submsg:" << submsg << " Mp1=" << mp1 << " Mp2=" << mp2 << endl; 1014 #endif 1015 } 1016 return kTRUE; 1017 } 1018 1019 // -------------------------------------------------------------------------- 1020 // 941 1021 // Process the messages from the GUI 942 1022 // … … 944 1024 { 945 1025 // Can be found in WidgetMessageTypes.h 1026 cout << "Msg: " << GET_MSG(msg) << " Submsg:" << GET_SUBMSG(msg); 1027 cout << " Mp1=" << mp1 << " Mp2=" << mp2 << endl; 946 1028 switch (GET_MSG(msg)) 947 1029 { … … 951 1033 case kC_TEXTVIEW: 952 1034 return ProcessMessageTextview(GET_SUBMSG(msg), mp1, mp2); 1035 1036 case kC_USER: 1037 return ProcessMessageUser(GET_SUBMSG(msg), mp1, mp2); 953 1038 } 954 1039 #ifdef DEBUG -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
r2058 r2087 44 44 kSize640, kSize800, kSize960, kSize1024, kSize1280, 45 45 // kLog 46 kLogCopy, kLogClear, kLogSelect, kLog Search, kLogSave, kLogAppend,46 kLogCopy, kLogClear, kLogSelect, kLogFind, kLogSave, kLogAppend, 47 47 // kPic 48 kPicMagic, kPicMars 48 kPicMagic, kPicMars, 49 // kPic 50 kSearch 49 51 } Status_t; 50 52 … … 82 84 Bool_t ProcessMessageCommand(Long_t submsg, Long_t mp1, Long_t mp2); 83 85 Bool_t ProcessMessageTextview(Long_t submsg, Long_t mp1, Long_t mp2); 86 Bool_t ProcessMessageUser(Long_t submsg, Long_t mp1, Long_t mp2); 84 87 Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2); 85 88 void CloseWindow(); -
trunk/MagicSoft/Mars/mmain/MainLinkDef.h
r1965 r2087 13 13 #pragma link C++ class MDataCheck+; 14 14 #pragma link C++ class MMonteCarlo+; 15 #pragma link C++ class MSearch+; 15 16 #pragma link C++ class MProgressBar+; 16 17 #pragma link C++ class MCameraDisplay+; -
trunk/MagicSoft/Mars/mmain/Makefile
r2063 r2087 37 37 MAnalysis.cc \ 38 38 MMonteCarlo.cc \ 39 MSearch.cc \ 39 40 MStatusDisplay.cc \ 40 41 MProgressBar.cc \
Note:
See TracChangeset
for help on using the changeset viewer.