56 #ifdef CHECK_MEMORY_LEAKS
58 #endif // CHECK_MEMORY_LEAKS
64 #define INVALID_VALUE -1
65 #define INVALID_VALUE_STR "-1"
87 :
FXMainWindow(parent->getApp(), "Breakpoints Editor", NULL, NULL, DECOR_ALL, 20, 20, 300, 300),
93 myTable->setVisibleRows(20);
94 myTable->setVisibleColumns(1);
95 myTable->setTableSize(20, 1);
96 myTable->setBackColor(FXRGB(255, 255, 255));
97 myTable->setCellType(0,
CT_REAL);
103 myTable->setNumberCellParams(0, begin / 1000, end / 1000, 1, 10, 100,
"%.2f");
104 myTable->getRowHeader()->setWidth(0);
107 FXVerticalFrame* layout =
new FXVerticalFrame(hbox, LAYOUT_TOP, 0, 0, 0, 0, 4, 4, 4, 4);
109 new FXButton(layout,
"Load\t\t", 0,
this,
MID_CHOOSEN_LOAD, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
111 new FXButton(layout,
"Save\t\t", 0,
this,
MID_CHOOSEN_SAVE, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
112 new FXHorizontalSeparator(layout, SEPARATOR_GROOVE | LAYOUT_FILL_X);
114 new FXButton(layout,
"Clear\t\t", 0,
this,
MID_CHOOSEN_CLEAR, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
115 new FXHorizontalSeparator(layout, SEPARATOR_GROOVE | LAYOUT_FILL_X);
117 new FXButton(layout,
"Close\t\t", 0,
this,
MID_CANCEL, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
120 myParent->addChild(
this);
135 myTable->setColumnText(0,
"Time");
136 FXHeader* header =
myTable->getColumnHeader();
137 header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
139 for (k = 0; k < 1; k++) {
140 header->setItemJustify(k, JUSTIFY_CENTER_X);
144 std::vector<int>::iterator j;
150 for (k = 0; k < 1; k++) {
151 myTable->setItemText(row, k,
" ");
158 FXFileDialog opendialog(
this,
"Load Breakpoints");
160 opendialog.setSelectMode(SELECTFILE_ANY);
161 opendialog.setPatternList(
"*.txt");
165 if (opendialog.execute()) {
167 std::string file = opendialog.getFilename().text();
187 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
195 std::ostringstream strm;
225 std::string value = i->
item->getText().text();
227 if (value.find_first_not_of(
" ") == std::string::npos) {
241 std::string msg =
"The value must be an int, is:" + value;
242 FXMessageBox::error(
this, MBOX_OK,
"Number format error",
"%s", msg.c_str());
#define INVALID_VALUE_STR
void close()
Closes the device and removes it from the dictionary.
std::string time2string(SUMOTime t)
GUIMainWindow * myParent
The parent window.
MFXAddEditTypedTable * myTable
The list that holds the ids.
FXString gCurrentFolder
The folder used as last.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
static std::vector< SUMOTime > loadBreakpoints(const std::string &file)
loads breakpoints from the specified file
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
FXDEFMAP(GUIDialog_Breakpoints) GUIDialog_BreakpointsMap[]
static OptionsCont & getOptions()
Retrieves the options.
static std::vector< SUMOTime > gBreakpoints
List of breakpoints.
Editor for simulation breakpoints.
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user presses the Close-button.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
SUMOTime string2time(const std::string &r)
void removeChild(FXMDIChild *child)
removes the given child window from the list
long onCmdEditTable(FXObject *, FXSelector, void *)
Called when the table was changed.
~GUIDialog_Breakpoints()
Destructor.
void rebuildList()
Rebuilds the entire list.
std::string encode2TXT()
Builds a text representation of the items in the list.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
Static storage of an output device and its base (abstract) implementation.
static FXIcon * getIcon(GUIIcon which)