KaliVeda
Toolkit for HIC analysis
KVNameValueListGUI.h
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 
33 
56  RQ_OBJECT("KVNameValueListGUI")
57 private:
58  KVNameValueList* theList;
59  KVNameValueList fOriginal;
60 
61  TGTransientFrame* fMain;
62  TGTextButton* fOKBut;
63  TGTextButton* fCancelBut;
64  Bool_t* fOK;
65  UInt_t max_width;
66  UInt_t fWidth, fHeight;
67  TObjArray fData;
68 
69  Bool_t* fCancel;
70  Bool_t fWaitForMain;
71 
72 protected:
73  virtual TObject* AddAString(Int_t i, TGHorizontalFrame* hf);
74  virtual TObject* AddABool(Int_t i, TGHorizontalFrame* hf);
75  virtual TObject* AddADouble(Int_t i, TGHorizontalFrame* hf);
76  virtual TObject* AddAInt(Int_t i, TGHorizontalFrame* hf);
77 
78  TObject* GetDataWidget(int i) const
79  {
80  return fData[i];
81  }
82  KVNameValueList* GetList() const
83  {
84  return theList;
85  }
86  TGTransientFrame* GetMain() const
87  {
88  return fMain;
89  }
90  TObject* GetDataWidget(const TString& parname) const
91  {
93 
94  auto index = theList->GetNameIndex(parname);
95  if (index < 0) return nullptr;
96  return GetDataWidget(index);
97  }
98 
99 public:
100  KVNameValueListGUI(const TGWindow* main, KVNameValueList* params, Bool_t* cancel_pressed, Bool_t wait_for_main = kTRUE);
101 
102  virtual ~KVNameValueListGUI();
103 
104  void ReadData();
105  void RestoreData();
106  void DoClose();
107  void CloseWindow();
108 
109  bool EnableDependingOnBool(const TString& value_to_enable, const TString& bool_parameter);
110  bool MutuallyExclusive(const std::vector<TString>& bool_params);
111 
112  ClassDef(KVNameValueListGUI, 1) //GUI for setting KVNameValueList parameters
113  void DisplayDialog();
114 };
115 
116 #endif
int Int_t
unsigned int UInt_t
#define RQ_OBJECT(sender_class)
bool Bool_t
constexpr Bool_t kTRUE
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
GUI for setting KVNameValueList parameters.
ClassDef(KVNameValueListGUI, 1) void DisplayDialog()
bool MutuallyExclusive(const std::vector< TString > &bool_params)
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 ~KVNameValueListGUI()
Destructor.
void RestoreData()
return all values to original state
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)