1
0
Fork 0
fgdata/Aircraft/Instruments-3d/FG1000/Nasal/NearestUserWPT/NearestUserWPTController.nas
Stuart Buchanan cbb281759c NAV/COM Radio support
Add NAV/COM 8.33MHz radio support and integration
with the property trees for radios.

Also general cleanup.
2018-01-13 18:53:06 +00:00

59 lines
1.5 KiB
Text

# NearestUserWPT Controller
var NearestUserWPTController =
{
new : func (page, svg)
{
var obj = {
parents : [ NearestUserWPTController, MFDPageController.new(page) ],
_crsrToggle : 0,
_recipient : nil,
_page : page,
};
return obj;
},
# Input Handling
handleCRSR : func() {
me._crsrToggle = (! me._crsrToggle);
if (me._crsrToggle) {
} else {
me._page.hideCRSR();
}
return emesary.Transmitter.ReceiptStatus_Finished;
},
handleFMSInner : func(value) {
if (me._crsrToggle == 1) {
# Scroll through whatever is the current list
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
# Pass to the page group controller to display and scroll through the page group menu
return me._page.mfd.SurroundController.handleFMSInner(value);
}
},
handleFMSOuter : func(value) {
if (me._crsrToggle == 1) {
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
# Pass to the page group controller to display and scroll through the page group menu
return me._page.mfd.SurroundController.handleFMSOuter(value);
}
},
handleEnter : func(value) {
if (me._crsrToggle == 1) {
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
return emesary.Transmitter.ReceiptStatus_NotProcessed;
}
},
# Reset controller if required when the page is displayed or hidden
ondisplay : func() {
me.RegisterWithEmesary();
},
offdisplay : func() {
me.DeRegisterWithEmesary();
},
};