63 FXIMPLEMENT(
GUIDialog_Breakpoints, FXMainWindow, GUIDialog_BreakpointsMap, ARRAYNUMBER(GUIDialog_BreakpointsMap))
71 myParent(parent), myBreakpoints(&breakpoints), myBreakpointLock(&breakpointLock) {
77 myTable->setVisibleRows(20);
78 myTable->setVisibleColumns(1);
79 myTable->setTableSize(20, 1);
80 myTable->setBackColor(FXRGB(255, 255, 255));
81 myTable->getRowHeader()->setWidth(0);
82 myBreakpointLock->lock();
84 myBreakpointLock->unlock();
99 myParent->addChild(
this);
111 FXMainWindow::show();
122 myTable->setColumnText(0,
"Time");
123 FXHeader* header =
myTable->getColumnHeader();
125 header->setItemJustify(0, JUSTIFY_CENTER_X);
137 FXFileDialog opendialog(
this,
"Load Breakpoints");
139 opendialog.setSelectMode(SELECTFILE_ANY);
140 opendialog.setPatternList(
"*.txt");
144 if (opendialog.execute()) {
146 std::string file = opendialog.getFilename().text();
149 myBreakpoints->assign(newBreakpoints.begin(), newBreakpoints.end());
168 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
177 std::ostringstream strm;
206 const FXTablePos*
const i = (FXTablePos*) data;
207 const std::string value =
myTable->getItemText(i->row, i->col).text();
209 const bool empty = value.find_first_not_of(
" ") == std::string::npos;
223 std::string msg =
"The value must be a number, is:" + value;
224 FXMessageBox::error(
this, MBOX_OK,
"Time format error",
"%s", msg.c_str());
226 std::string msg =
"The value must be a number or a string of the form hh:mm:ss, is:" + value;
227 FXMessageBox::error(
this, MBOX_OK,
"Time format error",
"%s", msg.c_str());
void close()
Closes the device and removes it from the dictionary.
std::vector< SUMOTime > * myBreakpoints
List of breakpoints.
std::string time2string(SUMOTime t)
#define GUIDesignChooserDialog
GUIMainWindow * myParent
The parent window.
#define GUIDesignBreakpointTableHeaderHeight
Height of breakpoint Table header.
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
void show()
sets the focus after the window is created
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[]
Editor for simulation breakpoints.
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user presses the Close-button.
FXMutex * myBreakpointLock
Lock for modifying the list of breakpoints.
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
#define GUIDesignHorizontalSeparator
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
#define GUIDesignChooserLayoutLeft
design for Chooser Layout left
SUMOTime string2time(const std::string &r)
#define GUIDesignChooserButtons
design for Chooser buttons
long onCmdEditTable(FXObject *, FXSelector, void *)
Called when the table was changed.
#define GUIDesignChooserLayoutRight
design for Chooser Layout right
~GUIDialog_Breakpoints()
Destructor.
void rebuildList()
Rebuilds the entire list.
void removeChild(FXMainWindow *child)
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.
FXTable * myTable
The list that holds the ids.
Static storage of an output device and its base (abstract) implementation.
#define GUIDesignBreakpointTable
design for Breakpoint table
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon