7 #include <TGTextEntry.h>
14 using std::stringstream;
17 TGCompositeFrame(p, w, h),
18 fHistogramEditWindow(p)
20 SetCleanup(kDeepCleanup);
22 fXFrame =
new TGHorizontalFrame(
this, w, 25);
23 AddFrame(
fXFrame,
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 0, 0, 0));
26 fXFrame->AddFrame(
fXLabel,
new TGLayoutHints(kLHintsCenterY, 0, 0, 0, 0));
29 fXFrame->AddFrame(
fXDropDownBox,
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 0, 0, 0));
32 fXDropDownBox->GetTextEntry()->SetToolTipText(
"Enter x-axis variable");
38 fXUnitsBox->SetToolTipText(
"Enter x-axis units");
42 AddFrame(
fMinMaxFrame,
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 0, 2, 0));
48 fMinMaxFrame->AddFrame(
fXMinBox,
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 0, 0, 0));
49 fXMinBox->Resize(GetDefaultWidth(), 25);
50 fXMinBox->SetToolTipText(
"Enter x-axis minimum");
51 fXMinBox->Connect(
"ProcessedEvent(Event_t*)",
"QGHistogramParametersFrame",
this,
"HandleXMinEvent(Event_t*)");
57 fMinMaxFrame->AddFrame(
fXMaxBox,
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 0, 0, 0));
58 fXMaxBox->Resize(GetDefaultWidth(), 25);
59 fXMaxBox->SetToolTipText(
"Enter x-axis maximum");
60 fXMaxBox->Connect(
"ProcessedEvent(Event_t*)",
"QGHistogramParametersFrame",
this,
"HandleXMaxEvent(Event_t*)");
62 fBinsFrame =
new TGHorizontalFrame(
this, w, 25);
63 AddFrame(
fBinsFrame,
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 0, 2, 0));
72 fNumberOfBinsBox->Connect(
"ProcessedEvent(Event_t*)",
"QGHistogramParametersFrame",
this,
"HandleNumberOfBinsEvent(Event_t*)");
81 fBinWidthBox->Connect(
"ProcessedEvent(Event_t*)",
"QGHistogramParametersFrame",
this,
"HandleBinWidthEvent(Event_t*)");
85 fSuperimposeBox->SetToolTipText(
"Check to superimpose histogram on existing histograms");
145 xmax =
fXMaxBox->GetDisplayText().Atof();
154 xmin =
fXMinBox->GetDisplayText().Atof();
171 if (event->fType == kGKeyPress) {
173 }
else if (event->fType == kFocusOut) {
181 if (event->fType == kGKeyPress) {
188 if (event->fType == kGKeyPress) {
195 if (event->fType == kGKeyPress) {
217 return fXMaxBox->GetDisplayText().IsFloat();
222 return fXMinBox->GetDisplayText().IsFloat();
229 ss << width << flush;
254 fXMaxBox->SetText(ss.str().c_str());
264 fXMinBox->SetText(ss.str().c_str());
double min(const Diana::QVector &v)
Drop down box with tab-complete.
void SetReturnTarget(TGTextEntry *textBox)
Set return target.
void EnableTabCompletion()
Enable tab completion.
Class for histogram edit window.
Part of a histogram edit window for inputting parameters.
TGHorizontalFrame * fXFrame
Horizontal frame for x-axis variable.
QGTextEntry * fNumberOfBinsBox
Number of bins box.
TGHorizontalFrame * fMinMaxFrame
Horizontal frame for x-axis minimum and maximum.
Double_t GetXMax()
Get x-axis maximum.
void SetNumberOfBins(Int_t n)
Set the number of bins.
QGTextEntry * fXMaxBox
X-axis maximum box.
void HandleXMinEvent(Event_t *event)
Handle event in x-axis minimum box.
void SetXMin(Double_t min)
Set the x-axis minimum.
TGHorizontalFrame * fBinsFrame
Horizontal frame for bins parameters.
void AutoSetBinWidth()
Set bin width automatically.
void HandleNumberOfBinsEvent(Event_t *event)
Handle event in number of bins box.
TGLabel * fXLabel
X label.
void SetXVariable(const std::string &x)
Set the x-axis variable.
std::string GetXUnits()
Get x-axis units.
QGHistogramParametersFrame(QGHistogramEditWindow *p=0, UInt_t w=100, UInt_t h=100)
Constructor.
QGDropDownBox * fXDropDownBox
X-axis variable drop down box.
void SetSuperimpose(bool flag=true)
Set whether the superimpose box is checked.
void HandleXMaxEvent(Event_t *event)
Handle event in x-axis maximum box.
void SetBinWidth(Double_t width)
Set the bin width.
bool IsXMaxSet()
Return true if x-axis maximum is set.
Int_t GetNumberOfBins()
Get number of bins.
void SetXUnits(const std::string &units)
Set the x-axis units.
TGCheckButton * fSuperimposeBox
Superimpose check box.
Double_t GetXMin()
Get x-axis minimum.
bool IsBinWidthSet()
Handle event in x-axis units box.
QGTextEntry * fBinWidthBox
Bin width box.
void HandleBinWidthEvent(Event_t *event)
Handle event in bin width box.
virtual ~QGHistogramParametersFrame()
Destructor.
bool IsNumberOfBinsSet()
Return true if number of bins is set.
void SetXMax(Double_t max)
Set the x-axis maximum.
QGTextEntry * fXMinBox
X-axis minimum box.
QGTextEntry * fXUnitsBox
X-axis units box.
bool IsSuperimposeSet()
Return true if superimpose box is checked.
bool IsXMinSet()
Return true if x-axis minimum is set.
std::string GetXVariable()
Get x-axis variable.
Double_t GetBinWidth()
Get bin width.
void AutoSetNumberOfBins()
Set number of bins automatically.
TGLabel * fBinWidthLabel
Bin width label.
TGLabel * fNumberOfBinsLabel
Number of bins label.
Extension of ROOT's basic text box TGTextEntry.
void SetTabTarget(TGTextEntry *textBox)
Set text box to tab to.