53FXIMPLEMENT(
GUIParameterTableWindow, FXMainWindow, GUIParameterTableWindowMap, ARRAYNUMBER(GUIParameterTableWindowMap))
67#pragma warning(disable: 4355)
70 FXMainWindow(app.getApp(), ((title ==
"" ? o.getFullName() : title) +
" parameter").c_str(), nullptr, nullptr, DECOR_ALL, 20, 40, 200, 500),
76 myTable =
new FXTable(
this,
this,
MID_TABLE, TABLE_COL_SIZABLE | TABLE_ROW_SIZABLE | LAYOUT_FILL_X | LAYOUT_FILL_Y);
83 myTable->getRowHeader()->setWidth(0);
84 FXHeader* header =
myTable->getColumnHeader();
85 header->setItemJustify(0, JUSTIFY_CENTER_X);
86 header->setItemSize(0, 240);
87 header->setItemJustify(1, JUSTIFY_CENTER_X);
88 header->setItemSize(1, 120);
89 header->setItemJustify(2, JUSTIFY_CENTER_X);
90 header->setItemSize(2, 60);
108 for (std::vector<GUIParameterTableItemInterface*>::iterator i =
myItems.begin(); i !=
myItems.end(); ++i) {
112 myObject->removeParameterTable(
this);
116 std::vector<GUIParameterTableWindow*>::iterator i = std::find(
myContainer.begin(),
myContainer.end(),
this);
125 FXMutexLock locker(
myLock);
152 FXEvent* e = (FXEvent*) eventData;
153 int row =
myTable->rowAtY(e->win_y);
154 int col =
myTable->colAtX(e->win_x);
155 if (col == 2 && row >= 0 && row < (
int)
myItems.size()) {
159 const std::string trackerName = i->
getName() +
" of " +
myObject->getFullName();
164 tr->setX(getX() + getWidth() + 10);
172 return FXMainWindow::onLeftBtnPress(sender, sel, eventData);
178 FXEvent* e = (FXEvent*) eventData;
179 int row =
myTable->rowAtY(e->win_y);
180 if (row == -1 || row >= (
int)(
myItems.size())) {
192 if (doubleSource !=
nullptr) {
196 p->setX(
static_cast<FXEvent*
>(eventData)->root_x);
197 p->setY(
static_cast<FXEvent*
>(eventData)->root_y);
248 FXMutexLock locker(
myLock);
266 for (Parameterised::Map::const_iterator it = map.begin(); it != map.end(); ++it) {
267 mkItem((
"param:" + it->first).c_str(),
false, it->second);
270 const int rows = (int)
myItems.size() + 1;
271 int h = rows * 20 + 40;
273 for (
int i = 0; i < (int)
myItems.size(); i++) {
277 myTable->fitColumnsToContents(1);
278 setWidth(
myTable->getContentWidth() + 40);
288 bool missingChar =
false;
289 FXString fxs(text.c_str());
290 for (FXint i = 0; i < fxs.length(); i = fxs.inc(i)) {
291 FXwchar wc = fxs.wc(i);
292 if (
myTable->getFont()->hasChar(wc) != TRUE) {
@ MID_SIMSTEP
A Simulation step was performed.
@ MID_OPENTRACKER
A Tracker shall be opened.
#define GUIDesignBackgroundColorWhite
white background color (for valid text)
FXDEFMAP(GUIParameterTableWindow) GUIParameterTableWindowMap[]
const std::string invalid_return< std::string >::value
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Instance of a single line in a parameter window.
Interface to a single line in a parameter window.
virtual const std::string & getName() const =0
Returns the name of the value.
virtual ValueSource< double > * getdoubleSourceCopy() const =0
Returns a double-typed copy of the value-source.
virtual bool dynamic() const =0
Returns the information whether the value changes over simulation time.
A window containing a gl-object's parameter.
long onRightButtonPress(FXObject *, FXSelector, void *)
Shows a popup.
GUIMainWindow * myApplication
The main application window.
static FXMutex myGlobalContainerLock
The mutex used to avoid concurrent updates of the instance container.
void removeObject(GUIGlObject *const o)
Lets this window know the object shown is being deleted.
static int numParams(const GUIGlObject *obj)
returns the number of parameters if obj is Parameterised and 0 otherwise
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
int myTrackerY
y-position for opening new tracker window
long onLeftBtnPress(FXObject *, FXSelector, void *)
directly opens tracker when clicking on last column
long onTableSelected(FXObject *, FXSelector, void *)
Does nothing.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
FXMutex myLock
A lock assuring save updates in case of object deletion.
std::vector< GUIParameterTableItemInterface * > myItems
The list of table rows.
unsigned myCurrentPos
The index of the next row to add - used while building.
void checkFont(const std::string &text)
ensure that the font covers the given text
long onTableDeselected(FXObject *, FXSelector, void *)
Does nothing.
~GUIParameterTableWindow()
Destructor.
FXTable * myTable
The table to display the information in.
static std::vector< GUIParameterTableWindow * > myContainer
The container of items that shall be updated.
long onSimStep(FXObject *, FXSelector, void *)
Updates the table due to a simulation step.
GUIParameterTableWindow(GUIMainWindow &app, GUIGlObject &o, const std::string &title="")
Constructor.
void updateTable()
Updates the table.
GUIGlObject * myObject
The object to get the information from.
A window which displays the time line of one (or more) value(s).
void addTracked(GUIGlObject &o, ValueSource< double > *src, TrackerValueDesc *newTracked)
Adds a further time line to display.
void create()
Creates the window.
static bool addTrackedMultiplot(GUIGlObject &o, ValueSource< double > *src, TrackerValueDesc *newTracked)
all value source to multiplot trackers
GUIPersistentWindowPos(FXWindow *parent, const std::string &name, bool storeSize, int x=150, int y=150, int width=700, int height=500, int minSize=400, int minTitlebarHeight=20)
Constructor (Notifies both the parent and the storage about being initialised).
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
static const RGBColor BLACK
Representation of a timeline of floats with their names and moments.