61 FXIMPLEMENT(
GUIDialog_Breakpoints, FXMainWindow, GUIDialog_BreakpointsMap, ARRAYNUMBER(GUIDialog_BreakpointsMap))
69 myParent(parent), myBreakpoints(&breakpoints), myBreakpointLock(&breakpointLock) {
75 myTable->setVisibleRows(20);
76 myTable->setVisibleColumns(1);
77 myTable->setTableSize(20, 1);
78 myTable->setBackColor(FXRGB(255, 255, 255));
79 myTable->getRowHeader()->setWidth(0);
80 myBreakpointLock->lock();
82 myBreakpointLock->unlock();
97 myParent->addChild(
this);
109 FXMainWindow::show();
120 myTable->setColumnText(0,
"Time");
121 FXHeader* header =
myTable->getColumnHeader();
123 header->setItemJustify(0, JUSTIFY_CENTER_X);
135 FXFileDialog opendialog(
this,
"Load Breakpoints");
137 opendialog.setSelectMode(SELECTFILE_ANY);
138 opendialog.setPatternList(
"*.txt");
142 if (opendialog.execute()) {
144 std::string file = opendialog.getFilename().text();
147 myBreakpoints->assign(newBreakpoints.begin(), newBreakpoints.end());
166 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
175 std::ostringstream strm;
204 const FXTablePos*
const i = (FXTablePos*) ptr;
207 const bool empty = value.find_first_not_of(
" ") == std::string::npos;
221 std::string msg =
"The value must be a number, is:" + value;
222 FXMessageBox::error(
this, MBOX_OK,
"Time format error",
"%s", msg.c_str());
224 std::string msg =
"The value must be a number or a string of the form hh:mm:ss, is:" + value;
225 FXMessageBox::error(
this, MBOX_OK,
"Time format error",
"%s", msg.c_str());
234 FXMainWindow::layout();
@ MID_CANCEL
Cancel-button pressed.
@ MID_CHOOSEN_SAVE
Save set.
@ MID_CHOOSEN_LOAD
Load set.
@ MID_CHOOSEN_CLEAR
Clear set.
#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) frames used to pack another frames 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.
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
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.
FXTable * myTable
The list that holds the ids.
~GUIDialog_Breakpoints()
Destructor.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
GUIMainWindow * myParent
The parent window.
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)
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)
Returns the described OutputDevice.
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.