Isis 3.0 Programmer Reference
Back | Home
GuiParameter.h
Go to the documentation of this file.
1 #ifndef Isis_GuiParameter_h
2 #define Isis_GuiParameter_h
3 
27 #include <QGridLayout>
28 #include <QLabel>
29 #include <QLineEdit>
30 #include <QMenu>
31 #include <QObject>
32 #include <QString>
33 #include <QToolButton>
34 
35 namespace Isis {
36  class UserInterface;
37 
50  class GuiParameter : public QObject {
51 
52  Q_OBJECT
53 
54  public:
55 
56  GuiParameter(QGridLayout *grid, UserInterface &ui, int group, int param);
57  virtual ~GuiParameter();
58 
60  QString Name() const {
61  return p_name;
62  };
63 
64  void SetToDefault();
65 
66  void SetToCurrent();
67 
68  virtual QString Value() = 0;
69 
70  virtual void Set(QString newValue) = 0;
71 
72  void SetEnabled(bool enabled, bool isParentCombo=false);
73 
75  bool IsEnabled() const {
76  return p_label->isEnabled();
77  }
78 
79  virtual bool IsModified();
80 
81  void Update();
82 
83  void RememberWidget(QWidget *w);
84 
86 
87  virtual std::vector<QString> Exclusions();
88 
89  enum ParameterType { IntegerWidget, DoubleWidget, StringWidget,
90  ListWidget, FileNameWidget, CubeWidget,
91  BooleanWidget, ComboWidget
92  };
93  ParameterType Type() {
94  return p_type;
95  };
96 
97  protected:
98 
99  QToolButton *p_fileButton;
100  QLineEdit *p_lineEdit;
101 
102  int p_group;
103  int p_param;
104  QString p_name;
105  UserInterface *p_ui;
106 
107  QLabel *p_label;
108 
109  QList<QWidget *> p_widgetList;
110 
111  ParameterType p_type;
112 
113  private:
114  QMenu *p_helperMenu;
115 
116  signals:
117  void ValueChanged();
118  void HelperTrigger(const QString &);
119 
120  };
121 };
122 
123 #endif
virtual ~GuiParameter()
Destructor.
void SetEnabled(bool enabled, bool isParentCombo=false)
Enable or disable the parameter.
QWidget * AddHelpers(QObject *lo)
Sets up helper button.
void Update()
Update the value on the GUI with the value in the UI.
void SetToDefault()
Change the parameter to the default value.
GuiParameter(QGridLayout *grid, UserInterface &ui, int group, int param)
Constructor.
QString Name() const
Return the name of the parameter.
Definition: GuiParameter.h:60
virtual bool IsModified()
Return if the parameter value is different from the default value.
void SetToCurrent()
Change the parameter to the current user interface value.
virtual std::vector< QString > Exclusions()
Return list of current exclusions.
Command Line and Xml loader, validation, and access.
void RememberWidget(QWidget *w)
Add widgets to a list for enabling/disabling.
bool IsEnabled() const
Is the parameter enabled.
Definition: GuiParameter.h:75

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:19:18