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