From 8d848fd28edcba14137f7f41a9540d0880cdec28 Mon Sep 17 00:00:00 2001 From: Pablo2048 Date: Sun, 20 Dec 2020 11:53:35 +0100 Subject: [PATCH] Moznost zadavani des. cisel (zatim nezobrazovane) --- src/dialogs/enternumber.cpp | 4 +++- src/dialogs/enternumber.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dialogs/enternumber.cpp b/src/dialogs/enternumber.cpp index c0c79b3..4f0722a 100644 --- a/src/dialogs/enternumber.cpp +++ b/src/dialogs/enternumber.cpp @@ -3,15 +3,17 @@ static String entertext; static uint8_t maxDigits; // pocet zadavanych cislic +static uint8_t decplaces; // pocet desetinnych mist static uint8_t digits[8]; // hodnota v cislicich (nastavovana polozka) static uint8_t digitIdx; // index menene cifry static bool done; // priznak, ze bylo zadani dokoncene -void dialog_prepareEnterNumber(String message, int oldNumber, uint8_t numbers) +void dialog_prepareEnterNumber(String message, int oldNumber, uint8_t numbers, uint8_t decimals) { entertext = message; maxDigits = numbers; + decplaces = decimals; // naplnime cislice int i = numbers - 1; while (i >= 0) { diff --git a/src/dialogs/enternumber.h b/src/dialogs/enternumber.h index 8e73aa0..8f2cdbb 100644 --- a/src/dialogs/enternumber.h +++ b/src/dialogs/enternumber.h @@ -4,7 +4,7 @@ void drawEnterNumber(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); -void dialog_prepareEnterNumber(String message, int oldNumber, uint8_t numbers); +void dialog_prepareEnterNumber(String message, int oldNumber, uint8_t numbers, uint8_t decimals = 0); int32_t dialog_getEnterNumberResult(void);