441 |
// |
// |
442 |
} |
} |
443 |
|
|
444 |
|
void PAMevcontrol::Refresh(){ |
445 |
|
// bah |
446 |
|
return; |
447 |
|
this->Clear(); |
448 |
|
MapSubwindows(); |
449 |
|
// Initialize the layout algorithm |
450 |
|
Resize(GetDefaultSize()); |
451 |
|
// Map main frame |
452 |
|
MapWindow(); |
453 |
|
} |
454 |
|
|
455 |
void PAMevcontrol::DIALOG(Int_t ty, TString warn){ |
void PAMevcontrol::DIALOG(Int_t ty, TString warn){ |
456 |
// |
// |
457 |
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 3 -> ERROR |
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 2 -> ERROR |
458 |
// |
// |
459 |
Int_t retval; |
Int_t retval; |
460 |
TString title; |
TString title; |
461 |
EMsgBoxIcon mb_icon = kMBIconStop; |
EMsgBoxIcon mb_icon = kMBIconStop; |
462 |
if ( ty == 0 ){ |
if ( ty == 2 || ty == 3 ){ |
463 |
|
if ( ty == 2 ){ |
464 |
|
title="ERROR!!"; |
465 |
|
mb_icon = kMBIconStop; |
466 |
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
467 |
|
} else { |
468 |
|
title="HELP"; |
469 |
|
mb_icon = kMBIconQuestion; |
470 |
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
471 |
|
}; |
472 |
|
} else { |
473 |
|
if ( ty == 0 ){ |
474 |
title="INFO"; |
title="INFO"; |
475 |
mb_icon = kMBIconAsterisk; |
mb_icon = kMBIconAsterisk; |
476 |
}; |
}; |
477 |
if ( ty == 1 ){ |
if ( ty == 1 ){ |
478 |
title="WARNING!"; |
title="WARNING!"; |
479 |
mb_icon = kMBIconExclamation; |
mb_icon = kMBIconExclamation; |
480 |
|
}; |
481 |
|
if ( ty == 4 ){ |
482 |
|
title="DATA"; |
483 |
|
mb_icon = kMBIconExclamation; |
484 |
|
}; |
485 |
|
const TGPicture *icon_pic; |
486 |
|
switch (mb_icon) { |
487 |
|
case kMBIconStop: |
488 |
|
icon_pic = gClient->GetPicture("mb_stop_s.xpm"); |
489 |
|
if (!icon_pic) Error("TGMsgBox", "mb_stop_s.xpm not found"); |
490 |
|
break; |
491 |
|
|
492 |
|
case kMBIconQuestion: |
493 |
|
icon_pic = gClient->GetPicture("mb_question_s.xpm"); |
494 |
|
if (!icon_pic) Error("TGMsgBox", "mb_question_s.xpm not found"); |
495 |
|
break; |
496 |
|
|
497 |
|
case kMBIconExclamation: |
498 |
|
icon_pic = gClient->GetPicture("mb_exclamation_s.xpm"); |
499 |
|
if (!icon_pic) Error("TGMsgBox", "mb_exclamation_s.xpm not found"); |
500 |
|
break; |
501 |
|
|
502 |
|
case kMBIconAsterisk: |
503 |
|
icon_pic = gClient->GetPicture("mb_asterisk_s.xpm"); |
504 |
|
if (!icon_pic) Error("TGMsgBox", "mb_asterisk_s.xpm not found"); |
505 |
|
break; |
506 |
|
|
507 |
|
default: |
508 |
|
icon_pic = 0; |
509 |
|
break; |
510 |
|
} |
511 |
|
// |
512 |
|
if ( ty == 4 ){// non funziona il recupero dei puntatori a questi oggetti come e` possibile? |
513 |
|
// gObjectTable->Print(); |
514 |
|
TGLabel *la=dynamic_cast<TGLabel*>(gDirectory->FindObject("la")); |
515 |
|
TGHorizontalFrame *fLabelFrame=dynamic_cast<TGHorizontalFrame*>(gDirectory->FindObject("fLabelFrame")); |
516 |
|
TGTransientFrame *compofra=dynamic_cast<TGTransientFrame*>(gDirectory->FindObject("compofra")); |
517 |
|
if ( la ) la->Delete(); |
518 |
|
if ( fLabelFrame ) fLabelFrame->Delete(); |
519 |
|
if ( compofra ){ |
520 |
|
compofra->DestroyWindow(); |
521 |
|
compofra->Delete(); |
522 |
|
}; |
523 |
|
}; |
524 |
|
TGTransientFrame *compofra = new TGTransientFrame(gClient->GetRoot(), 0, 200, 80, kHorizontalFrame); |
525 |
|
TGHorizontalFrame *fIconFrame = NULL; |
526 |
|
TGIcon *fIcon = NULL; |
527 |
|
if ( ty != 4 ){ |
528 |
|
compofra->DontCallClose(); |
529 |
|
fIconFrame = new TGHorizontalFrame(compofra, 98, 78); |
530 |
|
fIcon = new TGIcon(fIconFrame, icon_pic, icon_pic->GetWidth(), icon_pic->GetHeight()); |
531 |
|
fIconFrame->AddFrame(fIcon, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
532 |
|
compofra->AddFrame(fIconFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
533 |
|
}; |
534 |
|
// |
535 |
|
TGHorizontalFrame *fLabelFrame = new TGHorizontalFrame(compofra, 98, 78); |
536 |
|
TGLabel *la=new TGLabel(fLabelFrame,warn.Data()); |
537 |
|
la->SetTextJustify(kLHintsCenterX); |
538 |
|
fLabelFrame->AddFrame(la, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
539 |
|
compofra->AddFrame(fLabelFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
540 |
|
// |
541 |
|
compofra->SetWindowName(title.Data()); |
542 |
|
compofra->MapSubwindows(); |
543 |
|
if ( ty != 4 ){ |
544 |
|
compofra->Resize(compofra->GetDefaultWidth(),80); |
545 |
|
} else { |
546 |
|
compofra->Resize(compofra->GetDefaultSize()); |
547 |
|
}; |
548 |
|
compofra->CenterOnParent(); |
549 |
|
compofra->MapWindow(); |
550 |
|
// |
551 |
|
if ( ty != 4 ){ |
552 |
|
Int_t kkk = 0; |
553 |
|
while ( kkk < 200 ){ |
554 |
|
gSystem->ProcessEvents(); |
555 |
|
gSystem->Sleep(10); |
556 |
|
kkk++; |
557 |
|
}; |
558 |
|
}; |
559 |
|
if ( compofra && ty != 4 ){ |
560 |
|
la->Delete(); |
561 |
|
fLabelFrame->Delete(); |
562 |
|
if ( fIcon ) fIcon->Delete(); |
563 |
|
if ( fIconFrame ) fIconFrame->Delete(); |
564 |
|
compofra->DestroyWindow(); |
565 |
|
compofra->Delete(); |
566 |
|
}; |
567 |
}; |
}; |
568 |
if ( ty == 2 ){ |
// |
|
title="ERROR!!"; |
|
|
mb_icon = kMBIconStop; |
|
|
}; |
|
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
|
569 |
} |
} |
570 |
|
|
571 |
void PAMevcontrol::refreshdec(Int_t n){ |
void PAMevcontrol::refreshdec(Int_t n){ |