56 FXIMPLEMENT(
GUIParameterTableWindow, FXMainWindow, GUIParameterTableWindowMap, ARRAYNUMBER(GUIParameterTableWindowMap))
69 FXMainWindow(app.getApp(), (o.getFullName() +
" Parameter").c_str(), NULL, NULL, DECOR_ALL, 20, 20, 500, (FXint)((noRows + numParams(&o)) * 20 + 60)),
74 myTable =
new FXTable(
this,
this,
MID_TABLE, TABLE_COL_SIZABLE | TABLE_ROW_SIZABLE | LAYOUT_FILL_X | LAYOUT_FILL_Y);
75 myTable->setVisibleRows((FXint)(noRows + 1));
77 myTable->setTableSize((FXint)(noRows + 1), 3);
78 myTable->setBackColor(FXRGB(255, 255, 255));
79 myTable->setColumnText(0,
"Name");
80 myTable->setColumnText(1,
"Value");
81 myTable->setColumnText(2,
"Dynamic");
82 myTable->getRowHeader()->setWidth(0);
83 FXHeader* header =
myTable->getColumnHeader();
84 header->setItemJustify(0, JUSTIFY_CENTER_X);
85 header->setItemSize(0, 240);
86 header->setItemJustify(1, JUSTIFY_CENTER_X);
87 header->setItemSize(1, 120);
88 header->setItemJustify(2, JUSTIFY_CENTER_X);
89 header->setItemSize(2, 60);
104 for (std::vector<GUIParameterTableItemInterface*>::iterator i =
myItems.begin(); i !=
myItems.end(); ++i) {
112 std::vector<GUIParameterTableWindow*>::iterator i = std::find(
myContainer.begin(),
myContainer.end(),
this);
150 myTable->onLeftBtnPress(sender, sel, eventData);
151 int row =
myTable->getCurrentRow();
152 if (row == -1 || row >= (
int)(
myItems.size())) {
166 p->setX(static_cast<FXEvent*>(eventData)->root_x);
167 p->setY(static_cast<FXEvent*>(eventData)->root_y);
238 for (std::vector<GUIParameterTableItemInterface*>::iterator i =
myItems.begin(); i !=
myItems.end(); i++) {
251 const std::map<std::string, std::string>& map = p->
getMap();
252 for (std::map<std::string, std::string>::const_iterator it = map.begin(); it != map.end(); ++it) {
253 mkItem((
"param:" + it->first).c_str(),
false, it->second);
265 return p != 0 ? (int)p->
getMap().size() : 0;
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
void removeObject(GUIGlObject *const o)
Lets this window know the object shown is being deleted.
unsigned myCurrentPos
The index of the next row to add - used while building.
FXTable * myTable
The table to display the information in.
GUIMainWindow * myApplication
The main application window.
virtual const std::string & getName() const =0
Returns the name of the value.
void updateTable()
Updates the table.
void removeParameterTable(GUIParameterTableWindow *w)
Lets this object know a parameter window showing the object's values was closed.
void addChild(FXMDIChild *child, bool updateOnSimStep=true)
Adds a further child window to the list.
static MFXMutex myGlobalContainerLock
The mutex used to avoid concurrent updates of the instance container.
static int numParams(const GUIGlObject *obj)
returns the number of parameters if obj is Parameterised and 0 otherwise
void addParameterTable(GUIParameterTableWindow *w)
Interface to a single line in a parameter window.
static std::vector< GUIParameterTableWindow * > myContainer
The container of items that shall be updated.
long onRightButtonPress(FXObject *, FXSelector, void *)
Shows a popup.
void removeChild(FXMDIChild *child)
removes the given child window from the list
An upper class for objects with additional parameters.
long onSimStep(FXObject *, FXSelector, void *)
Updates the table due to a simulation step.
void unlock()
release mutex lock
A Tracker shall be opened.
long onTableDeselected(FXObject *, FXSelector, void *)
Does nothing.
~GUIParameterTableWindow()
Destructor.
GUIParameterTableWindow()
FOX needs this.
MFXMutex myLock
A lock assuring save updates in case of object deletion.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
virtual bool dynamic() const =0
Returns the information whether the value changes over simulation time.
virtual ValueSource< double > * getdoubleSourceCopy() const =0
Returns a double-typed copy of the value-source.
GUIGlObject * myObject
The object to get the information from.
A Simulation step was performed.
Instance of a single line in a parameter window.
long onTableSelected(FXObject *, FXSelector, void *)
Does nothing.
std::vector< GUIParameterTableItemInterface * > myItems
The list of table rows.
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
A window containing a gl-object's parameter.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXDEFMAP(GUIParameterTableWindow) GUIParameterTableWindowMap[]