GUIParam_PopupMenu.cpp
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029
00030 #include <iostream>
00031 #include <string>
00032 #include "GUIParameterTableWindow.h"
00033 #include <utils/gui/globjects/GUIGlObject.h>
00034 #include "GUIParam_PopupMenu.h"
00035 #include <utils/gui/tracker/GUIParameterTracker.h>
00036 #include <utils/gui/tracker/TrackerValueDesc.h>
00037 #include <utils/gui/windows/GUIAppEnum.h>
00038 #include <utils/gui/windows/GUIMainWindow.h>
00039
00040 #ifdef CHECK_MEMORY_LEAKS
00041 #include <foreign/nvwa/debug_new.h>
00042 #endif // CHECK_MEMORY_LEAKS
00043
00044
00045
00046
00047
00048 FXDEFMAP(GUIParam_PopupMenuInterface) GUIParam_PopupMenuInterfaceMap[]= {
00049 FXMAPFUNC(SEL_COMMAND, MID_OPENTRACKER, GUIParam_PopupMenuInterface::onCmdOpenTracker),
00050 };
00051
00052
00053 FXIMPLEMENT(GUIParam_PopupMenuInterface, FXMenuPane, GUIParam_PopupMenuInterfaceMap, ARRAYNUMBER(GUIParam_PopupMenuInterfaceMap))
00054
00055
00056
00057
00058
00059 GUIParam_PopupMenuInterface::GUIParam_PopupMenuInterface(GUIMainWindow &app,
00060 GUIParameterTableWindow &parentWindow,
00061 GUIGlObject &o, const std::string &varName,
00062 ValueSource<SUMOReal> *src) throw()
00063 : FXMenuPane(&parentWindow), myObject(&o), myParentWindow(&parentWindow),
00064 myApplication(&app), myVarName(varName), mySource(src) {
00065 }
00066
00067
00068 GUIParam_PopupMenuInterface::~GUIParam_PopupMenuInterface() throw() {
00069 delete mySource;
00070 }
00071
00072
00073 long
00074 GUIParam_PopupMenuInterface::onCmdOpenTracker(FXObject*,FXSelector,void*) {
00075 std::string trackerName = myVarName + " from " + myObject->getFullName();
00076 GUIParameterTracker *tr = new GUIParameterTracker(*myApplication,
00077 trackerName, *myObject, 0, 0);
00078 TrackerValueDesc *newTracked = new TrackerValueDesc(
00079 myVarName, RGBColor(0, 0, 0), myObject, myApplication->getCurrentSimTime());
00080 tr->addTracked(*myObject, mySource->copy(), newTracked);
00081 tr->create();
00082 tr->show();
00083 return 1;
00084 }
00085
00086
00087
00088