Isis Developer Reference
GuiParameter.h
Go to the documentation of this file.
1 #ifndef Isis_GuiParameter_h
2 #define Isis_GuiParameter_h
3 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 
11 #include <QGridLayout>
12 #include <QLabel>
13 #include <QLineEdit>
14 #include <QMenu>
15 #include <QObject>
16 #include <QString>
17 #include <QToolButton>
18 
19 namespace Isis {
20  class UserInterface;
21 
34  class GuiParameter : public QObject {
35 
36  Q_OBJECT
37 
38  public:
39 
40  GuiParameter(QGridLayout *grid, UserInterface &ui, int group, int param);
41  virtual ~GuiParameter();
42 
44  QString Name() const {
45  return p_name;
46  };
47 
48  void SetToDefault();
49 
50  void SetToCurrent();
51 
52  virtual QString Value() = 0;
53 
54  virtual void Set(QString newValue) = 0;
55 
56  void SetEnabled(bool enabled, bool isParentCombo=false);
57 
59  bool IsEnabled() const {
60  return p_label->isEnabled();
61  }
62 
63  virtual bool IsModified();
64 
65  void Update();
66 
67  void RememberWidget(QWidget *w);
68 
70 
71  virtual std::vector<QString> Exclusions();
72 
76  };
78  return p_type;
79  };
80 
81  protected:
82 
83  QToolButton *p_fileButton;
84  QLineEdit *p_lineEdit;
85 
86  int p_group;
87  int p_param;
88  QString p_name;
90 
91  QLabel *p_label;
92 
94 
96 
97  private:
98  QMenu *p_helperMenu;
99 
100  signals:
101  void ValueChanged();
102  void HelperTrigger(const QString &);
103 
104  };
105 };
106 
107 #endif
Isis::GuiParameter::RememberWidget
void RememberWidget(QWidget *w)
Add widgets to a list for enabling/disabling.
Definition: GuiParameter.cpp:212
IsisAml::HelperIcon
QString HelperIcon(const int &group, const int &param, const int &helper) const
Returns the name of the icon for the helper button.
Definition: IsisAml.cpp:1824
FileName.h
GuiFilenameParameter.h
Isis::GuiParameter::Update
void Update()
Update the value on the GUI with the value in the UI.
Definition: GuiParameter.cpp:196
QWidget
Isis::GuiParameter::SetToDefault
void SetToDefault()
Change the parameter to the default value.
Definition: GuiParameter.cpp:158
IsisAml::HelperDescription
QString HelperDescription(const int &group, const int &param, const int &helper) const
Returns the long description of the helper button.
Definition: IsisAml.cpp:1810
Isis::GuiParameter::IsEnabled
bool IsEnabled() const
Is the parameter enabled.
Definition: GuiParameter.h:59
Isis::GuiParameter::GuiParameter
GuiParameter(QGridLayout *grid, UserInterface &ui, int group, int param)
Constructor.
Definition: GuiParameter.cpp:26
Isis::GuiParameter::BooleanWidget
@ BooleanWidget
Definition: GuiParameter.h:75
IsisAml::GetAsString
QString GetAsString(const QString &paramName) const
Allows the retrieval of a value for a parameter of any type.
Definition: IsisAml.cpp:537
Isis::GuiParameter::CubeWidget
@ CubeWidget
Definition: GuiParameter.h:74
Isis::GuiParameter::ComboWidget
@ ComboWidget
Definition: GuiParameter.h:75
QList< QWidget * >
Isis::GuiParameter::HelperTrigger
void HelperTrigger(const QString &)
IsisAml::ParamMinimumInclusive
QString ParamMinimumInclusive(const int &group, const int &param) const
Returns whether the minimum value is inclusive or not.
Definition: IsisAml.cpp:1284
Isis::GuiParameter::~GuiParameter
virtual ~GuiParameter()
Destructor.
Definition: GuiParameter.cpp:148
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
QMenu
Isis::GuiParameter::p_label
QLabel * p_label
Definition: GuiParameter.h:91
IsisAml::ParamBrief
QString ParamBrief(const int &group, const int &param) const
Returns the brief description of a parameter in a specified group.
Definition: IsisAml.cpp:1232
IsisAml::ParamGreaterThanOrEqual
QString ParamGreaterThanOrEqual(const int &group, const int &param, const int &great) const
Returns the name of the specified greaterThanOrEqual parameter.
Definition: IsisAml.cpp:1402
Isis::GuiParameter::p_group
int p_group
Definition: GuiParameter.h:86
IsisAml::HelpersSize
int HelpersSize(const int &group, const int &param) const
Returns the number of helpers the parameter has.
Definition: IsisAml.cpp:1755
Isis::GuiParameter::IntegerWidget
@ IntegerWidget
Definition: GuiParameter.h:73
Isis::GuiParameter::SetEnabled
void SetEnabled(bool enabled, bool isParentCombo=false)
Enable or disable the parameter.
Definition: GuiParameter.cpp:217
IsisAml::ParamMaximum
QString ParamMaximum(const int &group, const int &param) const
Returns the maximum value of a parameter in a specified group.
Definition: IsisAml.cpp:1271
IsisAml::HelperFunction
QString HelperFunction(const int &group, const int &param, const int &helper) const
Returns the name of the helper function.
Definition: IsisAml.cpp:1782
Isis::GuiParameter::p_type
ParameterType p_type
Definition: GuiParameter.h:95
GuiParameter.h
IsisAml::ParamGreaterThan
QString ParamGreaterThan(const int &group, const int &param, const int &great) const
Returns the name of the specified greaterThan parameter.
Definition: IsisAml.cpp:1387
Isis::GuiParameter::IsModified
virtual bool IsModified()
Return if the parameter value is different from the default value.
Definition: GuiParameter.cpp:181
IsisAml::ParamDefault
QString ParamDefault(const int &group, const int &param) const
Returns the default for a parameter in a specified group.
Definition: IsisAml.cpp:1505
IsisAml::ParamIncludeSize
int ParamIncludeSize(const int &group, const int &param) const
Returns the number of parameters included in this parameter's inclusions.
Definition: IsisAml.cpp:1731
IsisAml::ParamType
QString ParamType(const int &group, const int &param) const
Returns the parameter type of a parameter in a specified group.
Definition: IsisAml.cpp:1492
Isis::GuiParameter
Definition: GuiParameter.h:34
IsisAml::ParamInternalDefault
QString ParamInternalDefault(const int &group, const int &param) const
Returns the internal default for a parameter in a specified group.
Definition: IsisAml.cpp:1524
Isis::GuiParameter::Value
virtual QString Value()=0
GuiCubeParameter.h
Isis::GuiParameter::Name
QString Name() const
Return the name of the parameter.
Definition: GuiParameter.h:44
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
IsisAml::ParamNotEqualSize
int ParamNotEqualSize(const int &group, const int &param) const
Returns the number of values in the not equal list.
Definition: IsisAml.cpp:1374
Isis::GuiParameter::StringWidget
@ StringWidget
Definition: GuiParameter.h:73
Isis::GuiParameter::DoubleWidget
@ DoubleWidget
Definition: GuiParameter.h:73
IsisAml::HelperBrief
QString HelperBrief(const int &group, const int &param, const int &helper) const
Returns the brief description of the helper button.
Definition: IsisAml.cpp:1796
Isis::GuiParameter::p_name
QString p_name
Definition: GuiParameter.h:88
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Application.h
GuiHelperAction.h
Isis::GuiParameter::Exclusions
virtual std::vector< QString > Exclusions()
Return list of current exclusions.
Definition: GuiParameter.cpp:239
IsisAml::ParamExclude
QString ParamExclude(const int &group, const int &param, const int &exclude) const
Returns the name of the specified excluded parameter.
Definition: IsisAml.cpp:1462
IsisAml::ParamNotEqual
QString ParamNotEqual(const int &group, const int &param, const int &notEq) const
Returns the name of the specified notEqual parameter.
Definition: IsisAml.cpp:1447
IsisAml::ParamMinimum
QString ParamMinimum(const int &group, const int &param) const
Returns the minimum value of a parameter in a specified group.
Definition: IsisAml.cpp:1258
IsisAml::ParamExcludeSize
int ParamExcludeSize(const int &group, const int &param) const
Returns the number of parameters excluded in this parameter's exclusions.
Definition: IsisAml.cpp:1719
Isis::GuiParameter::p_ui
UserInterface * p_ui
Definition: GuiParameter.h:89
IsisAml::ParamInclude
QString ParamInclude(const int &group, const int &param, const int &include) const
Returns the name of the specified included parameter.
Definition: IsisAml.cpp:1477
Isis::GuiParameter::SetToCurrent
void SetToCurrent()
Change the parameter to the current user interface value.
Definition: GuiParameter.cpp:171
Isis::GuiHelperAction
Definition: GuiHelperAction.h:16
Isis::IException
Isis exception class.
Definition: IException.h:91
IsisAml::PixelType
QString PixelType(const int &group, const int &param) const
Returns the default pixel type from the XML.
Definition: IsisAml.cpp:1743
IsisAml::ParamGreaterThanOrEqualSize
int ParamGreaterThanOrEqualSize(const int &group, const int &param) const
Returns the number of values in the parameters greater than or equal list.
Definition: IsisAml.cpp:1336
IsisAml::ParamGreaterThanSize
int ParamGreaterThanSize(const int &group, const int &param) const
Returns the number of values in the parameters greater than list.
Definition: IsisAml.cpp:1324
Isis::GuiParameter::p_lineEdit
QLineEdit * p_lineEdit
Definition: GuiParameter.h:84
Isis::GuiParameter::p_fileButton
QToolButton * p_fileButton
Definition: GuiParameter.h:79
IsisAml::ParamLessThan
QString ParamLessThan(const int &group, const int &param, const int &great) const
Returns the name of the specified lessThan parameter.
Definition: IsisAml.cpp:1417
IsisAml::WasEntered
bool WasEntered(const QString &paramName) const
Returns a true if the parameter has a value, and false if it does not.
Definition: IsisAml.cpp:1836
IsisAml::ParamLessThanSize
int ParamLessThanSize(const int &group, const int &param) const
Returns the number of values in the parameters less than list.
Definition: IsisAml.cpp:1349
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
IsisAml::ParamLessThanOrEqualSize
int ParamLessThanOrEqualSize(const int &group, const int &param) const
Returns the number of values in the parameters less than or equal list.
Definition: IsisAml.cpp:1361
Isis::UserInterface
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
IsisAml::HelperButtonName
QString HelperButtonName(const int &group, const int &param, const int &helper) const
Returns the name of the helper button.
Definition: IsisAml.cpp:1768
Isis::GuiParameter::p_param
int p_param
Definition: GuiParameter.h:87
IsisAml::ParamLessThanOrEqual
QString ParamLessThanOrEqual(const int &group, const int &param, const int &les) const
Returns the name of the specified lessThanOrEqual parameter.
Definition: IsisAml.cpp:1432
Isis::GuiParameter::p_widgetList
QList< QWidget * > p_widgetList
Definition: GuiParameter.h:93
Isis::GuiParameter::Type
ParameterType Type()
Definition: GuiParameter.h:77
QObject
IsisAml::ParamMaximumInclusive
QString ParamMaximumInclusive(const int &group, const int &param) const
Returns whether the maximum value is inclusive or not.
Definition: IsisAml.cpp:1297
UserInterface.h
Isis::GuiParameter::ParameterType
ParameterType
Definition: GuiParameter.h:73
Isis::GuiParameter::ListWidget
@ ListWidget
Definition: GuiParameter.h:74
IsisAml::ParamOdd
QString ParamOdd(const int &group, const int &param) const
Returns whether the selected parameter has a restriction on odd values or not.
Definition: IsisAml.cpp:1311
IsisAml::ParamName
QString ParamName(const int &group, const int &param) const
Returns the parameter name.
Definition: IsisAml.cpp:1219
Isis::GuiParameter::Set
virtual void Set(QString newValue)=0
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::GuiParameter::FileNameWidget
@ FileNameWidget
Definition: GuiParameter.h:74
Isis::GuiParameter::ValueChanged
void ValueChanged()
Isis::GuiParameter::AddHelpers
QWidget * AddHelpers(QObject *lo)
Sets up helper button.
Definition: GuiParameter.cpp:245