KaliVeda
Toolkit for HIC analysis
KVNameValueListGUI Class Reference

Detailed Description

GUI for setting KVNameValueList parameters.

Created by KVClassFactory on Fri Feb 17 09:32:40 2017 Author: John Frankland,,,

This is a lightweight transient dialog box which can be used to set an arbitrary list of parameters. The parameters are contained in a KVNameValueList. To use, do:

KVNameValueList params{{"FixLimits?",false}, {"Min",0.0}, {"Max",100.0}};
bool cancel_pressed{false};
auto param_gui = new KVNameValueListGUI(nullptr, &params, &cancel_pressed);
param_gui->DisplayDialog();
if(!cancel_pressed)
{
params.Print();
}
KVNameValueListGUI(const TGWindow *main, KVNameValueList *params, Bool_t *cancel_pressed, Bool_t wait_for_main=kTRUE)
Constructor.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.

[Note that this example is for stand-alone use of the GUI. The first argument to the constructor is usually the TGMainFrame of your GUI application]

If the user presses 'Cancel', the original values of the parameters are restored.

Boolean parameters can be used to 'enable' other parameters in the GUI, i.e. with the previous example, if you do:

param_gui->EnableDependingOnBool("Min","FixLimits?");
param_gui->EnableDependingOnBool("Max","FixLimits?");
param_gui->DisplayDialog();

then the "Min" and "Max" input widgets in the GUI will only be enabled when the "FixLimits?" parameter is true, and will be en/disabled when the check box for this parameter is checked/unchecked.

Definition at line 55 of file KVNameValueListGUI.h.

#include <KVNameValueListGUI.h>

Inheritance diagram for KVNameValueListGUI:

Public Member Functions

 KVNameValueListGUI (const TGWindow *main, KVNameValueList *params, Bool_t *cancel_pressed, Bool_t wait_for_main=kTRUE)
 Constructor. More...
 
virtual ~KVNameValueListGUI ()
 Destructor. More...
 
 ClassDef (KVNameValueListGUI, 1) void DisplayDialog()
 
void CloseWindow ()
 
void DoClose ()
 
bool EnableDependingOnBool (const TString &value_to_enable, const TString &bool_parameter)
 
bool MutuallyExclusive (const std::vector< TString > &bool_params)
 
void ReadData ()
 
void RestoreData ()
 return all values to original state More...
 

Constructor & Destructor Documentation

◆ KVNameValueListGUI()

KVNameValueListGUI::KVNameValueListGUI ( const TGWindow main,
KVNameValueList params,
Bool_t cancel_pressed,
Bool_t  wait_for_main = kTRUE 
)

Constructor.

Definition at line 138 of file KVNameValueListGUI.cpp.

◆ ~KVNameValueListGUI()

KVNameValueListGUI::~KVNameValueListGUI ( )
virtual

Destructor.

Definition at line 213 of file KVNameValueListGUI.cpp.

Member Function Documentation

◆ ClassDef()

KVNameValueListGUI::ClassDef ( KVNameValueListGUI  ,
 
)

◆ CloseWindow()

void KVNameValueListGUI::CloseWindow ( )

Definition at line 237 of file KVNameValueListGUI.cpp.

◆ DoClose()

void KVNameValueListGUI::DoClose ( )

Definition at line 227 of file KVNameValueListGUI.cpp.

◆ EnableDependingOnBool()

bool KVNameValueListGUI::EnableDependingOnBool ( const TString value_to_enable,
const TString bool_parameter 
)

If the list of parameters contains a boolean variable with name bool_parameter, one or more of the widgets (number entry field, text entry field, etc.) can be disabled or enabled depending on the boolean state.

if bool_parameter is not the name of a boolean in the list, or value_to_enable cannot be found in the list, returns false. otherwise, returns true in case of success.

Definition at line 252 of file KVNameValueListGUI.cpp.

◆ MutuallyExclusive()

bool KVNameValueListGUI::MutuallyExclusive ( const std::vector< TString > &  bool_params)

Given a list of boolean parameters in the list, this makes them mutually exclusive options (like a radio button group): only one of them can be 'true' at once. As soon as one of the corresponding check boxes is ticked, all the others are unticked (and become 'false').

Definition at line 297 of file KVNameValueListGUI.cpp.

◆ ReadData()

void KVNameValueListGUI::ReadData ( )

Definition at line 77 of file KVNameValueListGUI.cpp.

◆ RestoreData()

void KVNameValueListGUI::RestoreData ( )

return all values to original state

Definition at line 101 of file KVNameValueListGUI.cpp.