KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVNameValueListGUI.h
Go to the documentation of this file.
1 
4 #ifndef __KVNAMEVALUELISTGUI_H
5 #define __KVNAMEVALUELISTGUI_H
6 
7 #include "TGFrame.h"
8 #include "RQ_OBJECT.h"
9 #include "KVNameValueList.h"
10 
11 #include <TGButton.h>
12 #include <TObjArray.h>
13 
32 
55  RQ_OBJECT("KVNameValueListGUI")
56 private:
59 
67 
70 
71 protected:
72  virtual TObject* AddAString(Int_t i, TGHorizontalFrame* hf);
73  virtual TObject* AddABool(Int_t i, TGHorizontalFrame* hf);
74  virtual TObject* AddADouble(Int_t i, TGHorizontalFrame* hf);
75  virtual TObject* AddAInt(Int_t i, TGHorizontalFrame* hf);
76 
77  TObject* GetDataWidget(int i) const
78  {
79  return fData[i];
80  }
82  {
83  return theList;
84  }
86  {
87  return fMain;
88  }
89  TObject* GetDataWidget(const TString& parname) const
90  {
92 
93  auto index = theList->GetNameIndex(parname);
94  if (index < 0) return nullptr;
95  return GetDataWidget(index);
96  }
97 
98 public:
99  KVNameValueListGUI(const TGWindow* main, KVNameValueList* params, Bool_t* cancel_pressed, Bool_t wait_for_main = kTRUE);
100 
101  virtual ~KVNameValueListGUI();
102 
103  void ReadData();
104  void RestoreData();
105  void DoClose();
106  void CloseWindow();
107 
108  bool EnableDependingOnBool(const TString& value_to_enable, const TString& bool_parameter);
109 
110  ClassDef(KVNameValueListGUI, 1) //GUI for setting KVNameValueList parameters
111  void DisplayDialog();
112 };
113 
114 #endif
int Int_t
unsigned int UInt_t
#define RQ_OBJECT(sender_class)
bool Bool_t
GUI for setting KVNameValueList parameters.
TObject * GetDataWidget(int i) const
TGTransientFrame * GetMain() const
ClassDef(KVNameValueListGUI, 1) void DisplayDialog()
virtual TObject * AddABool(Int_t i, TGHorizontalFrame *hf)
TGTransientFrame * fMain
virtual TObject * AddAString(Int_t i, TGHorizontalFrame *hf)
virtual TObject * AddAInt(Int_t i, TGHorizontalFrame *hf)
KVNameValueListGUI(const TGWindow *main, KVNameValueList *params, Bool_t *cancel_pressed, Bool_t wait_for_main=kTRUE)
Constructor.
bool EnableDependingOnBool(const TString &value_to_enable, const TString &bool_parameter)
virtual TObject * AddADouble(Int_t i, TGHorizontalFrame *hf)
TObject * GetDataWidget(const TString &parname) const
virtual ~KVNameValueListGUI()
Destructor.
TGTextButton * fCancelBut
Cancel button.
void RestoreData()
return all values to original state
TGTextButton * fOKBut
OK button.
KVNameValueList * theList
KVNameValueList fOriginal
KVNameValueList * GetList() const
Bool_t * fOK
set to kTRUE if OK button is pressed
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Int_t GetNameIndex(const Char_t *name) const
int main(int argc, char **argv)