--- eventviewer/flight/src/FEVpamevcontrol.cpp 2009/06/12 12:37:28 1.9 +++ eventviewer/flight/src/FEVpamevcontrol.cpp 2009/06/15 14:17:21 1.10 @@ -448,19 +448,80 @@ Int_t retval; TString title; EMsgBoxIcon mb_icon = kMBIconStop; - if ( ty == 0 ){ + if ( ty == 2 ){ + title="ERROR!!"; + mb_icon = kMBIconStop; + new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); + } else { + if ( ty == 0 ){ title="INFO"; mb_icon = kMBIconAsterisk; - }; - if ( ty == 1 ){ + }; + if ( ty == 1 ){ title="WARNING!"; mb_icon = kMBIconExclamation; + }; + const TGPicture *icon_pic; + switch (mb_icon) { + case kMBIconStop: + icon_pic = gClient->GetPicture("mb_stop_s.xpm"); + if (!icon_pic) Error("TGMsgBox", "mb_stop_s.xpm not found"); + break; + + case kMBIconQuestion: + icon_pic = gClient->GetPicture("mb_question_s.xpm"); + if (!icon_pic) Error("TGMsgBox", "mb_question_s.xpm not found"); + break; + + case kMBIconExclamation: + icon_pic = gClient->GetPicture("mb_exclamation_s.xpm"); + if (!icon_pic) Error("TGMsgBox", "mb_exclamation_s.xpm not found"); + break; + + case kMBIconAsterisk: + icon_pic = gClient->GetPicture("mb_asterisk_s.xpm"); + if (!icon_pic) Error("TGMsgBox", "mb_asterisk_s.xpm not found"); + break; + + default: + icon_pic = 0; + break; + } + // + TGTransientFrame *compofra = new TGTransientFrame(gClient->GetRoot(), 0, 200, 80, kHorizontalFrame); + TGHorizontalFrame *fIconFrame = new TGHorizontalFrame(compofra, 98, 78); + TGIcon *fIcon = new TGIcon(fIconFrame, icon_pic, icon_pic->GetWidth(), icon_pic->GetHeight()); + fIconFrame->AddFrame(fIcon, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); + compofra->AddFrame(fIconFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); + // + TGHorizontalFrame *fLabelFrame = new TGHorizontalFrame(compofra, 98, 78); + TGLabel *la=new TGLabel(fLabelFrame,warn.Data()); + la->SetTextJustify(kLHintsCenterX); + fLabelFrame->AddFrame(la, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); + compofra->AddFrame(fLabelFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); + // + compofra->SetWindowName(title.Data()); + compofra->MapSubwindows(); + compofra->Resize(compofra->GetDefaultWidth(),80); + compofra->CenterOnParent(); + compofra->MapWindow(); + // + Int_t kkk = 0; + while ( kkk < 200 ){ + gSystem->ProcessEvents(); + gSystem->Sleep(10); + kkk++; + }; + if ( compofra ){ + la->Delete(); + fLabelFrame->Delete(); + fIcon->Delete(); + fIconFrame->Delete(); + compofra->DestroyWindow(); + compofra->Delete(); + }; }; - if ( ty == 2 ){ - title="ERROR!!"; - mb_icon = kMBIconStop; - }; - new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); + // } void PAMevcontrol::refreshdec(Int_t n){