00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4WinCondView.h"
00017
00018 #include "Riostream.h"
00019
00020 #include "RVersion.h"
00021 #include "Buttons.h"
00022 #include "TPad.h"
00023
00024 #include "TGo4WinCond.h"
00025
00026 TGo4WinCondView::TGo4WinCondView(Double_t x1,Double_t y1,Double_t x2,Double_t y2)
00027 :TBox(x1,y1,x2,y2), fxWinCondition(0)
00028 {
00029 SetBit(kMustCleanup);
00030 }
00031
00032 TGo4WinCondView::TGo4WinCondView()
00033 : TBox(),fxWinCondition(0)
00034 {
00035 SetBit(kMustCleanup);
00036 }
00037
00038 TGo4WinCondView::~TGo4WinCondView()
00039 {
00040 }
00041
00042 void TGo4WinCondView::Paint(Option_t* opt)
00043 {
00044 if(fxWinCondition) TBox::Paint(opt);
00045
00046
00047
00048
00049
00050
00051 }
00052 void TGo4WinCondView::ExecuteEvent(Int_t event, Int_t px, Int_t py)
00053 {
00054
00055
00056
00057
00058 if(gPad==0) return;
00059 TBox::ExecuteEvent(event,px,py);
00060 if(event==kButton1Up && fxWinCondition)
00061 {
00062 Pop();
00063 fxWinCondition->ResetLabel("pop");
00064
00065 Double_t epsilon=fxWinCondition->GetUpdateEpsilon();
00066 Double_t xmin=0;
00067 Double_t xmax=0;
00068 Double_t ymin=0;
00069 Double_t ymax=0;
00070 Int_t dim=0;
00071 fxWinCondition->GetValues(dim,xmin,xmax,ymin, ymax);
00072
00073
00074
00075
00076
00077
00078
00079 #if ROOT_VERSION_CODE < ROOT_VERSION(4,3,2)
00080
00081
00082
00083 Double_t X1=gPad->PadtoX(GetX1());
00084 Double_t X2=gPad->PadtoX(GetX2());
00085 Double_t Y1=gPad->PadtoY(GetY1());
00086 Double_t Y2=gPad->PadtoY(GetY2());
00087 #else
00088 Double_t X1=GetX1();
00089 Double_t X2=GetX2();
00090 Double_t Y1=GetY1();
00091 Double_t Y2=GetY2();
00092 #endif
00093
00094
00095
00096
00097
00098
00099 if(dim>1)
00100 {
00101
00102 if((TMath::Abs(xmin-X1) > epsilon) ||
00103 (TMath::Abs(xmax-X2) > epsilon) ||
00104 (TMath::Abs(ymin-Y1) > epsilon) ||
00105 (TMath::Abs(ymax-Y2) > epsilon) )
00106 {
00107
00108 fxWinCondition->SetValues(X1, X2, Y1, Y2 );
00109 fxWinCondition->SetLineColor(GetLineColor());
00110 fxWinCondition->SetLineWidth(GetLineWidth());
00111 fxWinCondition->SetLineStyle(GetLineStyle());
00112 fxWinCondition->SetFillColor(GetFillColor());
00113 fxWinCondition->SetFillStyle(GetFillStyle());
00114 fxWinCondition->SetChanged(kTRUE);
00115 }
00116 }
00117 else
00118 {
00119 if((TMath::Abs(xmin-X1) > epsilon) ||
00120 (TMath::Abs(xmax-X2) > epsilon) )
00121 {
00122
00123 fxWinCondition->SetValues(X1, X2);
00124 fxWinCondition->SetLineColor(GetLineColor());
00125 fxWinCondition->SetLineWidth(GetLineWidth());
00126 fxWinCondition->SetLineStyle(GetLineStyle());
00127 fxWinCondition->SetFillColor(GetFillColor());
00128 fxWinCondition->SetFillStyle(GetFillStyle());
00129 fxWinCondition->SetChanged(kTRUE);
00130 }
00131 }
00132 }
00133 }
00134
00135 const char* TGo4WinCondView::GetName() const
00136 {
00137 if(fxWinCondition)
00138 return (fxWinCondition->GetName());
00139 else
00140 return 0;
00141 }
00142
00143
00144 void TGo4WinCondView::SetName(const Text_t* nam)
00145 {
00146 if(fxWinCondition) fxWinCondition->SetName(nam);
00147 }
00148
00149 void TGo4WinCondView::SetToLimits(Double_t x1, Double_t x2, Double_t y1, Double_t y2)
00150 {
00151 if(fxWinCondition==0) return;
00152 if(fxWinCondition->GetDimension()>1)
00153 fxWinCondition->SetValues(x1,x2,y1,y2);
00154 else
00155 fxWinCondition->SetValues(x1,x2);
00156 }
00157
00158
00159 void TGo4WinCondView::SetLabelDraw(Bool_t on)
00160 {
00161 if(fxWinCondition) fxWinCondition->SetLabelDraw(on);
00162 }
00163 void TGo4WinCondView::SetLimitsDraw(Bool_t on)
00164 {
00165 if(fxWinCondition) fxWinCondition->SetLimitsDraw(on);
00166 }
00167
00168 void TGo4WinCondView::SetIntDraw(Bool_t on)
00169 {
00170 if(fxWinCondition) fxWinCondition->SetIntDraw(on);
00171 }
00172
00173 void TGo4WinCondView::SetXMeanDraw(Bool_t on)
00174 {
00175 if(fxWinCondition) fxWinCondition->SetXMeanDraw(on);
00176 }
00177
00178 void TGo4WinCondView::SetYMeanDraw(Bool_t on)
00179 {
00180 if(fxWinCondition) fxWinCondition->SetYMeanDraw(on);
00181 }
00182
00183 void TGo4WinCondView::SetXRMSDraw(Bool_t on)
00184 {
00185 if(fxWinCondition) fxWinCondition->SetXRMSDraw(on);
00186 }
00187
00188 void TGo4WinCondView::SetYRMSDraw(Bool_t on)
00189 {
00190 if(fxWinCondition) fxWinCondition->SetYRMSDraw(on);
00191 }
00192
00193 void TGo4WinCondView::SetXMaxDraw(Bool_t on)
00194 {
00195 if(fxWinCondition) fxWinCondition->SetXMaxDraw(on);
00196 }
00197
00198 void TGo4WinCondView::SetYMaxDraw(Bool_t on)
00199 {
00200 if(fxWinCondition) fxWinCondition->SetYMaxDraw(on);
00201 }
00202
00203 void TGo4WinCondView::SetCMaxDraw(Bool_t on)
00204 {
00205 if(fxWinCondition) fxWinCondition->SetCMaxDraw(on);
00206 }
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217 void TGo4WinCondView::SaveLabelStyle()
00218 {
00219 if(fxWinCondition) fxWinCondition->SaveLabelStyle();
00220 }
00221
00222 void TGo4WinCondView::ResetLabel()
00223 {
00224 if(fxWinCondition) fxWinCondition->ResetLabel();
00225 }
00226
00227
00228