diff options
| Commit | 8fe5955772e0c10f22a8f6e40616ce79b2e88491 (patch) | |
|---|---|---|
| Author | 2022-05-29 09:04:09 +0300 | |
| Committer | 2022-05-29 09:04:09 +0300 | |
| Files | 7222a140de6faaf3660677b3f42f8f3374336022 /src | |
| FMI-OOP-P2_Tables-8fe5955772e0c10f22a8f6e40616ce79b2e88491.tar FMI-OOP-P2_Tables-8fe5955772e0c10f22a8f6e40616ce79b2e88491.tar.gz FMI-OOP-P2_Tables-8fe5955772e0c10f22a8f6e40616ce79b2e88491.zip | ||
| Parent | 189c8857e59b03124602a22782f16ef7dbc03337 (diff) | |
Autocommit at 29.05.2022 @ 09:04
3 files changed, 4 insertions, 5 deletions
| -rw-r--r-- | src/Generic/ConsoleInterface/Toolbox.cpp | 6 | ||||
| -rw-r--r-- | src/UserInterface/UserInterface.cpp | 2 | ||||
| -rw-r--r-- | src/main.cpp | 1 |
diff --git a/src/Generic/ConsoleInterface/Toolbox.cpp b/src/Generic/ConsoleInterface/Toolbox.cpp index 1723c58..64649e9 100644 --- a/src/Generic/ConsoleInterface/Toolbox.cpp +++ b/src/Generic/ConsoleInterface/Toolbox.cpp @@ -46,7 +46,6 @@ void __printTableLine(unsigned columns) { } void __printPadded(const String& str, unsigned width) { - std::cout << width << " " << str.get_length(); while (width - str.get_length() > 0) { width--; print(" "); @@ -78,12 +77,11 @@ void printTable(const List<String>& items, unsigned columns) { for (unsigned i = 0; i < items.get_count(); i++) { __printPadded(items[i], colWidths[i % columns]); - if (i > 0 && i % columns == 0) + if (i % columns == columns - 1) printLine(""); - else if (i % columns > 0 && i % columns < columns - 1) + else if (i % columns > 0) print("|"); } - printLine(""); delete[] colWidths; } diff --git a/src/UserInterface/UserInterface.cpp b/src/UserInterface/UserInterface.cpp index b456e97..5e9ef00 100644 --- a/src/UserInterface/UserInterface.cpp +++ b/src/UserInterface/UserInterface.cpp @@ -14,7 +14,7 @@ void UserInterface::com_print(const char* params) { } void UserInterface::com_edit(const char* params) { - //TODO + while (*params == ' ') params++; } /* Public */ diff --git a/src/main.cpp b/src/main.cpp index a5d47a3..9cff886 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ int main() { Table table(5, 5); table.putCell(0, 0, "Test"); + table.putCell(1, 0, "3"); UserInterface ui(&table); ui.run(); } |
