Eclipse SUMO - Simulation of Urban MObility
MFXAddEditTypedTable.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2004-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // missing_desc
15 /****************************************************************************/
16 
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
23 #include <fx.h>
24 #include <fxkeys.h>
26 #include <utils/common/ToString.h>
27 #include "MFXAddEditTypedTable.h"
28 #include <iostream>
29 
30 
31 // Map
32 FXDEFMAP(MFXAddEditTypedTable) MFXAddEditTypedTableMap[] = {
33  FXMAPFUNC(SEL_CLICKED, 0, MFXAddEditTypedTable::onClicked),
34  FXMAPFUNC(SEL_DOUBLECLICKED, 0, MFXAddEditTypedTable::onDoubleClicked),
35  FXMAPFUNC(SEL_LEFTBUTTONRELEASE, 0, MFXAddEditTypedTable::onLeftBtnRelease),
36  FXMAPFUNC(SEL_LEFTBUTTONPRESS, 0, MFXAddEditTypedTable::onLeftBtnPress),
37 };
38 // Object implementation
39 FXIMPLEMENT(MFXAddEditTypedTable, FXTable, MFXAddEditTypedTableMap, ARRAYNUMBER(MFXAddEditTypedTableMap))
40 
41 
42 MFXAddEditTypedTable::MFXAddEditTypedTable(FXComposite* p, FXObject* tgt,
43  FXSelector sel, FXuint opts,
44  FXint x, FXint y, FXint w, FXint h,
45  FXint pl, FXint pr, FXint pt, FXint pb)
46  : FXTable(p, tgt, sel, opts, x, y, w, h, pl, pr, pt, pb) {}
47 
48 
50 
51 /*
52 void
53 MFXAddEditTypedTable::editItem(FXTableItem* item,FXint how)
54 {
55  if(item==0) {
56  editEnd();
57  return;
58  }
59  if(myWriteProtectedCols.find(myEditedCol)!=myWriteProtectedCols.end()) {
60  editEnd();
61  return;
62  }
63  FXTableItem* it= item;
64  myPreviousText = item->getText();
65  FXint x = getColumnX(myEditedCol) + getRowHeader()->getWidth() + xpos;
66  FXint y = getRowY(myEditedRow) + getColumnHeader()->getHeight() + ypos;
67  FXIcon* icon = item->getIcon();
68  if(icon) x += icon->getWidth() + 4;
69  FXint vw = getViewportWidth();
70  if(vertical->shown()) vw -= vertical->getWidth();
71  if(vw>getColumnWidth(myEditedCol)) {
72  vw = getColumnWidth(myEditedCol) + x;
73  }
74  switch(getCellType(myEditedCol)) {
75  case CT_UNDEFINED:
76  case CT_STRING:
77  myEditor->setText(it->getText());
78  myEditor->move(x, y);
79  myEditor->resize(vw - x + 1, getRowHeight(myEditedRow) + 1);
80  myEditor->show();
81  myEditor->raise();
82  myEditor->enable();
83  myEditor->setFocus();
84  myEditor->grab();
85  if(how == 'I') {
86  myEditor->killSelection();
87  myEditor->setCursorPos(0);
88  } else if(how == 'A') {
89  myEditor->killSelection();
90  myEditor->setCursorPos(myEditor->getText().length());
91  } else myEditor->selectAll();
92  break;
93  case CT_REAL:
94  {
95  try {
96  myNumberEditor->setValue(
97  TplConvert::_2double(it->getText().text()));
98  } catch (NumberFormatException &) {
99  } catch (EmptyData &) {
100  }
101  NumberCellParams p = getNumberCellParams(myEditedCol);
102  if(p.format!="undefined") {
103  myNumberEditor->setFormatString((char*) p.format.c_str());
104  myNumberEditor->setIncrements(p.steps1, p.steps2, p.steps3);
105  myNumberEditor->setRange(p.min, p.max);
106  }
107  myNumberEditor->move(x, y);
108  myNumberEditor->resize(vw - x + 1, getRowHeight(myEditedRow) + 1);
109  myNumberEditor->show();
110  myNumberEditor->raise();
111  myNumberEditor->setFocus();
112  myNumberEditor->selectAll();
113  }
114  //myNumberEditor->setRange(0,1000);
115  break;
116  case CT_INT:
117  {
118  try {
119  myNumberEditor->setValue(
120  TplConvert::_2int(it->getText().text()));
121  } catch (NumberFormatException &) {
122  } catch (EmptyData &) {
123  }
124  NumberCellParams p = getNumberCellParams(myEditedCol);
125  if(p.format!="undefined") {
126  myNumberEditor->setFormatString((char*) p.format.c_str());
127  myNumberEditor->setIncrements(p.steps1, p.steps2, p.steps3);
128  myNumberEditor->setRange(p.min, p.max);
129  }
130  myNumberEditor->move(x, y);
131  myNumberEditor->resize(vw - x + 1, getRowHeight(myEditedRow) + 1);
132  myNumberEditor->show();
133  myNumberEditor->raise();
134  myNumberEditor->setFocus();
135  myNumberEditor->selectAll();
136  }
137  break;
138  case CT_BOOL:
139  try {
140  myBoolEditor->setCheck(
141  TplConvert::_2bool(it->getText().text())
142  ? true : false);
143  } catch (NumberFormatException &) {
144  } catch (EmptyData &) {
145  }
146  myBoolEditor->move(x, y);
147  myBoolEditor->resize(vw - x + 1, getRowHeight(myEditedRow) + 1);
148  myBoolEditor->show();
149  myBoolEditor->raise();
150  myBoolEditor->setFocus();
151  break;
152  case CT_ENUM:
153  {
154  myEnumEditor->hide();
155  myEnumEditor->clearItems();
156  if(myEnums.size()>myEditedCol) {
157  for(int i=0; i<myEnums[myEditedCol].size(); i++) {
158  myEnumEditor->appendItem(myEnums[myEditedCol][i].c_str());
159  }
160  }
161  if(myEnumEditor->findItem(it->getText())>=0) {
162  myEnumEditor->setCurrentItem(
163  myEnumEditor->findItem(it->getText()));
164  } else {
165  myEnumEditor->setCurrentItem(0);
166  }
167  myEnumEditor->setNumVisible(
168  myEnums[myEditedCol].size()<10
169  ? myEnums[myEditedCol].size()
170  : 10);
171  myEnumEditor->layout();
172  y = getRowY(myEditedRow) + getColumnHeader()->getHeight() + ypos
173  - getRowHeight(myEditedRow);
174  myEnumEditor->move(x, y);
175  myEnumEditor->resize(vw - x + 1, getRowHeight(myEditedRow) + 1);
176  myEnumEditor->show();
177  myEnumEditor->raise();
178  myEnumEditor->setFocus();
179  }
180  break;
181  default:
182  throw 1;
183  }
184  myEditedItem = it;
185 }
186 */
187 
188 
189 FXWindow*
191  FXTableItem* item = cells[r * ncols + c];
192  if (item == nullptr) {
193  return nullptr;
194 // cells[r * ncols + c] = item = createItem("", NULL, NULL);
195 // if (isItemSelected(r, c)) {
196 // item->setSelected(FALSE);
197 // }
198  }
199  delete editor;
200  editor = nullptr;
201  switch (getCellType(c)) {
202  case CT_UNDEFINED:
203  case CT_STRING: {
204  FXTextField* field;
205  FXuint justify = 0;
206  field = new FXTextField(this, 1, nullptr, 0, TEXTFIELD_ENTER_ONLY, 0, 0, 0, 0, getMarginLeft(), getMarginRight(), getMarginTop(), getMarginBottom());
207  // !!! if(state&LEFT) justify|=JUSTIFY_LEFT;
208  // !!! if(state&RIGHT) justify|=JUSTIFY_RIGHT;
209  // !!! if(state&TOP) justify|=JUSTIFY_TOP;
210  // !!! if(state&BOTTOM) justify|=JUSTIFY_BOTTOM;
211  field->create();
212  field->setJustify(justify);
213  field->setFont(getFont());
214  field->setBackColor(getBackColor());
215  field->setTextColor(getTextColor());
216  field->setSelBackColor(getSelBackColor());
217  field->setSelTextColor(getSelTextColor());
218  field->setText(item->getText());
219  field->selectAll();
220  return field;
221  }
222  case CT_REAL:
223 // return myNumberEditor;
224  case CT_INT: {
225  FXRealSpinner* field;
226  //FXuint justify=0;
227  field = new FXRealSpinner(this, 1, nullptr, 0, TEXTFIELD_ENTER_ONLY, 0, 0, 0, 0, getMarginLeft(), getMarginRight(), getMarginTop(), getMarginBottom());
228  // !!! if(state&LEFT) justify|=JUSTIFY_LEFT;
229  // !!! if(state&RIGHT) justify|=JUSTIFY_RIGHT;
230  // !!! if(state&TOP) justify|=JUSTIFY_TOP;
231  // !!! if(state&BOTTOM) justify|=JUSTIFY_BOTTOM;
232  field->create();
233 // field->setJustify(justify);
234  field->setFont(getFont());
235  field->setBackColor(getBackColor());
236  field->setTextColor(getTextColor());
237  field->setSelBackColor(getSelBackColor());
238  field->setSelTextColor(getSelTextColor());
240  if (p.format != "undefined") {
241  //field->setFormatString((char*) p.format.c_str());
242  //field->setIncrements(p.steps1, p.steps2, p.steps3);
243  field->setIncrement(p.steps2);
244  field->setRange(p.min, p.max);
245  }
246  try {
247  if (getCellType(c) == CT_REAL) {
248  field->setValue(StringUtils::toDouble(item->getText().text()));
249  } else {
250  field->setValue(StringUtils::toInt(item->getText().text()));
251  }
252  } catch (NumberFormatException&) {
253  field->setValue(0);
254  }
255  //field->selectAll();
256  return field;
257  }
258  case CT_BOOL:
259 // return myBoolEditor;
260  case CT_ENUM:
261 // return myEnumEditor;
262  default:
263  throw 1;
264  }
265 }
266 
267 
268 // Cancel editing cell
269 void
271  if (editor) {
272  delete editor;
273  input.fm.row = -1;
274  input.to.row = -1;
275  input.fm.col = -1;
276  input.to.col = -1;
277  editor = nullptr;
278  }
279 }
280 
281 // Done with editing cell
282 void
284  bool set = false;
285  FXTableRange tablerange = input;
286  if (editor) {
287  FXRealSpinner* dial = dynamic_cast<FXRealSpinner*>(editor);
288  if (dial != nullptr) {
289  setItemFromControl_NoRelease(input.fm.row, input.fm.col, editor);
290  }
291  if (dynamic_cast<FXTextField*>(editor) != nullptr) {
292  set = true;
293  }
294  }
295  if (set) {
296  setItemFromControl(input.fm.row, input.fm.col, editor);
297  cancelInput();
298  if (notify && target) {
299  target->tryHandle(this, FXSEL(SEL_REPLACED, message), (void*)&tablerange);
300  }
301  }
302 }
303 
304 
305 
306 
307 void
308 MFXAddEditTypedTable::setItemFromControl(FXint r, FXint c, FXWindow* control) {
309  FXTableItem* item = cells[r * ncols + c];
310  if (item == nullptr) {
311  cells[r * ncols + c] = item = createItem("", nullptr, nullptr);
312  if (isItemSelected(r, c)) {
313  item->setSelected(FALSE);
314  }
315  }
316  switch (getCellType(c)) {
317  case CT_UNDEFINED:
318  case CT_STRING:
319  item->setFromControl(control);
320  break;
321  case CT_REAL:
322  item->setText(toString(static_cast<FXRealSpinner*>(control)->getValue()).c_str());
323  break;
324  case CT_INT:
325  item->setText(toString((int) static_cast<FXRealSpinner*>(control)->getValue()).c_str());
326  break;
327  case CT_BOOL:
328 // return myBoolEditor;
329  case CT_ENUM:
330 // return myEnumEditor;
331  default:
332  throw 1;
333  }
334 // current.row = -1;
335 // current.col = -1;
336  EditedTableItem edited;
337  edited.item = item;
338  edited.row = r;
339  edited.col = c;
340  edited.updateOnly = false;
341  killSelection(true);
342  bool accepted = true;
343  if (target) {
344  if (!target->handle(this, FXSEL(SEL_CHANGED, ID_TEXT_CHANGED), (void*) &edited)) {
345  accepted = false;
346  // !!! item->setText(myPreviousText);
347  }
348  }
349  if (accepted) {
350  if (edited.row == getNumRows() - 1) {
351  insertRows(getNumRows(), 1, true);
352  for (int i = 0; i < getNumColumns(); i++) {
353  setItemText(getNumRows() - 1, i, "");
354  setItemJustify(getNumRows() - 1, i, JUSTIFY_CENTER_X);
355  }
356  }
357  }
358  mode = MOUSE_NONE;
359 }
360 
361 
362 void
363 MFXAddEditTypedTable::setItemFromControl_NoRelease(FXint r, FXint c, FXWindow* control) {
364  FXTableItem* item = cells[r * ncols + c];
365  if (item == nullptr) {
366  return;
367  }
368  switch (getCellType(c)) {
369  case CT_UNDEFINED:
370  case CT_STRING:
371  item->setFromControl(control);
372  break;
373  case CT_REAL:
374  item->setText(toString(static_cast<FXRealSpinner*>(control)->getValue()).c_str());
375  break;
376  case CT_INT:
377  item->setText(toString((int) static_cast<FXRealSpinner*>(control)->getValue()).c_str());
378  break;
379  case CT_BOOL:
380 // return myBoolEditor;
381  case CT_ENUM:
382 // return myEnumEditor;
383  default:
384  throw 1;
385  }
386  EditedTableItem edited;
387  edited.item = item;
388  edited.row = r;
389  edited.col = c;
390  edited.updateOnly = true;
391  if (target) {
392  if (!target->handle(this, FXSEL(SEL_CHANGED, ID_TEXT_CHANGED), (void*) &edited)) {
393  // !!! item->setText(myPreviousText);
394  }
395  }
396 }
397 
398 
399 // Released button
400 long MFXAddEditTypedTable::onLeftBtnRelease(FXObject*, FXSelector, void* ptr) {
401  FXEvent* event = (FXEvent*)ptr;
402  if (isEnabled()) {
403  ungrab();
404  flags &= ~FLAG_PRESSED;
405  flags |= FLAG_UPDATE;
406  mode = MOUSE_NONE;
407  stopAutoScroll();
408  setDragCursor(getApp()->getDefaultCursor(DEF_ARROW_CURSOR));
409  if (target && target->tryHandle(this, FXSEL(SEL_LEFTBUTTONRELEASE, message), ptr)) {
410  return 1;
411  }
412 
413  // Scroll to make item visibke
414  makePositionVisible(current.row, current.col);
415 
416  // Update anchor
417  //setAnchorItem(current.row,current.col); // FIXME look into the selection stuff
418 
419  // Generate clicked callbacks
420  if (event->click_count == 1) {
421  handle(this, FXSEL(SEL_CLICKED, 0), (void*)&current);
422  } else if (event->click_count == 2) {
423  handle(this, FXSEL(SEL_DOUBLECLICKED, 0), (void*)&current);
424  } else if (event->click_count == 3) {
425  handle(this, FXSEL(SEL_TRIPLECLICKED, 0), (void*)&current);
426  }
427 
428  // Command callback only when clicked on item
429  if (0 <= current.row && 0 <= current.col && isItemEnabled(current.row, current.col)) {
430  handle(this, FXSEL(SEL_COMMAND, 0), (void*)&current);
431  }
432  return 1;
433  }
434  return 0;
435 }
436 
437 
438 // Pressed button
439 long
440 MFXAddEditTypedTable::onLeftBtnPress(FXObject*, FXSelector, void* ptr) {
441  FXEvent* event = (FXEvent*)ptr;
442  FXTablePos tablepos;
443  flags &= ~FLAG_TIP;
444  handle(this, FXSEL(SEL_FOCUS_SELF, 0), ptr);
445  if (isEnabled()) {
446  grab();
447  if (target && target->tryHandle(this, FXSEL(SEL_LEFTBUTTONPRESS, message), ptr)) {
448  return 1;
449  }
450 
451  // Cell being clicked on
452  tablepos.row = rowAtY(event->win_y);
453  tablepos.col = colAtX(event->win_x);
454 
455  // Outside table
456  if (tablepos.row < 0 || tablepos.row >= nrows || tablepos.col < 0 || tablepos.col >= ncols) {
457  setCurrentItem(-1, -1, TRUE);
458  return 0;
459  }
460 
461  // Change current item
462  bool wasEdited = editor != nullptr;
463  setCurrentItem(tablepos.row, tablepos.col, TRUE);
464  if (!wasEdited) {
465 
466  // Select or deselect
467  if (event->state & SHIFTMASK) {
468  if (0 <= anchor.row && 0 <= anchor.col) {
469  if (isItemEnabled(anchor.row, anchor.col)) {
470  extendSelection(current.row, current.col, TRUE);
471  }
472  } else {
473  setAnchorItem(current.row, current.col);
474  if (isItemEnabled(current.row, current.col)) {
475  extendSelection(current.row, current.col, TRUE);
476  }
477  }
478  mode = MOUSE_SELECT;
479  } else {
480  if (isItemEnabled(current.row, current.col)) {
481  killSelection(TRUE);
482  setAnchorItem(current.row, current.col);
483  extendSelection(current.row, current.col, TRUE);
484  } else {
485  setAnchorItem(current.row, current.col);
486  }
487  mode = MOUSE_SELECT;
488  }
489  }
490  flags &= ~FLAG_UPDATE;
491  flags |= FLAG_PRESSED;
492  return 1;
493  }
494  return 0;
495 }
496 
497 
498 
499 // Clicked in list
500 long
501 MFXAddEditTypedTable::onClicked(FXObject*, FXSelector, void* ptr) {
502  if (editor) {
503  delete editor;
504  input.fm.row = -1;
505  input.to.row = -1;
506  input.fm.col = -1;
507  input.to.col = -1;
508  editor = nullptr;
509  current.row = -1;
510  current.col = -1;
511  }
512  if (target && target->tryHandle(this, FXSEL(SEL_CLICKED, message), ptr)) {
513  return 1;
514  }
515  handle(this, FXSEL(SEL_COMMAND, ID_START_INPUT), nullptr);
516  return 1;
517 }
518 
519 
520 // Double clicked in list; ptr may or may not point to an item
521 long MFXAddEditTypedTable::onDoubleClicked(FXObject*, FXSelector, void* ptr) {
522  if (editor) {
523  delete editor;
524  input.fm.row = -1;
525  input.to.row = -1;
526  input.fm.col = -1;
527  input.to.col = -1;
528  editor = nullptr;
529  } else {
530  if (target && target->tryHandle(this, FXSEL(SEL_CLICKED, message), ptr)) {
531  return 1;
532  }
533  handle(this, FXSEL(SEL_COMMAND, ID_START_INPUT), nullptr);
534  }
535  return 1;
536 }
537 
538 
539 CellType
541  if ((int)myCellTypes.size() <= pos) {
542  return CT_UNDEFINED;
543  }
544  return myCellTypes[pos];
545 }
546 
547 
548 void
550  while ((int)myCellTypes.size() < pos + 1) {
551  myCellTypes.push_back(CT_UNDEFINED);
552  }
553  myCellTypes[pos] = t;
554 }
555 
556 void
557 MFXAddEditTypedTable::setNumberCellParams(int pos, double min, double max,
558  double steps1,
559  double steps2,
560  double steps3,
561  const std::string& format) {
562  while ((int)myNumberCellParams.size() <= pos) {
563  NumberCellParams np;
564  np.format = "undefined";
565  myNumberCellParams.push_back(np);
566  }
567  NumberCellParams np;
568  np.pos = (int)(pos);
569  np.min = min;
570  np.max = max;
571  np.steps1 = steps1;
572  np.steps2 = steps2;
573  np.steps3 = steps3;
574  np.format = format;
575  myNumberCellParams[pos] = np;
576 }
577 
578 
581  if ((int)myNumberCellParams.size() <= pos) {
582  NumberCellParams np;
583  np.format = "undefined";
584  return np;
585  }
586  return myNumberCellParams[pos];
587 }
588 
589 
590 
591 void
593  const std::vector<std::string>& params) {
594  while ((int)myEnums.size() <= pos) {
595  myEnums.push_back(std::vector<std::string>());
596  }
597  myEnums[pos] = params;
598 }
599 
600 
601 void
603  const std::string& e) {
604  while ((int)myEnums.size() <= pos) {
605  myEnums.push_back(std::vector<std::string>());
606  }
607  myEnums[pos].push_back(e);
608 }
609 
610 
611 const std::vector<std::string>&
613  return myEnums[pos];
614 }
615 
616 
617 
618 /****************************************************************************/
619 
MFXAddEditTypedTable::addEnum
void addEnum(int pos, const std::string &e)
Definition: MFXAddEditTypedTable.cpp:602
MFXAddEditTypedTable::EditedTableItem::col
int col
Definition: MFXAddEditTypedTable.h:60
MFXAddEditTypedTable::acceptInput
void acceptInput(FXbool notify)
Definition: MFXAddEditTypedTable.cpp:283
MFXAddEditTypedTable::NumberCellParams::min
double min
Definition: MFXAddEditTypedTable.h:49
MFXAddEditTypedTable::setItemFromControl_NoRelease
void setItemFromControl_NoRelease(FXint r, FXint c, FXWindow *control)
Definition: MFXAddEditTypedTable.cpp:363
MFXAddEditTypedTable::setCellType
void setCellType(int pos, CellType t)
Definition: MFXAddEditTypedTable.cpp:549
ToString.h
CT_BOOL
@ CT_BOOL
Definition: MFXAddEditTypedTable.h:33
CT_REAL
@ CT_REAL
Definition: MFXAddEditTypedTable.h:30
MFXAddEditTypedTable::getNumberCellParams
NumberCellParams getNumberCellParams(int pos) const
Definition: MFXAddEditTypedTable.cpp:580
StringUtils::toDouble
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Definition: StringUtils.cpp:345
MFXAddEditTypedTable::onDoubleClicked
long onDoubleClicked(FXObject *, FXSelector, void *ptr)
Definition: MFXAddEditTypedTable.cpp:521
MFXAddEditTypedTable::NumberCellParams::pos
int pos
Definition: MFXAddEditTypedTable.h:48
CT_UNDEFINED
@ CT_UNDEFINED
Definition: MFXAddEditTypedTable.h:29
MFXAddEditTypedTable::setNumberCellParams
void setNumberCellParams(int pos, double min, double max, double steps1, double steps2, double steps3, const std::string &format)
Definition: MFXAddEditTypedTable.cpp:557
MFXAddEditTypedTable::EditedTableItem::item
FXTableItem * item
Definition: MFXAddEditTypedTable.h:58
MFXAddEditTypedTable::NumberCellParams
Definition: MFXAddEditTypedTable.h:47
MFXAddEditTypedTable::NumberCellParams::max
double max
Definition: MFXAddEditTypedTable.h:50
CT_ENUM
@ CT_ENUM
Definition: MFXAddEditTypedTable.h:34
MFXAddEditTypedTable::EditedTableItem::updateOnly
bool updateOnly
Definition: MFXAddEditTypedTable.h:61
MFXAddEditTypedTable::EditedTableItem::row
int row
Definition: MFXAddEditTypedTable.h:59
MFXAddEditTypedTable::ID_TEXT_CHANGED
@ ID_TEXT_CHANGED
Definition: MFXAddEditTypedTable.h:129
NumberFormatException
Definition: UtilExceptions.h:95
MFXAddEditTypedTable::~MFXAddEditTypedTable
~MFXAddEditTypedTable()
Definition: MFXAddEditTypedTable.cpp:49
MFXAddEditTypedTable::NumberCellParams::steps1
double steps1
Definition: MFXAddEditTypedTable.h:51
MFXAddEditTypedTable::getEnums
const std::vector< std::string > & getEnums(int pos) const
Definition: MFXAddEditTypedTable.cpp:612
MFXAddEditTypedTable::NumberCellParams::steps3
double steps3
Definition: MFXAddEditTypedTable.h:53
FXDEFMAP
FXDEFMAP(MFXAddEditTypedTable) MFXAddEditTypedTableMap[]
CellType
CellType
Definition: MFXAddEditTypedTable.h:28
MFXAddEditTypedTable::cancelInput
void cancelInput()
Definition: MFXAddEditTypedTable.cpp:270
CT_STRING
@ CT_STRING
Definition: MFXAddEditTypedTable.h:31
MFXAddEditTypedTable::myEnums
std::vector< std::vector< std::string > > myEnums
Definition: MFXAddEditTypedTable.h:148
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
StringUtils.h
StringUtils::toInt
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
Definition: StringUtils.cpp:278
MFXAddEditTypedTable::onLeftBtnRelease
long onLeftBtnRelease(FXObject *, FXSelector, void *ptr)
Definition: MFXAddEditTypedTable.cpp:400
MFXAddEditTypedTable::setEnums
void setEnums(int pos, const std::vector< std::string > &params)
Definition: MFXAddEditTypedTable.cpp:592
MFXAddEditTypedTable::getControlForItem
virtual FXWindow * getControlForItem(FXint r, FXint c)
Definition: MFXAddEditTypedTable.cpp:190
MFXAddEditTypedTable::EditedTableItem
Definition: MFXAddEditTypedTable.h:57
CT_INT
@ CT_INT
Definition: MFXAddEditTypedTable.h:32
MFXAddEditTypedTable::NumberCellParams::format
std::string format
Definition: MFXAddEditTypedTable.h:54
MFXAddEditTypedTable::onClicked
long onClicked(FXObject *, FXSelector, void *ptr)
Definition: MFXAddEditTypedTable.cpp:501
MFXAddEditTypedTable
Definition: MFXAddEditTypedTable.h:40
MFXAddEditTypedTable::NumberCellParams::steps2
double steps2
Definition: MFXAddEditTypedTable.h:52
MFXAddEditTypedTable.h
config.h
MFXAddEditTypedTable::myCellTypes
std::vector< CellType > myCellTypes
Definition: MFXAddEditTypedTable.h:146
MFXAddEditTypedTable::onLeftBtnPress
long onLeftBtnPress(FXObject *, FXSelector, void *ptr)
Definition: MFXAddEditTypedTable.cpp:440
MFXAddEditTypedTable::setItemFromControl
virtual void setItemFromControl(FXint r, FXint c, FXWindow *control)
Definition: MFXAddEditTypedTable.cpp:308
MFXAddEditTypedTable::getCellType
CellType getCellType(int pos) const
Definition: MFXAddEditTypedTable.cpp:540
MFXAddEditTypedTable::myNumberCellParams
std::vector< NumberCellParams > myNumberCellParams
Definition: MFXAddEditTypedTable.h:147