feat: Add support for latest FrSky receivers (#4077)
Co-authored-by: Bertrand Songis <bsongis@gmail.com> Co-authored-by: raphaelcoeffic <raphael.coeffic@frafos.com>
This commit is contained in:
co-authored by
Bertrand Songis
raphaelcoeffic
parent
d684930cc9
commit
5fd22612aa
@@ -212,6 +212,9 @@ void Choice::fillMenu(Menu *menu, const FilterFct& filter)
|
||||
if (i == 0) { selectedIx0 = count; }
|
||||
++count;
|
||||
}
|
||||
if (fillMenuHandler) {
|
||||
fillMenuHandler(menu, value, selectedIx);
|
||||
}
|
||||
menu->updateLines();
|
||||
// Force update - in case selected row is first row
|
||||
menu->select(-1);
|
||||
|
||||
+6
@@ -90,6 +90,11 @@ class Choice: public ChoiceBase {
|
||||
|
||||
void onClicked() override;
|
||||
|
||||
void setFillMenuHandler(std::function<void(Menu*, int, int&)> handler)
|
||||
{
|
||||
fillMenuHandler = std::move(handler);
|
||||
}
|
||||
|
||||
void setBeforeDisplayMenuHandler(std::function<void(Menu*)> handler)
|
||||
{
|
||||
beforeDisplayMenuHandler = std::move(handler);
|
||||
@@ -187,6 +192,7 @@ class Choice: public ChoiceBase {
|
||||
std::function<void(int)> _setValue;
|
||||
std::function<bool(int)> isValueAvailable;
|
||||
std::function<std::string(int)> textHandler;
|
||||
std::function<void(Menu *, int, int&)> fillMenuHandler;
|
||||
std::function <void(Menu *)> beforeDisplayMenuHandler;
|
||||
|
||||
typedef std::function<bool(int16_t)> FilterFct;
|
||||
|
||||
Reference in New Issue
Block a user