You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
2 years ago
|
#include <assert.h>
|
||
|
|
||
|
#include <eez/flow/flow.h>
|
||
|
#include <eez/flow/hooks.h>
|
||
|
|
||
|
#include "../gui/app_context.h"
|
||
|
#include "../gui/keypad.h"
|
||
|
|
||
|
namespace eez {
|
||
|
namespace flow {
|
||
|
|
||
|
void showKeyboard(Value label, Value initialText, Value minChars, Value maxChars, bool isPassword, void(*onOk)(char *), void(*onCancel)()) {
|
||
|
eez::gui::startTextKeyboard(label.getString(), initialText.getString(), minChars.toInt32(), maxChars.toInt32(), isPassword, onOk, onCancel, nullptr);
|
||
|
}
|
||
|
|
||
|
void showKeypad(Value label, Value initialValue, Value min, Value max, Unit unit, void(*onOk)(float), void(*onCancel)()) {
|
||
|
NumericKeypadOptions options;
|
||
|
options.pageId = PAGE_ID_NUMERIC_KEYPAD;
|
||
|
options.min = min.toFloat();
|
||
|
options.max = max.toFloat();
|
||
|
options.editValueUnit = unit;
|
||
|
|
||
|
eez::gui::startNumericKeypad(&g_deviceAppContext, label.getString(), initialValue, options, onOk, nullptr, onCancel);
|
||
|
}
|
||
|
|
||
|
void initHooks() {
|
||
|
showKeyboardHook = showKeyboard;
|
||
|
showKeypadHook = showKeypad;
|
||
|
}
|
||
|
|
||
|
} // namespace flow
|
||
|
} // namespace eez
|