#include "hconsistencywarn.h"
#include "hconsistency.h"
#include "honlinecontrol.h"
#include "hlocalcont.h"
#include "hglobalcont.h"
#include "hhistocont.h"
#include "hlocalcondition.h"
#include "hglobalcondition.h"
#include "hhistogram.h"
#include "TGLabel.h"
ClassImp(HConsistencyWarn)
HConsistencyWarn::HConsistencyWarn(const TGWindow *p, UInt_t w, UInt_t h,
Int_t* retcode) :
TGMainFrame(p, w, h) {
fFrame = new TGCompositeFrame(this, 500, 500, kVerticalFrame);
AddFrame(fFrame, new TGLayoutHints(kLHintsNormal));
fF1 = new TGCompositeFrame(fFrame, 500, 80, kVerticalFrame);
fFrame->AddFrame(fF1, new TGLayoutHints(kLHintsNormal));
fF2 = new TGCompositeFrame(fFrame, 500, 300, kHorizontalFrame);
fFrame->AddFrame(fF2, new TGLayoutHints(kLHintsNormal));
fF3 = new TGCompositeFrame(fFrame, 500, 100, kHorizontalFrame);
fFrame->AddFrame(fF3, new TGLayoutHints(kLHintsNormal));
fF1->AddFrame(new TGLabel(fF1, new TGHotString("following")),
new TGLayoutHints(kLHintsNormal|kLHintsCenterX, 2,2,2,2));
fF1->AddFrame(new TGLabel(fF1,
new TGHotString("local conditions global conditions histogrammes")),
new TGLayoutHints(kLHintsNormal|kLHintsCenterX, 20,2,2,2));
fF1->AddFrame(new TGLabel(fF1, new TGHotString("will be inconsistent")),
new TGLayoutHints(kLHintsNormal|kLHintsCenterX, 20,2,2,2));
fLCList = new TGListBox(fF2,-1);
fLCList->Associate(this);
fF2->AddFrame(fLCList, new TGLayoutHints(kLHintsNormal,2,2,2,2));
fLCList->Resize(110,150);
fGCList = new TGListBox(fF2,-1);
fGCList->Associate(this);
fF2->AddFrame(fGCList, new TGLayoutHints(kLHintsNormal,5,5,2,2));
fGCList->Resize(110,150);
fHiList = new TGListBox(fF2,-1);
fHiList->Associate(this);
fF2->AddFrame(fHiList, new TGLayoutHints(kLHintsNormal,2,2,2,2));
fHiList->Resize(110,150);
fDelete = new TGTextButton(fF3,"Delete ",10);
fDelete->Associate(this);
fDelete->SetToolTipText("Delete all inconsistent objects");
fF3->AddFrame(fDelete, new TGLayoutHints(kLHintsNormal,120,2,8,8));
fCancel = new TGTextButton(fF3,"Cancel",11);
fCancel->Associate(this);
fCancel->SetToolTipText("Close the window");
fF3->AddFrame(fCancel, new TGLayoutHints(kLHintsNormal,10,2,8,8));
fRetCode = retcode;
fillList();
MapSubwindows();
SetWindowName("Consistency Check Results");
Resize(GetDefaultSize());
MapWindow();
fClient->WaitFor(this);
}
HConsistencyWarn::~HConsistencyWarn() {
delete fCancel;
delete fDelete;
delete fHiList;
delete fGCList;
delete fLCList;
delete fF3;
delete fF2;
delete fF1;
delete fFrame;
}
void HConsistencyWarn::CloseWindow() {
delete this;
}
Bool_t HConsistencyWarn::ProcessMessage(Long_t msg,Long_t parm1,Long_t parm2) {
switch(GET_MSG(msg)) {
case kC_COMMAND:
switch(GET_SUBMSG(msg)) {
case kCM_BUTTON:
switch(parm1) {
case 10:
if(fRetCode) *fRetCode = 1;
CloseWindow();
break;
case 11:
if(fRetCode) *fRetCode = 2;
CloseWindow();
break;
default:
break;
}
default:
break;
}
default:
break;
}
return kTRUE;
}
void HConsistencyWarn::fillList() {
if(!gOnline) return;
Int_t i;
Int_t j;
HLocalCondition *pLocal = 0;
HGlobalCondition *pGlobal = 0;
HHistogram *pHisto = 0;
j = 0;
for(i=0; i < (*gOnline->getConsistency()).fLCIdx.fN; i++) {
if((*gOnline->getConsistency()).fLCIdx[i] == 1) {
pLocal = gOnline->getLocal()->at(i);
if(pLocal) fLCList->AddEntry(pLocal->GetName(),++j);
}
}
j = 0;
for(i=0; i < (*gOnline->getConsistency()).fGCIdx.fN; i++) {
if((*gOnline->getConsistency()).fGCIdx[i] == 1) {
pGlobal = gOnline->getGlobal()->at(i);
if(pGlobal) fGCList->AddEntry(pGlobal->GetName(),++j);
}
}
j = 0;
for(i=0; i < (*gOnline->getConsistency()).fHiIdx.fN; i++) {
if((*gOnline->getConsistency()).fHiIdx[i] == 1) {
pHisto = gOnline->getHisto()->at(i);
if(pHisto) fHiList->AddEntry(pHisto->GetName(),++j);
}
}
}
Last change: Sat May 22 12:54:03 2010
Last generated: 2010-05-22 12:54
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.