 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
62 FXIMPLEMENT(
GUIDialog_Breakpoints, FXMainWindow, GUIDialog_BreakpointsMap, ARRAYNUMBER(GUIDialog_BreakpointsMap))
70 myParent(parent), myBreakpoints(&breakpoints), myBreakpointLock(&breakpointLock) {
76 myTable->setVisibleRows(20);
77 myTable->setVisibleColumns(1);
78 myTable->setTableSize(20, 1);
79 myTable->setBackColor(FXRGB(255, 255, 255));
80 myTable->getRowHeader()->setWidth(0);
81 myBreakpointLock->lock();
83 myBreakpointLock->unlock();
98 myParent->addChild(
this);
110 FXMainWindow::show();
121 myTable->setColumnText(0,
"Time");
122 FXHeader* header =
myTable->getColumnHeader();
124 header->setItemJustify(0, JUSTIFY_CENTER_X);
136 FXFileDialog opendialog(
this,
"Load Breakpoints");
138 opendialog.setSelectMode(SELECTFILE_ANY);
139 opendialog.setPatternList(
"*.txt");
143 if (opendialog.execute()) {
145 std::string file = opendialog.getFilename().text();
148 myBreakpoints->assign(newBreakpoints.begin(), newBreakpoints.end());
167 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
176 std::ostringstream strm;
205 const FXTablePos*
const i = (FXTablePos*) ptr;
208 const bool empty = value.find_first_not_of(
" ") == std::string::npos;
222 std::string msg =
"The value must be a number, is:" + value;
223 FXMessageBox::error(
this, MBOX_OK,
"Time format error",
"%s", msg.c_str());
225 std::string msg =
"The value must be a number or a string of the form hh:mm:ss, is:" + value;
226 FXMessageBox::error(
this, MBOX_OK,
"Time format error",
"%s", msg.c_str());
235 FXMainWindow::layout();
void show()
sets the focus after the window is created
#define GUIDesignChooserLayoutLeft
design for Chooser Layout left
Static storage of an output device and its base (abstract) implementation.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
std::string encode2TXT()
Builds a text representation of the items in the list.
@ MID_CHOOSEN_CLEAR
Clear set.
std::vector< SUMOTime > * myBreakpoints
List of breakpoints.
FXMutex * myBreakpointLock
Lock for modifying the list of breakpoints.
@ MID_CANCEL
Cancel-button pressed.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void close()
Closes the device and removes it from the dictionary.
@ MID_CHOOSEN_LOAD
Load set.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
~GUIDialog_Breakpoints()
Destructor.
#define GUIDesignHorizontalSeparator
void removeChild(FXMainWindow *child)
#define GUIDesignBreakpointTableHeaderHeight
Height of breakpoint Table header.
#define GUIDesignBreakpointTable
design for Breakpoint table
FXDEFMAP(GUIDialog_Breakpoints) GUIDialog_BreakpointsMap[]
std::string time2string(SUMOTime t)
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
FXTable * myTable
The list that holds the ids.
#define GUIDesignChooserButtons
design for Chooser buttons
FXString gCurrentFolder
The folder used as last.
SUMOTime string2time(const std::string &r)
Editor for simulation breakpoints.
@ MID_CHOOSEN_SAVE
Save set.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
void rebuildList()
Rebuilds the entire list.
long onCmdEditTable(FXObject *, FXSelector, void *)
Called when the table was changed.
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
#define GUIDesignChooserDialog
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user presses the Close-button.
#define GUIDesignChooserLayoutRight
design for Chooser Layout right
static std::vector< SUMOTime > loadBreakpoints(const std::string &file)
loads breakpoints from the specified file
GUIMainWindow * myParent
The parent window.