| 494 | |
| 495 | |
| 496 | void VariableGridData::Sort(int col, bool ascending) |
| 497 | { |
| 498 | // get all values for column |
| 499 | m_sorted = false; |
| 500 | wxArrayString col_values; |
| 501 | for (int row = 0; row < m_rows; row++) |
| 502 | col_values.Add(GetValue(row, col)); |
| 503 | wxArrayString sorted_col_value(col_values); |
| 504 | // sort |
| 505 | sorted_col_value.Sort(!ascending); |
| 506 | // update index to get value |
| 507 | // TODO - handle same values |
| 508 | |
| 509 | for (int row = 0; row < m_rows; row++) |
| 510 | m_sorted_index[row] = -1; |
| 511 | for (int row = 0; row < m_rows; row++) |
| 512 | { |
| 513 | int ndx = col_values.Index(sorted_col_value[row]); |
| 514 | if (m_sorted_index.Index(ndx) != wxNOT_FOUND) |
| 515 | col_values[ndx] = "|||||||||"; // hopefully not in original list |
| 516 | ndx = col_values.Index(sorted_col_value[row]); |
| 517 | m_sorted_index[row] = ndx; |
| 518 | } |
| 519 | m_sorted = true; |
| 520 | } |
| 521 | |
| 522 | |
| 523 | wxGridCellAttr *VariableGridData::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind kind) |
no test coverage detected