LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ParameterSetEditDialog.h
Go to the documentation of this file.
1 #ifndef EVDB_PARAMETERSETEDITDIALOG_H
63 #define EVDB_PARAMETERSETEDITDIALOG_H
64 #include "TQObject.h"
65 #include "RQ_OBJECT.h"
66 #include "TGFrame.h"
67 class TGTab;
68 class TGCanvas;
69 class TGTableLayout;
70 class TGTableLayoutHints;
71 class TGListBox;
72 class TGDoubleSlider;
73 class TGTextEntry;
74 class TGRadioButton;
75 class TGCheckButton;
76 namespace fhicl { class ParameterSet; }
77 
78 namespace evdb
79 {
80  class ParameterSetEditFrame;
86  {
87  RQ_OBJECT("evdb::ParameterSetEditRow")
88  public:
90  TGHorizontalFrame* lhs,
91  TGHorizontalFrame* rhs,
92  const fhicl::ParameterSet& ps,
93  const std::string& key);
95 
96  void Finalize();
97  std::string AsFHICL() const;
98 
99  void TextEntryReturnPressed();
100  void ListBoxSelectionChanged();
101  void ListBoxSelected(int id);
102  void RadioButtonClicked();
103  void CheckButtonClicked();
104  void SliderPositionChanged();
105 
106  private:
107  void SetupTextEntry(TGCompositeFrame* f,
108  unsigned int flags,
109  const std::vector<std::string>& value);
110 
111  void SetupListBox(TGCompositeFrame* f,
112  const std::vector<std::string>& choice,
113  const std::vector<std::string>& value,
114  bool ismulti);
115 
116  void SetupRadioButtons(TGCompositeFrame* f,
117  const std::vector<std::string>& choice,
118  const std::vector<std::string>& value);
119 
120  void SetupCheckButton(TGCompositeFrame* f,
121  const std::vector<std::string>& choice,
122  const std::vector<std::string>& value);
123 
124  void SetupSlider(TGCompositeFrame* f,
125  const std::vector<std::string>& choice,
126  const std::vector<std::string>& value);
127 
128  private:
129  static bool IsLegalGUItag(const std::string& s);
130  static void ParseGUItag(const std::string& guitag,
131  std::string& frame,
132  std::vector<std::string>& choice);
133  static void UnpackParameter(const fhicl::ParameterSet& ps,
134  const std::string& key,
135  unsigned int& flags,
136  std::string& tag,
137  std::vector<std::string>& choice,
138  std::vector<std::string>& value,
139  std::string& gui,
140  std::string& doc);
141  public:
143  public:
144  TGHorizontalFrame* fMother;
145  TGLayoutHints* fRightLH;
146  TGLayoutHints* fLeftLH;
147  TGTextButton* fLabel;
148  public:
149  TGTextEntry* fTextEntry;
150  TGListBox* fListBox;
151  TGDoubleSlider* fSlider;
152  std::vector<TGRadioButton*> fRadioButton;
153  std::vector<TGCheckButton*> fCheckButton;
154  public:
155  unsigned int fParamFlags;
156  std::string fKEY;
157  std::string fGUI;
158  std::string fDOC;
159  std::vector<std::string> fChoice;
160  std::string fValue;
161  };
162 
168  {
169  RQ_OBJECT("evdb:ParameterSetEditFrame")
170  public:
171 
172  ParameterSetEditFrame(TGCompositeFrame* mother, unsigned int psetid);
174 
175  std::string AsFHICL() const;
176 
177  void HandleMouseWheel(Event_t *event);
178  void Modified();
179  void Finalize();
180 
181  public:
182  TGCompositeFrame* fTopFrame;
183  TGCanvas* fCanvas;
184  TGLayoutHints* fCanvasH;
185  TGCompositeFrame* fContainer;
186  TGTableLayout* fLayout;
187  std::vector<TGHorizontalFrame*> fLHS;
188  std::vector<TGHorizontalFrame*> fRHS;
189  std::vector<TGTableLayoutHints*> fLHSHints;
190  std::vector<TGTableLayoutHints*> fRHSHints;
191  std::vector<ParameterSetEditRow*> fRow;
192  public:
193  unsigned int fParameterSetID;
195  };
196 
201  class ParameterSetEditDialog : public TGTransientFrame
202  {
203  RQ_OBJECT("evdb::ParameterSetEditDialog")
204  public:
205  ParameterSetEditDialog(unsigned int psetid);
207 
208  void Apply();
209  void Cancel();
210  void Done();
211  void CloseWindow();
212  std::string TabName(const std::string& s);
213 
214  private:
215  TGTab* fTGTab;
216  TGHorizontalFrame* fButtons;
217  TGTextButton* fApply;
218  TGTextButton* fCancel;
219  TGTextButton* fDone;
220  private:
221  unsigned int fParameterSetID;
222  std::vector<ParameterSetEditFrame*> fFrames;
223 
224  ClassDef(ParameterSetEditDialog, 0);
225  };
226 }
227 
228 #endif
229 
Float_t s
Definition: plot.C:23
std::vector< TGRadioButton * > fRadioButton
std::vector< ParameterSetEditRow * > fRow
TGLayoutHints * fRightLH
Align to right.
Manage all things related to colors for the event display.
ParameterSetEditFrame * fFrame
The parent frame.
TFile f
Definition: plotHisto.C:6
std::vector< std::string > fChoice
TGLayoutHints * fLeftLH
Align to left.
std::vector< TGTableLayoutHints * > fRHSHints
Top-level interface to all parameter sets.
std::vector< TGHorizontalFrame * > fLHS
parameter set interface
TGHorizontalFrame * fMother
Top level frame.
A frame for editing a single paramter set.
std::vector< TGTableLayoutHints * > fLHSHints
std::vector< TGHorizontalFrame * > fRHS
std::string value(boost::any const &)
A single row for editing a single parameter in a set.
void Finalize()
Definition: errprop.cc:257
std::vector< ParameterSetEditFrame * > fFrames
std::vector< TGCheckButton * > fCheckButton
Event finding and building.
c1 Modified()
TGTextButton * fLabel
Label on the left.