C++ main module for gpm Package  1.0
GPMG_VariablePanel.h
Go to the documentation of this file.
1 #ifndef GPMG_VariablePanel_H
2 #define GPMG_VariablePanel_H
3 
4 
5 #include "GUI_GroupBoxPanel.h"
6 
7 #include "GPM_Variable.h"
8 
9 
16 
17 class GPMG_VariablePanel : public GUI_GroupBoxPanel { // class
18  SP_OBJECT(GPMG_VariablePanel);
19 
20  // ATTRIBUTES
21 
22 private:
23 
24  static const tFlag VAR_NAME;
25  static const tFlag VAR_TYPE;
26  static const tFlag VAR_CARD;
27  static const tFlag VAR_VALUE;
28 
29 
30 private:
31 
32  tString mName;
33 
34  // ASSOCIATIONS
35 
36  SP::GPM_Variable mVariable;
37 
38 
39  // METHODS
40 
41 
42 protected:
43  // CONSTRUCTORS
44 
48 
49 
50 
51 
52  // DESTRUCTORS
56  virtual ~GPMG_VariablePanel(void);
57 
58 
59 
60 public:
61  // NEW
64  static inline SP::GPMG_VariablePanel New() {
65  SP::GPMG_VariablePanel win(new GPMG_VariablePanel(),
66  GPMG_VariablePanel::Delete());
67  win->setThis(win);
68  return win;
69  };
70 
73  virtual void toDoAfterThisSetting() {
74  GUI_GroupBoxPanel::toDoAfterThisSetting();
75  createComponents();
76  };
77 
78  // SET
79 
82  inline void setVariable(const tString& varName,SP::GPM_Variable var) {
83  mName=varName;
84  mVariable=var;
85  updateValues();
86  }
87 
88  // GET
89 
92  inline SP::GPM_Variable getVariable(tString& name) const {
93  name=mName;
94  return mVariable;
95  }
96 public:
97  // SAVER & LOADER
100  virtual void loadFromUIClass(const UI_Class& mclass);
103  virtual void saveToUIClass(UI_Class& mclass) const;
104 
105 
106 
107  // OTHERS
108 
111  virtual void componentClicked(GUI_ActionComponent& compo);
112 
115  virtual void enableComponents(const tBoolean& isWritten);
116 
120  virtual void updateValues();
121 
122 
123 
124 private:
125 
128  void createComponents();
129 
133  tString variableValueToGuiString() const;
134 
135 
138  void guiStringToVariableValue(const tString& value) const;
139 
140 
141 };
142 #endif
#define tBoolean
Definition: types.h:35
DEFINE_SPTR(GPMG_VariablePanel)
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_VariablePanel.cpp:110
GPMG_VariablePanel()
build a GPMG_VariablePanel
Definition: GPMG_VariablePanel.cpp:31
SP::GPM_Variable getVariable(tString &name) const
get the urrent variable
Definition: GPMG_VariablePanel.h:92
virtual void enableComponents(const tBoolean &isWritten)
enable the components
Definition: GPMG_VariablePanel.cpp:229
this class describes a window to display a variable
Definition: GPMG_VariablePanel.h:17
virtual void toDoAfterThisSetting()
method called after this setting
Definition: GPMG_VariablePanel.h:73
void setVariable(const tString &varName, SP::GPM_Variable var)
set the graph
Definition: GPMG_VariablePanel.h:82
#define tString
Definition: types.h:36
virtual ~GPMG_VariablePanel(void)
destroy a GPMG_VariablePanel
Definition: GPMG_VariablePanel.cpp:38
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a component are clicked on
Definition: GPMG_VariablePanel.cpp:174
static SP::GPMG_VariablePanel New()
create a visualization window
Definition: GPMG_VariablePanel.h:64
virtual void updateValues()
update the components values put the values of model object to gui components
Definition: GPMG_VariablePanel.cpp:120
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_VariablePanel.cpp:115
#define tFlag
Definition: types.h:14