location-in-air vbox left var p = props.globals.getNode("/sim/gui/dialogs/location-in-air/", 1); var mode = { airport: p.getNode("airport", 1), lonlat: p.getNode("lonlat", 1), vor: p.getNode("vor", 1), ndb: p.getNode("ndb", 1), fix: p.getNode("fix", 1), }; var set_radio = func(m) { foreach (var k; keys(mode)) { mode[k].setBoolValue(m == k); } } var initialized = 0; foreach (var k; keys(mode)) { if (mode[k].getType() == "NONE") { mode[k].setBoolValue(0); } initialized += mode[k].getBoolValue(); } if (!initialized) { set_radio("airport"); } var pickNearest = func(type,propname,freqpropname) { var found = navinfo(type,getprop(propname)); if( found == nil or size(found) == 0 ) { print(type, " ", getprop(propname), " NOT found"); setprop(propname, ""); setprop(freqpropname, ""); return; } setprop(propname, found[0].id); setprop(freqpropname, found[0].frequency / 100.0); } # just kept for educational purposes :-) hbox 1 1 table center 00 true /sim/gui/dialogs/location-in-air/airport dialog-apply nasal 01 right 02 /sim/presets/airport-id nasal 03 right 04 /sim/presets/runway nasal 10 true /sim/gui/dialogs/location-in-air/lonlat dialog-apply nasal 11 right 12 /sim/presets/longitude-deg nasal 13 right 14 /sim/presets/latitude-deg nasal 20 true /sim/gui/dialogs/location-in-air/vor dialog-apply nasal 21 right 22 /sim/presets/vor-id nasal 30 true left /sim/gui/dialogs/location-in-air/ndb dialog-apply nasal 31 right 32 /sim/presets/ndb-id nasal 40 true /sim/gui/dialogs/location-in-air/fix left dialog-apply nasal 41 right 42 /sim/presets/fix nasal table 00 right /sim/gui/dialogs/location-in-air/lonlat 01 /sim/presets/offset-distance-nm /sim/gui/dialogs/location-in-air/lonlat 02 right /sim/gui/dialogs/location-in-air/lonlat 03 /sim/presets/offset-azimuth-deg /sim/gui/dialogs/location-in-air/lonlat 10 right 11 /sim/presets/altitude-ft 12 right 13 /sim/presets/glidescope-deg 20 right 21 /sim/presets/airspeed-kt 22 right /sim/gui/dialogs/location-in-air/airport 23 /sim/gui/dialogs/location-in-air/airport /sim/presets/heading-deg hbox 10