Merge pull request #10 from eshifri/change-sign
Add +/- button to virtual number_edir keyboard.
This commit is contained in:
+8
-2
@@ -64,11 +64,17 @@ NumberKeyboard::NumberKeyboard() :
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
new TextButton(this, {LCD_W / 2 - 55, 50, 110, 30}, "DEFAULT",
|
||||
new TextButton(this, { LCD_W/2 - 55, 50, 50, 30 }, "DEF",
|
||||
[=]() -> uint8_t {
|
||||
pushEvent(EVT_VIRTUAL_KEY_DEFAULT);
|
||||
pushEvent(EVT_VIRTUAL_KEY_DEFAULT);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
new TextButton(this, { LCD_W/2 + 5, 50, 50, 30 }, "+/-",
|
||||
[=]() -> uint8_t {
|
||||
pushEvent(EVT_VIRTUAL_KEY_SIGN);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
}
|
||||
|
||||
NumberKeyboard::~NumberKeyboard()
|
||||
|
||||
@@ -134,6 +134,10 @@ void NumberEdit::onEvent(event_t event)
|
||||
case EVT_VIRTUAL_KEY_MIN:
|
||||
setValue(getMin());
|
||||
break;
|
||||
|
||||
case EVT_VIRTUAL_KEY_SIGN:
|
||||
setValue(-getValue());
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user