Forms refactoring

This commit is contained in:
Bertrand Songis
2019-10-18 22:26:20 +02:00
parent a98b0a4f79
commit 48de6ca188
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ bool Button::onTouchEnd(coord_t x, coord_t y)
{
if (enabled()) {
onPress();
if (!(flags & BUTTON_NOFOCUS)) {
if (!(windowFlags & BUTTON_NOFOCUS)) {
setFocus();
}
}
+2
View File
@@ -30,6 +30,7 @@ FormField::FormField(Window *parent, const rect_t & rect, WindowFlags windowFlag
}
}
#if defined(HARDWARE_KEYS)
void FormField::onEvent(event_t event)
{
TRACE_WINDOWS("%s received event 0x%X", FormField::getWindowDebugString().c_str(), event);
@@ -56,6 +57,7 @@ void FormField::onEvent(event_t event)
Window::onEvent(event);
}
}
#endif
void FormField::paint(BitmapBuffer * dc)
{
+2 -2
View File
@@ -23,10 +23,10 @@
#include "mainwindow.h"
#include "form.h"
class Keyboard: public Window {
class Keyboard: public FormWindow {
public:
explicit Keyboard(coord_t height):
Window(nullptr, {0, LCD_H - height, LCD_W, height}, OPAQUE)
FormWindow(nullptr, {0, LCD_H - height, LCD_W, height}, OPAQUE)
{
}