Moznost nastavit defaultni vysledek z YesNo dialogu

This commit is contained in:
Pavel Brychta 2021-02-02 09:58:14 +01:00
parent 0445129e48
commit ab95c7e60d
2 changed files with 3 additions and 2 deletions

View File

@ -55,11 +55,12 @@ void drawYesNo(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16
} }
} }
void dialog_prepareYesNoFrame(String text) void dialog_prepareYesNoFrame(String text, bool defaultResult)
{ {
yesnotext = text; yesnotext = text;
done = false; done = false;
yesNoResult = defaultResult;
ui.goToFrame(ui.getFrameIndex(drawYesNo)); ui.goToFrame(ui.getFrameIndex(drawYesNo));
} }

View File

@ -4,7 +4,7 @@
void drawYesNo(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); void drawYesNo(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
void dialog_prepareYesNoFrame(String text); void dialog_prepareYesNoFrame(String text, bool defaultResult = false);
bool dialog_getYesNoResult(void); bool dialog_getYesNoResult(void);