| 502 | } |
| 503 | |
| 504 | void UIGrid::SetVal(int col, int row, float val, bool notifyListener) |
| 505 | { |
| 506 | col = ofClamp(col, 0, MAX_GRID_COLS - 1); |
| 507 | row = ofClamp(row, 0, MAX_GRID_ROWS - 1); |
| 508 | if (val != mData[GetDataIndex(col, row)]) |
| 509 | { |
| 510 | float oldValue = mData[GetDataIndex(col, row)]; |
| 511 | mData[GetDataIndex(col, row)] = val; |
| 512 | |
| 513 | if (mSingleColumn && val > 0) |
| 514 | { |
| 515 | for (int i = 0; i < MAX_GRID_ROWS; ++i) |
| 516 | { |
| 517 | if (i != row) |
| 518 | mData[GetDataIndex(col, i)] = 0; |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | if (notifyListener && mListener) |
| 523 | mListener->GridUpdated(this, col, row, val, oldValue); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | void UIGrid::SetHighlightCol(double time, int col) |
| 528 | { |