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 = 2 -> ERROR |
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 2 -> ERROR |
459 |
Int_t retval; |
Int_t retval; |
460 |
TString title; |
TString title; |
461 |
EMsgBoxIcon mb_icon = kMBIconStop; |
EMsgBoxIcon mb_icon = kMBIconStop; |
462 |
if ( ty == 2 ){ |
if ( ty == 2 || ty == 3 ){ |
463 |
|
if ( ty == 2 ){ |
464 |
title="ERROR!!"; |
title="ERROR!!"; |
465 |
mb_icon = kMBIconStop; |
mb_icon = kMBIconStop; |
466 |
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
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 { |
} else { |
473 |
if ( ty == 0 ){ |
if ( ty == 0 ){ |
474 |
title="INFO"; |
title="INFO"; |
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; |
const TGPicture *icon_pic; |
486 |
switch (mb_icon) { |
switch (mb_icon) { |
487 |
case kMBIconStop: |
case kMBIconStop: |
509 |
break; |
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); |
TGTransientFrame *compofra = new TGTransientFrame(gClient->GetRoot(), 0, 200, 80, kHorizontalFrame); |
525 |
TGHorizontalFrame *fIconFrame = new TGHorizontalFrame(compofra, 98, 78); |
TGHorizontalFrame *fIconFrame = NULL; |
526 |
TGIcon *fIcon = new TGIcon(fIconFrame, icon_pic, icon_pic->GetWidth(), icon_pic->GetHeight()); |
TGIcon *fIcon = NULL; |
527 |
fIconFrame->AddFrame(fIcon, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
if ( ty != 4 ){ |
528 |
compofra->AddFrame(fIconFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
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); |
TGHorizontalFrame *fLabelFrame = new TGHorizontalFrame(compofra, 98, 78); |
536 |
TGLabel *la=new TGLabel(fLabelFrame,warn.Data()); |
TGLabel *la=new TGLabel(fLabelFrame,warn.Data()); |
540 |
// |
// |
541 |
compofra->SetWindowName(title.Data()); |
compofra->SetWindowName(title.Data()); |
542 |
compofra->MapSubwindows(); |
compofra->MapSubwindows(); |
543 |
compofra->Resize(compofra->GetDefaultWidth(),80); |
if ( ty != 4 ){ |
544 |
|
compofra->Resize(compofra->GetDefaultWidth(),80); |
545 |
|
} else { |
546 |
|
compofra->Resize(compofra->GetDefaultSize()); |
547 |
|
}; |
548 |
compofra->CenterOnParent(); |
compofra->CenterOnParent(); |
549 |
compofra->MapWindow(); |
compofra->MapWindow(); |
550 |
// |
// |
551 |
Int_t kkk = 0; |
if ( ty != 4 ){ |
552 |
while ( kkk < 200 ){ |
Int_t kkk = 0; |
553 |
gSystem->ProcessEvents(); |
while ( kkk < 200 ){ |
554 |
gSystem->Sleep(10); |
gSystem->ProcessEvents(); |
555 |
kkk++; |
gSystem->Sleep(10); |
556 |
|
kkk++; |
557 |
|
}; |
558 |
}; |
}; |
559 |
if ( compofra ){ |
if ( compofra && ty != 4 ){ |
560 |
la->Delete(); |
la->Delete(); |
561 |
fLabelFrame->Delete(); |
fLabelFrame->Delete(); |
562 |
fIcon->Delete(); |
if ( fIcon ) fIcon->Delete(); |
563 |
fIconFrame->Delete(); |
if ( fIconFrame ) fIconFrame->Delete(); |
564 |
compofra->DestroyWindow(); |
compofra->DestroyWindow(); |
565 |
compofra->Delete(); |
compofra->Delete(); |
566 |
}; |
}; |