mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] EditableCellTableViewController: function and sequence
values table cells were to narrow to display LargeNumberOfSignificantDigits (~16 digits). We adjust the number of digits authorized before switching to scientific mode to the cell width
This commit is contained in:
@@ -78,7 +78,7 @@ void EditableCellTableViewController::willDisplayCellAtLocationWithDisplayMode(H
|
||||
}
|
||||
if (!myEditableValueCell->editableTextCell()->textField()->isEditing()) {
|
||||
myCell->setEven(j%2 == 0);
|
||||
PrintFloat::convertFloatToText<double>(dataAtLocation(i, j), buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, floatDisplayMode);
|
||||
PrintFloat::convertFloatToText<double>(dataAtLocation(i, j), buffer, cellBufferSize(i), Constant::LargeNumberOfSignificantDigits, floatDisplayMode);
|
||||
myEditableValueCell->editableTextCell()->textField()->setText(buffer);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -22,6 +22,11 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
protected:
|
||||
static constexpr KDCoordinate k_cellHeight = 20;
|
||||
/* Editable cell might be not wide enough to display
|
||||
* LargeNumberOfSignificantDigits, we update the buffer to the column width. */
|
||||
size_t cellBufferSize(int i) {
|
||||
return columnWidth(i)/KDFont::SmallFont->glyphSize().width()+1;
|
||||
}
|
||||
private:
|
||||
virtual bool cellAtLocationIsEditable(int columnIndex, int rowIndex) = 0;
|
||||
virtual bool setDataAtLocation(double floatBody, int columnIndex, int rowIndex) = 0;
|
||||
|
||||
@@ -171,7 +171,7 @@ void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, in
|
||||
// The cell is a value cell
|
||||
EvenOddBufferTextCell * myValueCell = (EvenOddBufferTextCell *)cell;
|
||||
double x = m_interval->element(j-1);
|
||||
PoincareHelpers::ConvertFloatToText<double>(evaluationOfAbscissaAtColumn(x, i), buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits);
|
||||
PoincareHelpers::ConvertFloatToText<double>(evaluationOfAbscissaAtColumn(x, i), buffer, cellBufferSize(i), Constant::LargeNumberOfSignificantDigits);
|
||||
myValueCell->setText(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user