| 1501 | |
| 1502 | |
| 1503 | class AFDataArrayTable : public wxGridTableBase |
| 1504 | { |
| 1505 | |
| 1506 | public: |
| 1507 | wxString label; |
| 1508 | std::vector<double> d_ary; |
| 1509 | double def_val; |
| 1510 | int choice_col; |
| 1511 | wxString collabels; |
| 1512 | wxString rowlabels; |
| 1513 | |
| 1514 | AFDataArrayTable(std::vector<double>& da, const wxString& _collabels, const wxString& _rowlabels) |
| 1515 | { |
| 1516 | SetArray(da); |
| 1517 | choice_col = 0; |
| 1518 | collabels = _collabels; |
| 1519 | rowlabels = _rowlabels; |
| 1520 | } |
| 1521 | |
| 1522 | void SetArray(std::vector<double>& da) |
| 1523 | { |
| 1524 | d_ary = da; |
| 1525 | } |
| 1526 | |
| 1527 | std::vector<double> GetArray() |
| 1528 | { |
| 1529 | return d_ary; |
| 1530 | } |
| 1531 | |
| 1532 | void SetChoiceCol(int& col) |
| 1533 | { |
| 1534 | choice_col = col; |
| 1535 | } |
| 1536 | |
| 1537 | int GetNumberRows() |
| 1538 | { |
| 1539 | return (int)d_ary.size(); |
| 1540 | } |
| 1541 | |
| 1542 | int GetNumberCols() |
| 1543 | { |
| 1544 | return 1; |
| 1545 | } |
| 1546 | |
| 1547 | bool IsEmptyCell(int, int) |
| 1548 | { |
| 1549 | return false; |
| 1550 | } |
| 1551 | |
| 1552 | wxString GetValue(int row, int col) |
| 1553 | { |
| 1554 | if (row >= 0 && row < (int)d_ary.size() && col == 0 ) |
| 1555 | return wxString::Format("%g", d_ary[row]); |
| 1556 | else |
| 1557 | return "-0.0"; |
| 1558 | } |
| 1559 | |
| 1560 | void SetValue(int row, int col, const wxString& value) |
nothing calls this directly
no outgoing calls
no test coverage detected