diff --git a/radio/src/gui/colorlcd/timeedit.cpp b/radio/src/gui/colorlcd/timeedit.cpp index 8fe23dc6c..b02af5ef6 100644 --- a/radio/src/gui/colorlcd/timeedit.cpp +++ b/radio/src/gui/colorlcd/timeedit.cpp @@ -20,11 +20,11 @@ #include "libopenui_config.h" #include "timeedit.h" -#include "keyboard_number.h" + #include "strhelpers.h" TimeEdit::TimeEdit(Window * parent, const rect_t & rect, int32_t vmin, int32_t vmax, std::function getValue, std::function setValue): - BaseNumberEdit(parent, rect, vmin, vmax, std::move(getValue), std::move(setValue)) + NumberEdit(parent, rect, vmin, vmax, std::move(getValue), std::move(setValue)) { } @@ -45,55 +45,3 @@ void TimeEdit::paint(BitmapBuffer * dc) textColor); } -#if defined(HARDWARE_KEYS) -// TODO could be moved to BaseNumberEdit -void TimeEdit::onEvent(event_t event) -{ - TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString().c_str(), event); - - if (editMode) { - if (event == EVT_ROTARY_RIGHT) { - int value = getValue(); - value += ROTARY_ENCODER_SPEED() * step; - if (value <= vmax) - setValue(value); - else - onKeyError(); - return; - } - else if (event == EVT_ROTARY_LEFT) { - int value = getValue(); - value -= ROTARY_ENCODER_SPEED() * step; - if (value >= vmin) - setValue(value); - else - onKeyError(); - return; - } - } - - FormField::onEvent(event); -} -#endif - -#if defined(HARDWARE_TOUCH) -bool TimeEdit::onTouchEnd(coord_t x, coord_t y) -{ - if (!hasFocus()) { - setFocus(SET_FOCUS_DEFAULT); - } - -// NumberKeyboard * keyboard = NumberKeyboard::instance(); -// if (keyboard->getField() != this) { -// keyboard->setField(this); -// } - - return true; -} - -void TimeEdit::onFocusLost() -{ - BaseNumberEdit::onFocusLost(); -// NumberKeyboard::instance()->disable(true); -} -#endif diff --git a/radio/src/gui/colorlcd/timeedit.h b/radio/src/gui/colorlcd/timeedit.h index e34d00906..09e121200 100644 --- a/radio/src/gui/colorlcd/timeedit.h +++ b/radio/src/gui/colorlcd/timeedit.h @@ -21,9 +21,9 @@ #ifndef _TIMEEDIT_H_ #define _TIMEEDIT_H_ -#include "basenumberedit.h" +#include "numberedit.h" -class TimeEdit : public BaseNumberEdit { +class TimeEdit : public NumberEdit { public: TimeEdit(Window * parent, const rect_t & rect, int32_t vmin, int32_t vmax, std::function getValue, std::function setValue = nullptr); @@ -36,15 +36,6 @@ class TimeEdit : public BaseNumberEdit { void paint(BitmapBuffer * dc) override; -#if defined(HARDWARE_KEYS) - void onEvent(event_t event) override; -#endif - -#if defined(HARDWARE_TOUCH) - bool onTouchEnd(coord_t x, coord_t y) override; - - void onFocusLost() override; -#endif }; #endif // _TIMEEDIT_H_