50 FXIMPLEMENT(
GUIParameterTableWindow, FXMainWindow, GUIParameterTableWindowMap, ARRAYNUMBER(GUIParameterTableWindowMap))
63 FXMainWindow(app.getApp(), (o.getFullName() +
" Parameter").c_str(), nullptr, nullptr, DECOR_ALL, 20, 20, 500, (FXint)((noRows + numParams(&o)) * 20 + 60)),
68 myTable =
new FXTable(
this,
this,
MID_TABLE, TABLE_COL_SIZABLE | TABLE_ROW_SIZABLE | LAYOUT_FILL_X | LAYOUT_FILL_Y);
69 myTable->setVisibleRows((FXint)(noRows + 1));
71 myTable->setTableSize((FXint)(noRows + 1), 3);
72 myTable->setBackColor(FXRGB(255, 255, 255));
73 myTable->setColumnText(0,
"Name");
74 myTable->setColumnText(1,
"Value");
75 myTable->setColumnText(2,
"Dynamic");
76 myTable->getRowHeader()->setWidth(0);
77 FXHeader* header =
myTable->getColumnHeader();
78 header->setItemJustify(0, JUSTIFY_CENTER_X);
79 header->setItemSize(0, 240);
80 header->setItemJustify(1, JUSTIFY_CENTER_X);
81 header->setItemSize(1, 120);
82 header->setItemJustify(2, JUSTIFY_CENTER_X);
83 header->setItemSize(2, 60);
98 for (std::vector<GUIParameterTableItemInterface*>::iterator i =
myItems.begin(); i !=
myItems.end(); ++i) {
106 std::vector<GUIParameterTableWindow*>::iterator i = std::find(
myContainer.begin(),
myContainer.end(),
this);
115 FXMutexLock locker(
myLock);
144 myTable->onLeftBtnPress(sender, sel, eventData);
145 int row =
myTable->getCurrentRow();
146 if (row == -1 || row >= (
int)(
myItems.size())) {
158 if (doubleSource !=
nullptr) {
160 new FXMenuCommand(p,
"Open in new Tracker",
nullptr, p,
MID_OPENTRACKER);
162 p->setX(static_cast<FXEvent*>(eventData)->root_x);
163 p->setY(static_cast<FXEvent*>(eventData)->root_y);
209 FXMutexLock locker(
myLock);
213 for (std::vector<GUIParameterTableItemInterface*>::iterator i =
myItems.begin(); i !=
myItems.end(); i++) {
227 for (std::map<std::string, std::string>::const_iterator it = map.begin(); it != map.end(); ++it) {
228 mkItem((
"param:" + it->first).c_str(),
false, it->second);
A Tracker shall be opened.
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.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
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.
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.
An upper class for objects with additional parameters.
long onSimStep(FXObject *, FXSelector, void *)
Updates the table due to a simulation step.
long onTableDeselected(FXObject *, FXSelector, void *)
Does nothing.
void removeChild(FXMainWindow *child)
~GUIParameterTableWindow()
Destructor.
GUIParameterTableWindow()
FOX needs this.
virtual bool dynamic() const =0
Returns the information whether the value changes over simulation time.
A Simulation step was performed.
virtual ValueSource< double > * getdoubleSourceCopy() const =0
Returns a double-typed copy of the value-source.
GUIGlObject * myObject
The object to get the information from.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
Instance of a single line in a parameter window.
void addChild(FXMainWindow *child)
long onTableSelected(FXObject *, FXSelector, void *)
Does nothing.
std::vector< GUIParameterTableItemInterface * > myItems
The list of table rows.
A window containing a gl-object's parameter.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static FXMutex myGlobalContainerLock
The mutex used to avoid concurrent updates of the instance container.
FXMutex myLock
A lock assuring save updates in case of object deletion.
FXDEFMAP(GUIParameterTableWindow) GUIParameterTableWindowMap[]