62FXIMPLEMENT(
GUIDialog_Breakpoints, FXMainWindow, GUIDialog_BreakpointsMap, ARRAYNUMBER(GUIDialog_BreakpointsMap))
72 myBreakpoints(&breakpoints),
73 myBreakpointLock(&breakpointLock),
74 mySimBegin(simBegin) {
80 myTable->setVisibleRows(20);
81 myTable->setVisibleColumns(1);
82 myTable->setTableSize(20, 1);
83 myTable->setBackColor(FXRGB(255, 255, 255));
84 myTable->getRowHeader()->setWidth(0);
85 myBreakpointLock->lock();
87 myBreakpointLock->unlock();
102 myParent->addChild(
this);
118 FXMainWindow::show();
130 FXHeader* header =
myTable->getColumnHeader();
132 header->setItemJustify(0, JUSTIFY_CENTER_X);
144 FXFileDialog opendialog(
this,
TL(
"Load Breakpoints"));
146 opendialog.setSelectMode(SELECTFILE_ANY);
147 opendialog.setPatternList(
"*.txt");
151 if (opendialog.execute()) {
153 std::string file = opendialog.getFilename().text();
156 myBreakpoints->assign(newBreakpoints.begin(), newBreakpoints.end());
175 FXMessageBox::error(
this, MBOX_OK,
TL(
"Storing failed!"),
"%s", e.what());
184 std::ostringstream strm;
220 const FXTablePos*
const i = (FXTablePos*) ptr;
223 const bool empty = value.find_first_not_of(
" ") == std::string::npos;
239 (*myBreakpoints)[i->row] = t;
243 std::string msg =
"The value must be a number, is:" + value;
244 FXMessageBox::error(
this, MBOX_OK,
TL(
"Time format error"),
"%s", msg.c_str());
246 std::string msg =
"The value must be a number or a string of the form hh:mm:ss, is:" + value;
247 FXMessageBox::error(
this, MBOX_OK,
TL(
"Time format error"),
"%s", msg.c_str());
256 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 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)
int GUIDesignHeight
the default size for GUI elements
The main window of the SUMO-gui.
void eraseBreakpointDialog()
erase current breakpoint dialog
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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.
SUMOTime mySimBegin
simulation begin
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()
FOX need this.
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.