Window::~Window() is now in charge of calling deleteLater for all children
This commit is contained in:
@@ -184,31 +184,29 @@ const uint8_t LBM_SWIPE_RIGHT[] = {
|
|||||||
#include "mask_swipe_right.lbm"
|
#include "mask_swipe_right.lbm"
|
||||||
};
|
};
|
||||||
|
|
||||||
BitmapBuffer * calibStick = NULL;
|
BitmapBuffer * calibStick = nullptr;
|
||||||
BitmapBuffer * calibStickBackground = NULL;
|
BitmapBuffer * calibStickBackground = nullptr;
|
||||||
BitmapBuffer * calibTrackpBackground = NULL;
|
BitmapBuffer * calibTrackpBackground = nullptr;
|
||||||
BitmapBuffer * calibRadioPict = NULL;
|
BitmapBuffer * calibRadioPict = nullptr;
|
||||||
BitmapBuffer * modelselIconBitmap = NULL;
|
BitmapBuffer * modelselIconBitmap = nullptr;
|
||||||
BitmapBuffer * modelselSdFreeBitmap = NULL;
|
BitmapBuffer * modelselSdFreeBitmap = nullptr;
|
||||||
BitmapBuffer * modelselModelQtyBitmap = NULL;
|
BitmapBuffer * modelselModelQtyBitmap = nullptr;
|
||||||
BitmapBuffer * modelselModelNameBitmap = NULL;
|
BitmapBuffer * modelselModelNameBitmap = nullptr;
|
||||||
BitmapBuffer * modelselModelMoveBackground = NULL;
|
BitmapBuffer * modelselModelMoveBackground = nullptr;
|
||||||
BitmapBuffer * modelselModelMoveIcon = NULL;
|
BitmapBuffer * modelselModelMoveIcon = nullptr;
|
||||||
BitmapBuffer * modelselWizardBackground = NULL;
|
BitmapBuffer * modelselWizardBackground = nullptr;
|
||||||
BitmapBuffer * chanMonLockedBitmap = NULL;
|
BitmapBuffer * chanMonLockedBitmap = nullptr;
|
||||||
BitmapBuffer * chanMonInvertedBitmap = NULL;
|
BitmapBuffer * chanMonInvertedBitmap = nullptr;
|
||||||
BitmapBuffer * mixerSetupMixerBitmap = NULL;
|
BitmapBuffer * mixerSetupMixerBitmap = nullptr;
|
||||||
BitmapBuffer * mixerSetupToBitmap = NULL;
|
BitmapBuffer * mixerSetupToBitmap = nullptr;
|
||||||
BitmapBuffer * mixerSetupOutputBitmap = NULL;
|
BitmapBuffer * mixerSetupOutputBitmap = nullptr;
|
||||||
BitmapBuffer * mixerSetupAddBitmap = NULL;
|
BitmapBuffer * mixerSetupAddBitmap = nullptr;
|
||||||
BitmapBuffer * mixerSetupMultiBitmap = NULL;
|
BitmapBuffer * mixerSetupMultiBitmap = nullptr;
|
||||||
BitmapBuffer * mixerSetupReplaceBitmap = NULL;
|
BitmapBuffer * mixerSetupReplaceBitmap = nullptr;
|
||||||
BitmapBuffer * mixerSetupLabelBitmap = NULL;
|
BitmapBuffer * mixerSetupCurveIcon = nullptr;
|
||||||
BitmapBuffer * mixerSetupCurveBitmap = NULL;
|
BitmapBuffer * mixerSetupSwitchIcon = nullptr;
|
||||||
BitmapBuffer * mixerSetupSwitchIcon = NULL;
|
BitmapBuffer * mixerSetupLabelIcon = nullptr;
|
||||||
BitmapBuffer * mixerSetupDelayBitmap = NULL;
|
BitmapBuffer * mixerSetupDelayIcon = nullptr;
|
||||||
BitmapBuffer * mixerSetupSlowBitmap = NULL;
|
BitmapBuffer * mixerSetupSlowIcon = nullptr;
|
||||||
BitmapBuffer * mixerSetupDelaySlowBitmap = NULL;
|
BitmapBuffer * mixerSetupDelaySlowIcon = nullptr;
|
||||||
BitmapBuffer * mixerSetupFlightmodeIcon = NULL;
|
BitmapBuffer * mixerSetupFlightmodeIcon = nullptr;
|
||||||
BitmapBuffer * mixerSetupFlightmodeBitmap = NULL;
|
|
||||||
BitmapBuffer * mixerSetupSwitchBitmap = NULL;
|
|
||||||
|
|||||||
@@ -97,14 +97,12 @@ extern BitmapBuffer * mixerSetupOutputBitmap;
|
|||||||
extern BitmapBuffer * mixerSetupAddBitmap;
|
extern BitmapBuffer * mixerSetupAddBitmap;
|
||||||
extern BitmapBuffer * mixerSetupMultiBitmap;
|
extern BitmapBuffer * mixerSetupMultiBitmap;
|
||||||
extern BitmapBuffer * mixerSetupReplaceBitmap;
|
extern BitmapBuffer * mixerSetupReplaceBitmap;
|
||||||
extern BitmapBuffer * mixerSetupLabelBitmap;
|
extern BitmapBuffer * mixerSetupLabelIcon;
|
||||||
extern BitmapBuffer * mixerSetupFlightmodeIcon;
|
extern BitmapBuffer * mixerSetupFlightmodeIcon;
|
||||||
extern BitmapBuffer * mixerSetupCurveBitmap;
|
extern BitmapBuffer * mixerSetupCurveIcon;
|
||||||
extern BitmapBuffer * mixerSetupSwitchIcon;
|
extern BitmapBuffer * mixerSetupSwitchIcon;
|
||||||
extern BitmapBuffer * mixerSetupDelayBitmap;
|
//extern BitmapBuffer * mixerSetupDelayIcon;
|
||||||
extern BitmapBuffer * mixerSetupSlowBitmap;
|
//extern BitmapBuffer * mixerSetupSlowIcon;
|
||||||
extern BitmapBuffer * mixerSetupDelaySlowBitmap;
|
//extern BitmapBuffer * mixerSetupDelaySlowIcon;
|
||||||
extern BitmapBuffer * mixerSetupFlightmodeBitmap;
|
|
||||||
extern BitmapBuffer * mixerSetupSwitchBitmap;
|
|
||||||
|
|
||||||
#endif // _BITMAPS_H_
|
#endif // _BITMAPS_H_
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ CurveEdit::CurveEdit(Window * parent, const rect_t & rect, uint8_t index) :
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CurveEdit::~CurveEdit()
|
||||||
|
{
|
||||||
|
preview.detach();
|
||||||
|
}
|
||||||
|
|
||||||
void CurveEdit::update()
|
void CurveEdit::update()
|
||||||
{
|
{
|
||||||
preview.clearPoints();
|
preview.clearPoints();
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ class CurveEdit: public FormField {
|
|||||||
public:
|
public:
|
||||||
CurveEdit(Window * parent, const rect_t & rect, uint8_t index);
|
CurveEdit(Window * parent, const rect_t & rect, uint8_t index);
|
||||||
|
|
||||||
|
~CurveEdit() override;
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
void onEvent(event_t event) override;
|
void onEvent(event_t event) override;
|
||||||
|
|||||||
@@ -256,12 +256,12 @@ void drawCurveRef(BitmapBuffer * dc, coord_t x, coord_t y, const CurveRef & curv
|
|||||||
switch (curve.type) {
|
switch (curve.type) {
|
||||||
case CURVE_REF_DIFF:
|
case CURVE_REF_DIFF:
|
||||||
x = dc->drawText(x, y, "D", flags);
|
x = dc->drawText(x, y, "D", flags);
|
||||||
drawValueOrGVar(dc, x + 1, y + 2, curve.value, -100, 100, LEFT | SMLSIZE | flags);
|
drawValueOrGVar(dc, x, y + 2, curve.value, -100, 100, LEFT | SMLSIZE | flags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURVE_REF_EXPO:
|
case CURVE_REF_EXPO:
|
||||||
x = dc->drawText(x, y, "E", flags);
|
x = dc->drawText(x, y, "E", flags);
|
||||||
drawValueOrGVar(dc, x + 1, y + 2, curve.value, -100, 100, LEFT | SMLSIZE | flags);
|
drawValueOrGVar(dc, x, y + 2, curve.value, -100, 100, LEFT | SMLSIZE | flags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURVE_REF_FUNC:
|
case CURVE_REF_FUNC:
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ class InputEditWindow: public Page {
|
|||||||
buildHeader(&header);
|
buildHeader(&header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~InputEditWindow() override
|
||||||
|
{
|
||||||
|
preview.detach();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint8_t input;
|
uint8_t input;
|
||||||
uint8_t index;
|
uint8_t index;
|
||||||
@@ -292,17 +297,17 @@ void CommonInputOrMixButton::checkEvents()
|
|||||||
|
|
||||||
void CommonInputOrMixButton::drawFlightModes(BitmapBuffer *dc, FlightModesType value)
|
void CommonInputOrMixButton::drawFlightModes(BitmapBuffer *dc, FlightModesType value)
|
||||||
{
|
{
|
||||||
dc->drawBitmap(146, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupFlightmodeBitmap);
|
dc->drawMask(146, 2 + PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupFlightmodeIcon, DEFAULT_COLOR);
|
||||||
coord_t x = 166;
|
coord_t x = 166;
|
||||||
for (int i = 0; i < MAX_FLIGHT_MODES; i++) {
|
for (int i = 0; i < MAX_FLIGHT_MODES; i++) {
|
||||||
char s[] = " ";
|
char s[] = " ";
|
||||||
s[0] = '0' + i;
|
s[0] = '0' + i;
|
||||||
if (value & (1 << i)) {
|
if (value & (1 << i)) {
|
||||||
dc->drawText(x, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, s, SMLSIZE | TEXT_DISABLE_COLOR);
|
dc->drawText(x, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP + 2, s, SMLSIZE | TEXT_DISABLE_COLOR);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dc->drawSolidFilledRect(x, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, 8, 3, CHECKBOX_COLOR);
|
dc->drawSolidFilledRect(x, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP + 2, 8, 3, CHECKBOX_COLOR);
|
||||||
dc->drawText(x, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, s, SMLSIZE);
|
dc->drawText(x, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP + 2, s, SMLSIZE);
|
||||||
}
|
}
|
||||||
x += 8;
|
x += 8;
|
||||||
}
|
}
|
||||||
@@ -341,7 +346,7 @@ class InputLineButton : public CommonInputOrMixButton {
|
|||||||
drawSource(dc, 60, FIELD_PADDING_TOP, line.srcRaw);
|
drawSource(dc, 60, FIELD_PADDING_TOP, line.srcRaw);
|
||||||
|
|
||||||
if (line.name[0]) {
|
if (line.name[0]) {
|
||||||
dc->drawBitmap(146, 2 + FIELD_PADDING_TOP, mixerSetupLabelBitmap);
|
dc->drawMask(146, 2 + FIELD_PADDING_TOP, mixerSetupLabelIcon, DEFAULT_COLOR);
|
||||||
dc->drawSizedText(166, FIELD_PADDING_TOP, line.name, sizeof(line.name));
|
dc->drawSizedText(166, FIELD_PADDING_TOP, line.name, sizeof(line.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,7 +357,7 @@ class InputLineButton : public CommonInputOrMixButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (line.curve.value != 0 ) {
|
if (line.curve.value != 0 ) {
|
||||||
dc->drawBitmap(60, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupCurveBitmap);
|
dc->drawMask(60, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupCurveIcon, DEFAULT_COLOR);
|
||||||
drawCurveRef(dc, 80, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, line.curve);
|
drawCurveRef(dc, 80, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, line.curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -496,7 +501,6 @@ void ModelInputsPage::build(FormWindow * window, int8_t focusIndex)
|
|||||||
|
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
// window->setLastField();
|
|
||||||
window->setInnerHeight(grid.getWindowHeight());
|
window->setInnerHeight(grid.getWindowHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ class LogicalSwitchEditPage: public Page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildHeader(Window * window) {
|
void buildHeader(Window * window)
|
||||||
|
{
|
||||||
new StaticText(window, { PAGE_TITLE_LEFT, PAGE_TITLE_TOP, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT }, STR_MENULOGICALSWITCHES, 0, MENU_COLOR);
|
new StaticText(window, { PAGE_TITLE_LEFT, PAGE_TITLE_TOP, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT }, STR_MENULOGICALSWITCHES, 0, MENU_COLOR);
|
||||||
headerSwitchName = new StaticText(window, { PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT }, getSwitchPositionName(SWSRC_SW1 + index), 0, MENU_COLOR);
|
headerSwitchName = new StaticText(window, { PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT }, getSwitchPositionName(SWSRC_SW1 + index), 0, MENU_COLOR);
|
||||||
}
|
}
|
||||||
@@ -397,6 +398,5 @@ void ModelLogicalSwitchesPage::build(FormWindow * window, int8_t focusIndex)
|
|||||||
|
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
// window->setLastField();
|
|
||||||
window->setInnerHeight(grid.getWindowHeight());
|
window->setInnerHeight(grid.getWindowHeight());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ bool reachMixesLimit()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class MixEditWindow : public Page {
|
class MixEditWindow : public Page {
|
||||||
public:
|
public:
|
||||||
MixEditWindow(int8_t channel, uint8_t mixIndex) :
|
MixEditWindow(int8_t channel, uint8_t mixIndex) :
|
||||||
@@ -192,8 +191,6 @@ class MixEditWindow : public Page {
|
|||||||
edit->setSuffix("s");
|
edit->setSuffix("s");
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
grid.nextLine();
|
|
||||||
|
|
||||||
window->setInnerHeight(grid.getWindowHeight());
|
window->setInnerHeight(grid.getWindowHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,12 +228,12 @@ class MixEditWindow : public Page {
|
|||||||
|
|
||||||
class MixLineButton : public CommonInputOrMixButton {
|
class MixLineButton : public CommonInputOrMixButton {
|
||||||
public:
|
public:
|
||||||
MixLineButton(FormGroup * parent, const rect_t &rect, uint8_t index) :
|
MixLineButton(FormGroup * parent, const rect_t & rect, uint8_t index) :
|
||||||
CommonInputOrMixButton(parent, rect, index)
|
CommonInputOrMixButton(parent, rect, index)
|
||||||
{
|
{
|
||||||
const MixData & mix = g_model.mixData[index];
|
const MixData & mix = g_model.mixData[index];
|
||||||
if (mix.swtch || mix.curve.value != 0 || mix.flightModes) {
|
if (mix.swtch || mix.curve.value != 0 || mix.flightModes) {
|
||||||
setHeight(getHeight() + 20);
|
setHeight(getHeight() + PAGE_LINE_HEIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,18 +251,18 @@ class MixLineButton : public CommonInputOrMixButton {
|
|||||||
drawSource(dc, 60, FIELD_PADDING_TOP, line.srcRaw);
|
drawSource(dc, 60, FIELD_PADDING_TOP, line.srcRaw);
|
||||||
|
|
||||||
if (line.name[0]) {
|
if (line.name[0]) {
|
||||||
dc->drawBitmap(146, 2 + FIELD_PADDING_TOP, mixerSetupLabelBitmap);
|
dc->drawMask(146, 2 + FIELD_PADDING_TOP, mixerSetupLabelIcon, DEFAULT_COLOR);
|
||||||
dc->drawSizedText(166, FIELD_PADDING_TOP, line.name, sizeof(line.name));
|
dc->drawSizedText(166, FIELD_PADDING_TOP, line.name, sizeof(line.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
// second line ...
|
// second line ...
|
||||||
if (line.swtch) {
|
if (line.swtch) {
|
||||||
dc->drawBitmap(3, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupSwitchBitmap);
|
dc->drawMask(3, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP + 2, mixerSetupSwitchIcon, DEFAULT_COLOR);
|
||||||
drawSwitch(dc, 21, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, line.swtch);
|
drawSwitch(dc, 21, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, line.swtch);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.curve.value) {
|
if (line.curve.value) {
|
||||||
dc->drawBitmap(60, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupCurveBitmap);
|
dc->drawMask(60, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupCurveIcon, DEFAULT_COLOR);
|
||||||
drawCurveRef(dc, 80, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, line.curve, 0);
|
drawCurveRef(dc, 80, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, line.curve, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,11 +132,11 @@ class OutputLineButton : public Button {
|
|||||||
dc->drawTextAtIndex(4, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, STR_MMMINV, output->revert);
|
dc->drawTextAtIndex(4, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, STR_MMMINV, output->revert);
|
||||||
}
|
}
|
||||||
if (output->curve) {
|
if (output->curve) {
|
||||||
dc->drawBitmap(68, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupCurveBitmap);
|
dc->drawMask(68, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupCurveIcon, DEFAULT_COLOR);
|
||||||
dc->drawText(88, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, getCurveString(output->curve));
|
dc->drawText(88, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, getCurveString(output->curve));
|
||||||
}
|
}
|
||||||
if (output->name[0]) {
|
if (output->name[0]) {
|
||||||
dc->drawBitmap(146, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupLabelBitmap);
|
dc->drawMask(146, 2 + PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, mixerSetupLabelIcon, DEFAULT_COLOR);
|
||||||
dc->drawSizedText(166, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, output->name, sizeof(output->name));
|
dc->drawSizedText(166, PAGE_LINE_HEIGHT + FIELD_PADDING_TOP, output->name, sizeof(output->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -429,11 +429,6 @@ class ModuleWindow : public FormGroup {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
~ModuleWindow() override
|
|
||||||
{
|
|
||||||
deleteChildren();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint8_t moduleIdx;
|
uint8_t moduleIdx;
|
||||||
Choice * moduleChoice = nullptr;
|
Choice * moduleChoice = nullptr;
|
||||||
|
|||||||
@@ -114,11 +114,6 @@ class SensorEditWindow : public Page {
|
|||||||
buildHeader(&header);
|
buildHeader(&header);
|
||||||
}
|
}
|
||||||
|
|
||||||
~SensorEditWindow() override
|
|
||||||
{
|
|
||||||
body.deleteChildren();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint8_t index;
|
uint8_t index;
|
||||||
FormWindow * sensorParametersWindow = nullptr;
|
FormWindow * sensorParametersWindow = nullptr;
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ Page::Page(unsigned icon):
|
|||||||
|
|
||||||
Page::~Page()
|
Page::~Page()
|
||||||
{
|
{
|
||||||
|
header.detach();
|
||||||
|
body.detach();
|
||||||
|
|
||||||
#if defined(HARDWARE_TOUCH)
|
#if defined(HARDWARE_TOUCH)
|
||||||
Keyboard::hide();
|
Keyboard::hide();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -86,16 +86,15 @@ class PotCalibrationWindow: public Window {
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void paint(BitmapBuffer * dc)
|
void paint(BitmapBuffer * dc) override
|
||||||
{
|
{
|
||||||
if(rect.h > rect.w)
|
if (rect.h > rect.w)
|
||||||
drawVerticalSlider(dc, 5, 8, rect.h - 18, calibratedAnalogs[potIndex], -RESX, RESX, 40, OPTION_SLIDER_TICKS | OPTION_SLIDER_BIG_TICKS | OPTION_SLIDER_SQUARE_BUTTON);
|
drawVerticalSlider(dc, 5, 8, rect.h - 18, calibratedAnalogs[potIndex], -RESX, RESX, 40, OPTION_SLIDER_TICKS | OPTION_SLIDER_BIG_TICKS | OPTION_SLIDER_SQUARE_BUTTON);
|
||||||
else
|
else
|
||||||
drawHorizontalSlider(dc, 5, 8, rect.w - 18, calibratedAnalogs[potIndex], -RESX, RESX, 40, OPTION_SLIDER_TICKS | OPTION_SLIDER_BIG_TICKS | OPTION_SLIDER_SQUARE_BUTTON);
|
drawHorizontalSlider(dc, 5, 8, rect.w - 18, calibratedAnalogs[potIndex], -RESX, RESX, 40, OPTION_SLIDER_TICKS | OPTION_SLIDER_BIG_TICKS | OPTION_SLIDER_SQUARE_BUTTON);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static constexpr coord_t bitmapSize = 68;
|
|
||||||
uint8_t potIndex;
|
uint8_t potIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -109,23 +108,26 @@ RadioCalibrationPage::RadioCalibrationPage(bool initial):
|
|||||||
|
|
||||||
void RadioCalibrationPage::buildHeader(Window * window)
|
void RadioCalibrationPage::buildHeader(Window * window)
|
||||||
{
|
{
|
||||||
new StaticText(window, { 55, 0, 300, 20 }, STR_MENUCALIBRATION, MENU_COLOR);
|
new StaticText(window, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, STR_MENUCALIBRATION, 0, MENU_COLOR);
|
||||||
text = new StaticText(window, { 55, FH+2, LCD_W-55, 20 }, STR_MENUTOSTART, MENU_COLOR);
|
text = new StaticText(window, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, STR_MENUTOSTART, 0, MENU_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadioCalibrationPage::buildBody(FormWindow * window)
|
void RadioCalibrationPage::buildBody(FormWindow * window)
|
||||||
{
|
{
|
||||||
menuCalibrationState = CALIB_START;
|
menuCalibrationState = CALIB_START;
|
||||||
|
|
||||||
// Background radio image
|
if (calibRadioPict) {
|
||||||
|
// Background radio image
|
||||||
#if LCD_W > LCD_H
|
#if LCD_W > LCD_H
|
||||||
new StaticBitmap(window, {LCD_W/2 -calibRadioPict->getWidth()/2, 5, calibRadioPict->getHeight(), calibRadioPict->getWidth()}, calibRadioPict);
|
new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->getWidth() / 2, 5, calibRadioPict->getHeight(), calibRadioPict->getWidth()}, calibRadioPict);
|
||||||
#else
|
#else
|
||||||
new StaticBitmap(window, {LCD_W/2 -calibRadioPict->getWidth()/2, LCD_H/2 -calibRadioPict->getHeight()/2, calibRadioPict->getHeight(), calibRadioPict->getWidth()}, calibRadioPict);
|
new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->getWidth() / 2, LCD_H / 2 - calibRadioPict->getHeight() / 2, calibRadioPict->getHeight(), calibRadioPict->getWidth()}, calibRadioPict);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// The two sticks
|
// The two sticks
|
||||||
new StickCalibrationWindow(window, {40, 20, 90, 90}, STICK1, STICK2);
|
new StickCalibrationWindow(window, {40, 20, 90, 90}, STICK1, STICK2);
|
||||||
new StickCalibrationWindow(window, {LCD_W-130, 20, 90, 90}, STICK4, STICK3);
|
new StickCalibrationWindow(window, {LCD_W - 130, 20, 90, 90}, STICK4, STICK3);
|
||||||
|
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBHORUS)
|
||||||
// The 2 main sliders
|
// The 2 main sliders
|
||||||
@@ -139,7 +141,7 @@ void RadioCalibrationPage::buildBody(FormWindow * window)
|
|||||||
#elif defined(PCBNV14)
|
#elif defined(PCBNV14)
|
||||||
new PotCalibrationWindow(window, {0, window->height()-25, 150, 20}, POT1);
|
new PotCalibrationWindow(window, {0, window->height()-25, 150, 20}, POT1);
|
||||||
new PotCalibrationWindow(window, {LCD_W-150, window->height()-25, 150, 20}, POT2);
|
new PotCalibrationWindow(window, {LCD_W-150, window->height()-25, 150, 20}, POT2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadioCalibrationPage::checkEvents()
|
void RadioCalibrationPage::checkEvents()
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class StaticText;
|
|||||||
|
|
||||||
class RadioCalibrationPage: public Page {
|
class RadioCalibrationPage: public Page {
|
||||||
public:
|
public:
|
||||||
RadioCalibrationPage(bool initial=false);
|
explicit RadioCalibrationPage(bool initial = false);
|
||||||
|
|
||||||
void checkEvents() override;
|
void checkEvents() override;
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ class RadioHardwarePage: public PageTab {
|
|||||||
RadioHardwarePage();
|
RadioHardwarePage();
|
||||||
|
|
||||||
void build(FormWindow * window) override;
|
void build(FormWindow * window) override;
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_RADIO_HARDWARE_H_
|
#endif //_RADIO_HARDWARE_H_
|
||||||
|
|||||||
@@ -33,11 +33,6 @@ class DateTimeWindow : public FormGroup {
|
|||||||
build();
|
build();
|
||||||
}
|
}
|
||||||
|
|
||||||
~DateTimeWindow() override
|
|
||||||
{
|
|
||||||
deleteChildren();
|
|
||||||
}
|
|
||||||
|
|
||||||
void checkEvents() override
|
void checkEvents() override
|
||||||
{
|
{
|
||||||
FormGroup::checkEvents();
|
FormGroup::checkEvents();
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ TabsGroup::~TabsGroup()
|
|||||||
delete tab;
|
delete tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.deleteChildren();
|
header.detach();
|
||||||
|
body.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabsGroup::addTab(PageTab * page)
|
void TabsGroup::addTab(PageTab * page)
|
||||||
|
|||||||
@@ -262,19 +262,19 @@ class FlyskyTheme: public ThemeBase
|
|||||||
mixerSetupOutputBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_output.png", MENU_COLOR, HEADER_BGCOLOR);
|
mixerSetupOutputBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_output.png", MENU_COLOR, HEADER_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupAddBitmap;
|
delete mixerSetupAddBitmap;
|
||||||
mixerSetupAddBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_add.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupAddBitmap = BitmapBuffer::loadMaskOnBackground(getFilePath("mask_mplex_add.png"), DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupMultiBitmap;
|
delete mixerSetupMultiBitmap;
|
||||||
mixerSetupMultiBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_multi.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupMultiBitmap = BitmapBuffer::loadMaskOnBackground(getFilePath("mask_mplex_multi.png"), DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupReplaceBitmap;
|
delete mixerSetupReplaceBitmap;
|
||||||
mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_replace.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground(getFilePath("mask_mplex_replace.png"), DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupLabelBitmap;
|
delete mixerSetupLabelIcon;
|
||||||
mixerSetupLabelBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_label.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupLabelIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_label.png"));
|
||||||
|
|
||||||
delete mixerSetupCurveBitmap;
|
delete mixerSetupCurveIcon;
|
||||||
mixerSetupCurveBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_curve.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupCurveIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_curve.png"));
|
||||||
|
|
||||||
delete mixerSetupSwitchIcon;
|
delete mixerSetupSwitchIcon;
|
||||||
mixerSetupSwitchIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_switch.png"));
|
mixerSetupSwitchIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_switch.png"));
|
||||||
@@ -282,14 +282,14 @@ class FlyskyTheme: public ThemeBase
|
|||||||
delete mixerSetupFlightmodeIcon;
|
delete mixerSetupFlightmodeIcon;
|
||||||
mixerSetupFlightmodeIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_fm.png"));
|
mixerSetupFlightmodeIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_fm.png"));
|
||||||
|
|
||||||
delete mixerSetupSlowBitmap;
|
// delete mixerSetupSlowIcon;
|
||||||
mixerSetupSlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_slow.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
// mixerSetupSlowIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_slow.png"));
|
||||||
|
//
|
||||||
delete mixerSetupDelayBitmap;
|
// delete mixerSetupDelayIcon;
|
||||||
mixerSetupDelayBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delay.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
// mixerSetupDelayIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_delay.png"));
|
||||||
|
//
|
||||||
delete mixerSetupDelaySlowBitmap;
|
// delete mixerSetupDelaySlowIcon;
|
||||||
mixerSetupDelaySlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delayslow.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
// mixerSetupDelaySlowIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_delayslow.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void load() const override
|
void load() const override
|
||||||
|
|||||||
@@ -242,19 +242,19 @@ class FrskyTheme: public ThemeBase
|
|||||||
mixerSetupOutputBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_output.png", MENU_COLOR, MENU_BGCOLOR);
|
mixerSetupOutputBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_output.png", MENU_COLOR, MENU_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupAddBitmap;
|
delete mixerSetupAddBitmap;
|
||||||
mixerSetupAddBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_add.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupAddBitmap = BitmapBuffer::loadMaskOnBackground(getFilePath("mask_mplex_add.png"), DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupMultiBitmap;
|
delete mixerSetupMultiBitmap;
|
||||||
mixerSetupMultiBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_multi.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupMultiBitmap = BitmapBuffer::loadMaskOnBackground(getFilePath("mask_mplex_multi.png"), DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupReplaceBitmap;
|
delete mixerSetupReplaceBitmap;
|
||||||
mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_replace.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground(getFilePath("mask_mplex_replace.png"), DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
||||||
|
|
||||||
delete mixerSetupLabelBitmap;
|
delete mixerSetupLabelIcon;
|
||||||
mixerSetupLabelBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_label.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupLabelIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_label.png"));
|
||||||
|
|
||||||
delete mixerSetupCurveBitmap;
|
delete mixerSetupCurveIcon;
|
||||||
mixerSetupCurveBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_curve.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
mixerSetupCurveIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_curve.png"));
|
||||||
|
|
||||||
delete mixerSetupSwitchIcon;
|
delete mixerSetupSwitchIcon;
|
||||||
mixerSetupSwitchIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_switch.png"));
|
mixerSetupSwitchIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_switch.png"));
|
||||||
@@ -262,14 +262,14 @@ class FrskyTheme: public ThemeBase
|
|||||||
delete mixerSetupFlightmodeIcon;
|
delete mixerSetupFlightmodeIcon;
|
||||||
mixerSetupFlightmodeIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_fm.png"));
|
mixerSetupFlightmodeIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_fm.png"));
|
||||||
|
|
||||||
delete mixerSetupSlowBitmap;
|
// delete mixerSetupSlowIcon;
|
||||||
mixerSetupSlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_slow.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
// mixerSetupSlowIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_slow.png"));
|
||||||
|
//
|
||||||
delete mixerSetupDelayBitmap;
|
// delete mixerSetupDelayIcon;
|
||||||
mixerSetupDelayBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delay.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
// mixerSetupDelayIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_delay.png"));
|
||||||
|
//
|
||||||
delete mixerSetupDelaySlowBitmap;
|
// delete mixerSetupDelaySlowIcon;
|
||||||
mixerSetupDelaySlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delayslow.png", DEFAULT_COLOR, DEFAULT_BGCOLOR);
|
// mixerSetupDelaySlowIcon = BitmapBuffer::loadMask(getFilePath("mask_textline_delayslow.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void load() const override
|
void load() const override
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ ViewMain::ViewMain(bool icons):
|
|||||||
|
|
||||||
ViewMain::~ViewMain()
|
ViewMain::~ViewMain()
|
||||||
{
|
{
|
||||||
deleteChildren();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HARDWARE_KEYS)
|
#if defined(HARDWARE_KEYS)
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 5b4ee51fe3...6b1e38e2f9
Reference in New Issue
Block a user