62FXIMPLEMENT(
GUIDialog_Breakpoints, FXMainWindow, GUIDialog_BreakpointsMap, ARRAYNUMBER(GUIDialog_BreakpointsMap))
71 myParent(parent), myBreakpoints(&breakpoints), myBreakpointLock(&breakpointLock), mySimBegin(simBegin) {
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);
115 FXMainWindow::show();
127 FXHeader* header =
myTable->getColumnHeader();
129 header->setItemJustify(0, JUSTIFY_CENTER_X);
141 FXFileDialog opendialog(
this,
TL(
"Load Breakpoints"));
143 opendialog.setSelectMode(SELECTFILE_ANY);
144 opendialog.setPatternList(
"*.txt");
148 if (opendialog.execute()) {
150 std::string file = opendialog.getFilename().text();
153 myBreakpoints->assign(newBreakpoints.begin(), newBreakpoints.end());
172 FXMessageBox::error(
this, MBOX_OK,
TL(
"Storing failed!"),
"%s", e.what());
181 std::ostringstream strm;
217 const FXTablePos*
const i = (FXTablePos*) ptr;
220 const bool empty = value.find_first_not_of(
" ") == std::string::npos;
236 (*myBreakpoints)[i->row] = t;
240 std::string msg =
"The value must be a number, is:" + value;
241 FXMessageBox::error(
this, MBOX_OK,
TL(
"Time format error"),
"%s", msg.c_str());
243 std::string msg =
"The value must be a number or a string of the form hh:mm:ss, is:" + value;
244 FXMessageBox::error(
this, MBOX_OK,
TL(
"Time format error"),
"%s", msg.c_str());
253 FXMainWindow::layout();
@ MID_CANCEL
Cancel-button pressed.
@ MID_CHOOSEN_SAVE
Save set.
@ MID_CHOOSEN_LOAD
Load set.
@ MID_CHOOSEN_CLEAR
Clear set.
@ MID_TIMELINK_BREAKPOINT
Set breakpionts from messages - Option.
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
#define GUIDesignChooserButtons
design for Chooser buttons
#define GUIDesignBreakpointTable
design for Breakpoint table
#define GUIDesignChooserLayoutLeft
design for Chooser Layout left
#define GUIDesignChooserLayoutRight
design for Chooser Layout right
#define GUIDesignHorizontalSeparator
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignChooserDialog
FXDEFMAP(GUIDialog_Breakpoints) GUIDialog_BreakpointsMap[]
FXString gCurrentFolder
The folder used as last.
GUIIcon
An enumeration of icons used by the gui applications.
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
The main window of the SUMO-gui.
void eraseBreakpointDialog()
erase current breakpoint dialog
Editor for simulation breakpoints.
long onCmdUpdateBreakpoints(FXObject *, FXSelector, void *)
Called when the user clicks a time link in the message window.
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user presses the Close-button.
FXMutex * myBreakpointLock
Lock for modifying the list of breakpoints.
FXTable * myTable
The list that holds the ids.
~GUIDialog_Breakpoints()
Destructor.
GUIApplicationWindow * myParent
The parent window.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
std::vector< SUMOTime > * myBreakpoints
List of breakpoints.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
void show()
sets the focus after the window is created
long onCmdEditTable(FXObject *, FXSelector, void *)
Called when the table was changed.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
void rebuildList()
Rebuilds the entire list.
std::string encode2TXT()
Builds a text representation of the items in the list.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void removeChild(FXMainWindow *child)
removes the given child window from the list (FXMainWindow)
Persists window position in the registry.
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.
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.