Diana Software
QGScatterPlotParametersFrame.cc
Go to the documentation of this file.
2 #include <sstream>
3 #include "QGDropDownBox.hh"
5 #include "QGTextEntry.hh"
6 #include <TGLabel.h>
7 #include <TGTextEntry.h>
8 
10 
11 using std::flush;
12 using std::string;
13 using std::stringstream;
14 
16 TGCompositeFrame(p, w, h),
17 fScatterPlotEditWindow(p)
18 {
19  SetCleanup(kDeepCleanup);
20 
21  fXFrame = new TGHorizontalFrame(this, w, 25);
22  AddFrame(fXFrame, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0)); // remove CenterY ?
23 
24  fXLabel = new TGLabel(fXFrame, "X:");
25  fXFrame->AddFrame(fXLabel, new TGLayoutHints(kLHintsCenterY, 0, 0, 0, 0));
26 
28  fXFrame->AddFrame(fXDropDownBox, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 0, 0, 0));
30  fXDropDownBox->Resize(fXDropDownBox->GetDefaultWidth(), 25);
31  fXDropDownBox->GetTextEntry()->SetToolTipText("Enter x-axis variable");
32  //fXDropDownBox->GetTextEntry()->Connect("ProcessedEvent(Event_t*)", "QGScatterPlotParametersFrame", this, "HandleXVariableEvent(Event_t*)");
33 
35  fXFrame->AddFrame(fXUnitsBox, new TGLayoutHints(kLHintsCenterY, 0, 0, 0, 0));
36  fXUnitsBox->Resize(50, 25);
37  fXUnitsBox->SetToolTipText("Enter x-axis units");
38  //fXUnitsBox->Connect("ProcessedEvent(Event_t*)", "QGScatterPlotParametersFrame", this, "HandleXUnitsEvent(Event_t*)");
39 
40  fYFrame = new TGHorizontalFrame(this, w, 25);
41  AddFrame(fYFrame, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 0, 0, 0));
42 
43  fYLabel = new TGLabel(fYFrame, "Y:");
44  fYFrame->AddFrame(fYLabel, new TGLayoutHints(kLHintsCenterY, 0, 0, 0, 0));
45 
47  fYFrame->AddFrame(fYDropDownBox, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 0, 0, 0));
49  fYDropDownBox->Resize(GetDefaultWidth(), 25);
50  fYDropDownBox->GetTextEntry()->SetToolTipText("Enter y-axis variable");
51  //fYDropDownBox->GetTextEntry()->Connect("ProcessedEvent(Event_t*)", "QGScatterPlotParametersFrame", this, "HandleYVariableEvent(Event_t*)");
52 
54  fYFrame->AddFrame(fYUnitsBox, new TGLayoutHints(kLHintsCenterY, 0, 0, 0, 0));
55  fYUnitsBox->Resize(50, 25);
56  fYUnitsBox->SetToolTipText("Enter y-axis units");
57  //fYUnitsBox->Connect("ProcessedEvent(Event_t*)", "QGScatterPlotParametersFrame", this, "HandleYUnitsEvent(Event_t*)");
58 
59  fSuperimposeBox = new TGCheckButton(this, "Superimpose");
60  AddFrame(fSuperimposeBox, new TGLayoutHints(kLHintsLeft, 0, 0, 2, 0));
61  fSuperimposeBox->SetToolTipText("Check to superimpose scatter plot on existing scatter plots");
62 
64  fXUnitsBox->SetTabTarget(fYDropDownBox->GetTextEntry());
66 }
67 
69 {
70  Cleanup();
71 }
72 
74 {
75  return fXUnitsBox->GetText();
76 }
77 
79 {
80  return fXDropDownBox->GetTextEntry()->GetText();
81 }
82 
84 {
85  return fYUnitsBox->GetText();
86 }
87 
89 {
90  return fYDropDownBox->GetTextEntry()->GetText();
91 }
92 
94 {
95  return fSuperimposeBox->IsOn();
96 }
97 
99 {
100  if (flag == true) {
101  fSuperimposeBox->SetState(kButtonDown);
102  } else {
103  fSuperimposeBox->SetState(kButtonUp);
104  }
105 }
106 
108 {
109  fXUnitsBox->SetText(units.c_str());
110 }
111 
113 {
114  fXDropDownBox->GetTextEntry()->SetText(x.c_str());
115 }
116 
118 {
119  fYUnitsBox->SetText(units.c_str());
120 }
121 
123 {
124  fYDropDownBox->GetTextEntry()->SetText(y.c_str());
125 }
ClassImp(QObject)
Drop down box with tab-complete.
void SetReturnTarget(TGTextEntry *textBox)
Set return target.
void EnableTabCompletion()
Enable tab completion.
Class for scatter plot edit window.
Part of a scatter plot edit window for inputting parameters.
QGTextEntry * fXUnitsBox
x-axis units box
std::string GetXVariable()
Get x-axis variable.
void SetXUnits(const std::string &units)
Set the x-axis units.
QGDropDownBox * fXDropDownBox
x-axis variable drop down box
std::string GetYUnits()
Get y-axis units.
void SetYUnits(const std::string &units)
Set the y-axis units.
void SetYVariable(const std::string &y)
Set the y-axis variable.
QGTextEntry * fYUnitsBox
y-axis units box
void SetSuperimpose(bool flag=true)
Set whether the superimpose box is checked.
virtual ~QGScatterPlotParametersFrame()
Destructor.
bool IsSuperimposeSet()
Handle event in x-axis units box.
void SetXVariable(const std::string &x)
Set the x-axis variable.
TGHorizontalFrame * fXFrame
Horizontal frame for x-axis variable.
QGScatterPlotParametersFrame(QGScatterPlotEditWindow *p=0, UInt_t w=100, UInt_t h=100)
Constructor.
std::string GetYVariable()
Get y-axis variable.
std::string GetXUnits()
Get x-axis units.
QGDropDownBox * fYDropDownBox
y-axis variable drop down box
TGHorizontalFrame * fYFrame
Horizontal frame for y-axis variable.
TGCheckButton * fSuperimposeBox
Superimpose check box.
Extension of ROOT's basic text box TGTextEntry.
Definition: QGTextEntry.hh:13
void SetTabTarget(TGTextEntry *textBox)
Set text box to tab to.
Definition: QGTextEntry.cc:47