Extract VGAGainField.

This commit is contained in:
Jared Boone 2016-04-12 10:48:24 -07:00
parent e85503cd81
commit 3e8b097588
3 changed files with 31 additions and 6 deletions

View File

@ -117,12 +117,8 @@ private:
{ 15 * 8, 0 * 16 }
};
NumberField field_vga {
{ 18 * 8, 0 * 16},
2,
{ max2837::vga::gain_db_range.minimum, max2837::vga::gain_db_range.maximum },
max2837::vga::gain_db_step,
' ',
VGAGainField field_vga {
{ 18 * 8, 0 * 16 }
};
OptionsField options_modulation {

View File

@ -318,4 +318,24 @@ void LNAGainField::on_focus() {
}
}
/* VGAGainField **********************************************************/
VGAGainField::VGAGainField(
Point parent_pos
) : NumberField {
parent_pos, 2,
{ max2837::vga::gain_db_range.minimum, max2837::vga::gain_db_range.maximum },
max2837::vga::gain_db_step,
' ',
}
{
}
void VGAGainField::on_focus() {
//Widget::on_focus();
if( on_show_options ) {
on_show_options();
}
}
} /* namespace ui */

View File

@ -315,6 +315,15 @@ public:
void on_focus() override;
};
class VGAGainField : public NumberField {
public:
std::function<void(void)> on_show_options;
VGAGainField(Point parent_pos);
void on_focus() override;
};
} /* namespace ui */
#endif/*__UI_RECEIVER_H__*/