C++ main module for gpm Package  1.0
GPMG_EnvironmentPanel.h
Go to the documentation of this file.
1 #ifndef GPMG_EnvironmentPanel_H
2 #define GPMG_EnvironmentPanel_H
3 
4 
5 #include "GUI_GroupBoxPanel.h"
6 #include "GUI_Label.h"
7 
8 #include "GPMG_VariablePanel.h"
9 
16 
17 class GPMG_EnvironmentPanel : public GUI_GroupBoxPanel { // class
18  SP_OBJECT(GPMG_EnvironmentPanel);
19 
20  // ATTRIBUTES
21 
22 private:
23 
24 
25 
26  static const tFlag ADD;
27  static const tFlag REMOVE;
28  static const tFlag VARIABLES;
29  static const tFlag VARIABLE;
30 
31 private:
32 
33 
34  // ASSOCIATIONS
35  SP::GPMG_VariablePanel mVariablePanel;
36  map<tString,SP::GPM_Variable> *mEnvironment;
37  SP::GUI_Label mVariablesLabel;
38 
39  // METHODS
40 
41 
42 protected:
43  // CONSTRUCTORS
44 
48 
49 
50 
51 
52  // DESTRUCTORS
56  virtual ~GPMG_EnvironmentPanel(void);
57 
58 
59 
60 public:
61  // NEW
64  static inline SP::GPMG_EnvironmentPanel New() {
65  SP::GPMG_EnvironmentPanel win(new GPMG_EnvironmentPanel(),
66  GPMG_EnvironmentPanel::Delete());
67  win->setThis(win);
68  return win;
69  };
70 
73  virtual void toDoAfterThisSetting() {
74  GUI_GroupBoxPanel::toDoAfterThisSetting();
75  createComponents();
76  };
77  // SET
78 
79 public:
82  void setEnvironment(map<tString,SP::GPM_Variable>& env);
83 
84 
87  inline void setLabels(const tString& panelLabel,const tString& variablesLabel) {
88  setLabel(panelLabel);
89  mVariablesLabel->setLabel(variablesLabel);
90  updateValues();
91  }
92 
93  // GET
94 public:
95  // SAVER & LOADER
98  virtual void loadFromUIClass(const UI_Class& mclass);
101  virtual void saveToUIClass(UI_Class& mclass) const;
102 
103  // OTHERS
104 
107  virtual void componentClicked(GUI_ActionComponent& compo);
108 
109 
110 
111 private:
112 
115  void createComponents();
116 
117 
118 
119 };
120 #endif
virtual void toDoAfterThisSetting()
method called after this setting
Definition: GPMG_EnvironmentPanel.h:73
virtual ~GPMG_EnvironmentPanel(void)
destroy a GPMG_EnvironmentPanel
Definition: GPMG_EnvironmentPanel.cpp:34
void setLabels(const tString &panelLabel, const tString &variablesLabel)
set the label
Definition: GPMG_EnvironmentPanel.h:87
DEFINE_SPTR(GPMG_EnvironmentPanel)
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a component are clicked on
Definition: GPMG_EnvironmentPanel.cpp:143
GPMG_EnvironmentPanel()
build a GPMG_EnvironmentPanel
Definition: GPMG_EnvironmentPanel.cpp:28
void setEnvironment(map< tString, SP::GPM_Variable > &env)
set the environment for global constants
Definition: GPMG_EnvironmentPanel.cpp:104
#define tString
Definition: types.h:36
static SP::GPMG_EnvironmentPanel New()
create a visualization window
Definition: GPMG_EnvironmentPanel.h:64
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_EnvironmentPanel.cpp:99
this class describes a panel to display variable of an environment
Definition: GPMG_EnvironmentPanel.h:17
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_EnvironmentPanel.cpp:94
#define tFlag
Definition: types.h:14