mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-28 16:59:47 -05:00
Add TXGainField user interface element.
This commit is contained in:
parent
ef9b4051b7
commit
447a7a5661
@ -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 */
|
||||
|
@ -330,6 +330,15 @@ public:
|
||||
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 */
|
||||
|
||||
#endif/*__UI_RECEIVER_H__*/
|
||||
|
Loading…
Reference in New Issue
Block a user