Add TXGainField user interface element.

This commit is contained in:
Jared Boone 2016-08-03 16:14:34 -07:00
parent ef9b4051b7
commit 447a7a5661
2 changed files with 34 additions and 0 deletions

View File

@ -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 */

View File

@ -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__*/