mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-15 21:22:38 -04:00
Add TXGainField user interface element.
This commit is contained in:
parent
ef9b4051b7
commit
447a7a5661
2 changed files with 34 additions and 0 deletions
|
@ -353,4 +353,29 @@ void VGAGainField::on_focus() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TXGainField **********************************************************/
|
||||||
|
|
||||||
|
TXGainField::TXGainField(
|
||||||
|
Point parent_pos
|
||||||
|
) : NumberField {
|
||||||
|
parent_pos, 2,
|
||||||
|
{ max2837::tx::gain_db_range.minimum, max2837::tx::gain_db_range.maximum },
|
||||||
|
max2837::tx::gain_db_step,
|
||||||
|
' ',
|
||||||
|
}
|
||||||
|
{
|
||||||
|
set_value(receiver_model.tx_gain());
|
||||||
|
|
||||||
|
on_change = [](int32_t v) {
|
||||||
|
receiver_model.set_tx_gain(v);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
void TXGainField::on_focus() {
|
||||||
|
//Widget::on_focus();
|
||||||
|
if( on_show_options ) {
|
||||||
|
on_show_options();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
|
|
@ -330,6 +330,15 @@ public:
|
||||||
void on_focus() override;
|
void on_focus() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TXGainField : public NumberField {
|
||||||
|
public:
|
||||||
|
std::function<void(void)> on_show_options;
|
||||||
|
|
||||||
|
TXGainField(Point parent_pos);
|
||||||
|
|
||||||
|
void on_focus() override;
|
||||||
|
};
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
|
||||||
#endif/*__UI_RECEIVER_H__*/
|
#endif/*__UI_RECEIVER_H__*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue