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