Changeset 2563 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 11/23/03 21:18:30 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r2550 r2563 560 560 // 561 561 MStatusDisplay::MStatusDisplay(Long_t t) 562 : TGMainFrame(NULL, 1, 1), f Tab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0)562 : TGMainFrame(NULL, 1, 1), fLog(&gLog), fTab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0) 563 563 { 564 564 // p==NULL means: Take gClient->GetRoot() if not in batch mode … … 587 587 fList = new MGList; 588 588 fList->SetOwner(); 589 590 //591 // set the smallest and biggest size of the Main frame592 // and move it to its appearance position593 SetWMSizeHints(570, 480, 1280, 980, 1, 1);594 Move(rand()%100+50, rand()%100+50);595 Resize(570, 480);596 589 597 590 // … … 612 605 AddStatusBar(); 613 606 } 607 608 // 609 // set the smallest and biggest size of the Main frame 610 // and move it to its appearance position 611 SetWMSizeHints(570, 480, 1280, 980, 1, 1); 612 MoveResize(rand()%100+570, rand()%100+480, 570, 480); 614 613 615 614 // … … 1052 1051 */ 1053 1052 1053 void MStatusDisplay::Reset() 1054 { 1055 for (int i=fTab->GetNumberOfTabs()-1; i>0; i--) 1056 RemoveTab(i); 1057 } 1058 1054 1059 // -------------------------------------------------------------------------- 1055 1060 // … … 1077 1082 1078 1083 case kFileReset: 1079 for (int i=fTab->GetNumberOfTabs()-1; i>0; i--) 1080 RemoveTab(i); 1084 Reset(); 1081 1085 return kTRUE; 1082 1086 /* … … 1217 1221 switch (submsg) 1218 1222 { 1219 case kCM_MENU: 1223 case kCM_MENU: // 1 1220 1224 return ProcessMessageCommandMenu(mp1); // mp2=userdata 1221 case kCM_TAB: 1225 case kCM_TAB: // 8 1222 1226 /* 1223 1227 for (int i=0; i<fTab->GetNumberOfTabs(); i++) … … 1238 1242 return kTRUE; 1239 1243 #ifdef DEBUG 1240 case kCM_MENUSELECT: 1244 case kCM_MENUSELECT: // 2 1241 1245 cout << "Command-Menuselect #" << mp1 << " (UserData=" << (void*)mp2 << ")" << endl; 1242 1246 return kTRUE; 1243 1247 1244 case kCM_BUTTON: 1248 case kCM_BUTTON: // 3 1245 1249 cout << "Command-Button." << endl; 1246 1250 return kTRUE; 1247 1251 1248 case kCM_CHECKBUTTON: 1252 case kCM_CHECKBUTTON: // 4 1249 1253 cout << "Command-CheckButton." << endl; 1250 1254 return kTRUE; 1251 1255 1252 case kCM_RADIOBUTTON: 1256 case kCM_RADIOBUTTON: // 5 1253 1257 cout << "Command-RadioButton." << endl; 1254 1258 return kTRUE; 1255 1259 1256 case kCM_LISTBOX: 1260 case kCM_LISTBOX: // 6 1257 1261 cout << "Command-Listbox #" << mp1 << " (LineId #" << mp2 << ")" << endl; 1258 1262 return kTRUE; 1259 1263 1260 case kCM_COMBOBOX: 1264 case kCM_COMBOBOX: // 7 1261 1265 cout << "Command-ComboBox." << endl; 1262 1266 return kTRUE; … … 1351 1355 { 1352 1356 // Can be found in WidgetMessageTypes.h 1357 #ifdef DEBUG 1353 1358 cout << "Msg: " << GET_MSG(msg) << " Submsg:" << GET_SUBMSG(msg); 1354 1359 cout << " Mp1=" << mp1 << " Mp2=" << mp2 << endl; 1360 #endif 1355 1361 switch (GET_MSG(msg)) 1356 1362 { 1357 case kC_COMMAND: 1363 case kC_COMMAND: // 1 1358 1364 return ProcessMessageCommand(GET_SUBMSG(msg), mp1, mp2); 1359 1365 1360 case kC_TEXTVIEW: 1366 case kC_TEXTVIEW: // 9 1361 1367 return ProcessMessageTextview(GET_SUBMSG(msg), mp1, mp2); 1362 1368 1363 case kC_USER: 1369 case kC_USER: // 1001 1364 1370 return ProcessMessageUser(GET_SUBMSG(msg), mp1, mp2); 1365 1371 } … … 1387 1393 gLog << dbg << "MStatusDisplay is on heap: " << (int)IsOnHeap() << endl; 1388 1394 1389 if (TestBit(kExitLoopOnExit)) 1395 if (TestBit(kExitLoopOnExit) || TestBit(kExitLoopOnClose)) 1396 { 1397 gLog << dbg << "CloseWindow() calling ExitLoop." << endl; 1390 1398 gSystem->ExitLoop(); 1391 if (TestBit(kExitLoopOnClose)) 1392 gSystem->ExitLoop(); 1399 } 1393 1400 1394 1401 if (fIsLocked<=0 && IsOnHeap()) 1402 { 1403 gLog << dbg << "delete MStatusDisplay;" << endl; 1395 1404 delete this; 1405 } 1396 1406 fStatus = kFileExit; 1407 gLog << dbg << "MStatusDisplay.fStatus=kFileExit;" << endl; 1397 1408 } 1398 1409 … … 2117 2128 */ 2118 2129 2119 //Bool_t wchanged = w!=GetWidth();2130 Bool_t wchanged = w!=GetWidth(); 2120 2131 Bool_t hchanged = h!=GetHeight(); 2121 /* 2132 2122 2133 if (!wchanged && !hchanged) 2123 2134 { 2124 2135 Layout(); 2125 2136 // FIXME: Make sure that this doesn't result in endless loops. 2126 //return kTRUE;2127 } 2128 */ 2137 return kTRUE; 2138 } 2139 2129 2140 2130 2141 if (GetWidth()==1 && GetHeight()==1) … … 2149 2160 Bool_t MStatusDisplay::HandleEvent(Event_t *event) 2150 2161 { 2162 #if ROOT_VERSION_CODE == ROOT_VERSION(3,05,07) 2163 // Strange... crashes on the LP machines... 2164 if (event->fType==kClientMessage) 2165 if (event->fHandle == gROOT_MESSAGE) 2166 if (event->fUser[0]==264 && event->fUser[1] == 0 && event->fUser[2]==0) 2167 return kTRUE; 2168 #endif 2169 2151 2170 Bool_t rc = TGMainFrame::HandleEvent(event); 2152 2171 -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r2550 r2563 56 56 enum 57 57 { 58 kExitLoopOnExit = BIT(14), 59 kExitLoopOnClose = BIT(15) 58 // TGMainFrame::kDontCallClose = BIT(14) 59 kExitLoopOnExit = BIT(15), 60 kExitLoopOnClose = BIT(16) 60 61 }; 61 62 62 63 protected: 64 MLog *fLog; 63 65 MGList *fList; 64 66 TGCompositeFrame *fUserFrame; … … 80 82 TString fPrinter; 81 83 82 MLog *fLog;83 84 Int_t fLogIdx; 84 85 TTimer fLogTimer; … … 179 180 void UnLock() { if (fIsLocked>0) fIsLocked--; } 180 181 182 void Reset(); 183 181 184 Bool_t CheckTabForCanvas(int num) const; 182 185
Note:
See TracChangeset
for help on using the changeset viewer.