Allow changing displayed fields in DriverView
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "gui/common/DataField.hpp"
|
||||
#include "texts/TextKeysAndLanguages.hpp"
|
||||
#include "touchgfx/Color.hpp"
|
||||
#include "touchgfx/Unicode.hpp"
|
||||
#include <gui/containers/DriverViewField.hpp>
|
||||
|
||||
@ -43,6 +44,12 @@ void DriverViewField::setValue(int boolValue) {
|
||||
updateValueBuffer();
|
||||
}
|
||||
|
||||
void DriverViewField::setSelected(int selected) {
|
||||
uint8_t v = selected ? 0x44 : 0x00;
|
||||
box.setColor(touchgfx::Color::getColorFromRGB(v, v, v));
|
||||
box.invalidate();
|
||||
}
|
||||
|
||||
void DriverViewField::updateValueBuffer() {
|
||||
switch (fieldKind) {
|
||||
case DataFieldKind::Numeric: {
|
||||
|
||||
17
TouchGFX/gui/src/containers/DriverViewFieldSelection.cpp
Normal file
17
TouchGFX/gui/src/containers/DriverViewFieldSelection.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "touchgfx/Color.hpp"
|
||||
#include <gui/containers/DriverViewFieldSelection.hpp>
|
||||
|
||||
DriverViewFieldSelection::DriverViewFieldSelection() {}
|
||||
|
||||
void DriverViewFieldSelection::initialize() {
|
||||
DriverViewFieldSelectionBase::initialize();
|
||||
}
|
||||
|
||||
void DriverViewFieldSelection::setName(const touchgfx::TypedText &name) {
|
||||
this->name.setTypedText(name);
|
||||
}
|
||||
|
||||
void DriverViewFieldSelection::setSelected(int selected) {
|
||||
int val = selected ? 0x66 : 0x22;
|
||||
bg.setColor(touchgfx::Color::getColorFromRGB(val, val, val));
|
||||
}
|
||||
Reference in New Issue
Block a user