From f293b57e8b0c5f12d5da839e4041a187dc5852d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 17 Oct 2016 16:23:24 +0200 Subject: [PATCH] [apps/graph/values] Add an empty row at the end of the table Change-Id: I00c5de0b4290457506b75500ed90a9868222fa02 --- apps/graph/values/values_controller.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/graph/values/values_controller.cpp b/apps/graph/values/values_controller.cpp index f41e03954..73fd670d1 100644 --- a/apps/graph/values/values_controller.cpp +++ b/apps/graph/values/values_controller.cpp @@ -44,7 +44,7 @@ ViewController * ValuesController::parameterController() { } int ValuesController::numberOfRows() { - return 1 + m_interval.numberOfElements(); + return 2 + m_interval.numberOfElements(); }; int ValuesController::numberOfColumns() { @@ -272,6 +272,7 @@ int ValuesController::reusableCellCount(int type) { void ValuesController::willDisplayCellAtLocation(View * cell, int i, int j) { EvenOddCell * myCell = (EvenOddCell *)cell; myCell->setEven(j%2 == 0); + // The cell is a title cell: if (j == 0) { TitleCell * mytitleCell = (TitleCell *)cell; if (i == 0) { @@ -284,8 +285,16 @@ void ValuesController::willDisplayCellAtLocation(View * cell, int i, int j) { myFunctionCell->setText(function->name(), function->color()); return; } + // The cell is a value cell: ValueCell * myValueCell = (ValueCell *)cell; char buffer[14]; + // Special case 1: last row + if (j == numberOfRows() - 1) { + buffer[0] = 0; + myValueCell->setText(buffer); + return; + } + // Special case 2: first column if (i == 0){ Float(m_interval.element(j-1)).convertFloatToText(buffer, 14, 7); myValueCell->setText(buffer);