From 753ac09c0da8f473390e4430540013d6c8ee7946 Mon Sep 17 00:00:00 2001 From: mfranz Date: Fri, 31 Mar 2006 10:26:08 +0000 Subject: [PATCH] support filtering. The [Search] button is only there for people who don't know that the key validates the input, too. --- gui/dialogs/airports.xml | 100 ++++++++++++++++++++++++++++++++------- 1 file changed, 83 insertions(+), 17 deletions(-) diff --git a/gui/dialogs/airports.xml b/gui/dialogs/airports.xml index 1c3eb78bd..59a5dd1ec 100644 --- a/gui/dialogs/airports.xml +++ b/gui/dialogs/airports.xml @@ -10,12 +10,86 @@ + + + var id = ""; + var node = props.globals.getNode("/sim/gui/dialogs/airports", 1); + if (node.getNode("list") == nil) { + node.getNode("list", 1).setValue(""); + } + node = node.getNode("list"); + + listbox = func { + id = pop(split(" ", node.getValue())); + id = substr(id, 1, size(id) - 2); # strip parentheses + } + + apply = func { + setprop("/sim/presets/airport-id", id); + setprop("/sim/presets/longitude-deg", -9999); + setprop("/sim/presets/latitude-deg", -9999); + setprop("/sim/presets/altitude-ft", -9999); + setprop("/sim/presets/airspeed-kt", 0); + setprop("/sim/presets/offset-distance", 0); + setprop("/sim/presets/offset-azimuth", 0); + setprop("/sim/presets/glideslope-deg", 0); + setprop("/sim/presets/heading-deg", 0); + setprop("/sim/presets/runway", ""); + } + + + + airport-list 440 360 - /sim/presets/airport-id + /sim/gui/dialogs/airports/list + + dialog-apply + airport-list + + + nasal + + + + hbox + 4 + + + + 60 + + + + input + 280 + /sim/gui/dialogs/airports/list + + dialog-apply + input + + + dialog-update + airport-list + + + + + + hbox 10 @@ -26,28 +100,16 @@ true true - nasal - + dialog-apply + airport-list - dialog-apply + nasal + presets-commit - - dialog-close - true @@ -56,6 +118,10 @@ Close true Esc + + dialog-apply + input + dialog-close