56 #ifdef CHECK_MEMORY_LEAKS
58 #endif // CHECK_MEMORY_LEAKS
64 #define INVALID_VALUE -1
65 #define INVALID_VALUE_STR "-1"
87 :
FXMainWindow(parent->getApp(), "Breakpoints Editor", NULL, NULL, DECOR_ALL, 20, 20, 300, 300),
88 myParent(parent), myBreakpoints(&breakpoints), myBreakpointLock(&breakpointLock) {
93 myTable->setVisibleRows(20);
94 myTable->setVisibleColumns(1);
95 myTable->setTableSize(20, 1);
96 myTable->setBackColor(FXRGB(255, 255, 255));
97 myTable->setCellType(0,
CT_REAL);
103 myTable->setNumberCellParams(0, begin / 1000, end / 1000, 1, 10, 100,
"%.2f");
104 myTable->getRowHeader()->setWidth(0);
105 myBreakpointLock->lock();
107 myBreakpointLock->unlock();
109 FXVerticalFrame* layout =
new FXVerticalFrame(hbox, LAYOUT_TOP, 0, 0, 0, 0, 4, 4, 4, 4);
111 new FXButton(layout,
"Load\t\t", 0,
this,
MID_CHOOSEN_LOAD, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
113 new FXButton(layout,
"Save\t\t", 0,
this,
MID_CHOOSEN_SAVE, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
114 new FXHorizontalSeparator(layout, SEPARATOR_GROOVE | LAYOUT_FILL_X);
116 new FXButton(layout,
"Clear\t\t", 0,
this,
MID_CHOOSEN_CLEAR, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
117 new FXHorizontalSeparator(layout, SEPARATOR_GROOVE | LAYOUT_FILL_X);
119 new FXButton(layout,
"Close\t\t", 0,
this,
MID_CANCEL, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
122 myParent->addChild(
this);
137 myTable->setColumnText(0,
"Time");
138 FXHeader* header =
myTable->getColumnHeader();
139 header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
141 for (k = 0; k < 1; k++) {
142 header->setItemJustify(k, JUSTIFY_CENTER_X);
146 std::vector<int>::iterator j;
152 for (k = 0; k < 1; k++) {
153 myTable->setItemText(row, k,
" ");
160 FXFileDialog opendialog(
this,
"Load Breakpoints");
162 opendialog.setSelectMode(SELECTFILE_ANY);
163 opendialog.setPatternList(
"*.txt");
167 if (opendialog.execute()) {
169 std::string file = opendialog.getFilename().text();
172 myBreakpoints->assign(newBreakpoints.begin(), newBreakpoints.end());
192 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
201 std::ostringstream strm;
235 std::string value = i->
item->getText().text();
237 if (value.find_first_not_of(
" ") == std::string::npos) {
251 std::string msg =
"The value must be an int, is:" + value;
252 FXMessageBox::error(
this, MBOX_OK,
"Number format error",
"%s", msg.c_str());