45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
74 :
FXMainWindow(app.getApp(), (o.getFullName() + " Parameter").c_str(),
75 NULL, NULL, DECOR_ALL, 20, 20, 500, (FXint)(noRows * 20 + 60)),
77 myApplication(&app), myCurrentPos(0) {
78 myTable =
new FXTable(
this,
this,
MID_TABLE, TABLE_COL_SIZABLE | TABLE_ROW_SIZABLE | LAYOUT_FILL_X | LAYOUT_FILL_Y);
79 myTable->setVisibleRows((FXint)(noRows + 1));
80 myTable->setVisibleColumns(3);
81 myTable->setTableSize((FXint)(noRows + 1), 3);
82 myTable->setBackColor(FXRGB(255, 255, 255));
83 myTable->setColumnText(0,
"Name");
84 myTable->setColumnText(1,
"Value");
85 myTable->setColumnText(2,
"Dynamic");
86 myTable->getRowHeader()->setWidth(0);
87 FXHeader* header = myTable->getColumnHeader();
88 header->setItemJustify(0, JUSTIFY_CENTER_X);
89 header->setItemSize(0, 240);
90 header->setItemJustify(1, JUSTIFY_CENTER_X);
91 header->setItemSize(1, 120);
92 header->setItemJustify(2, JUSTIFY_CENTER_X);
93 header->setItemSize(2, 60);
96 myObject->addParameterTable(
this);
99 myContainer.push_back(
this);
106 for (std::vector<GUIParameterTableItemInterface*>::iterator i =
myItems.begin(); i !=
myItems.end(); ++i) {
114 std::vector<GUIParameterTableWindow*>::iterator i = std::find(
myContainer.begin(),
myContainer.end(),
this);
154 myTable->onLeftBtnPress(sender, sel, data);
155 int row =
myTable->getCurrentRow();
156 if (row == -1 || row >= (
int)(
myItems.size())) {
167 p->setX(static_cast<FXEvent*>(data)->root_x);
168 p->setY(static_cast<FXEvent*>(data)->root_y);
240 for (std::vector<GUIParameterTableItemInterface*>::iterator i =
myItems.begin(); i !=
myItems.end(); i++) {
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.
virtual ValueSource< SUMOReal > * getSUMORealSourceCopy() const =0
Returns a SUMOReal-typed copy of the value-source.
A Simulation step was performed.
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
long onSimStep(FXObject *, FXSelector, void *)
Updates the table due to a simulation step.
void unlock()
release mutex lock
long onTableDeselected(FXObject *, FXSelector, void *)
Does nothing.
~GUIParameterTableWindow()
Destructor.
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.
virtual bool dynamic() const =0
Returns the information whether the value changes over simulation time.
GUIGlObject * myObject
The object to get the information from.
Instance of a single line in a parameter window.
A Tracker shall be opened.
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.
void closeBuilding()
Closes the building of the table.
A window containing a gl-object's parameter.
static FXIcon * getIcon(GUIIcon which)
FXDEFMAP(GUIParameterTableWindow) GUIParameterTableWindowMap[]