It's using 3 different buttons to emulate tabs, and uses a ScrollArea for all entries (which may be another idea for the GCA UI).
https://sourceforge.net/p/flightgear/fg ... Center.nas
For the ScrollArea, there is existing example code to be found here: http://wiki.flightgear.org/Canvas_Snipp ... ScrollArea
The callsign-based position-tree lookup should be easy to implement by traversing all ai/mp children and searching for a matching callsign - for example using something like this
- Code: Select all
var validateCallsign = func(callsign) {
var RESULT = {NOT_FOUND:0, FOUND:1};
var list = props.globals.getNode("/ai/models").getChildren("aircraft");
foreach(var l; list) {
if (l.getNode('callsign').getValue() == callsign) return [RESULT.FOUND, l.getNode('position')];
}
return [RESULT.NOT_FOUND, nil];
} # validateCallsign;
var getPositionNodeByCallsign = func(callsign) {
var (result, positionNode) = validateCallsign(callsign);
debug.dump(positionNode);
} # getPositionNodeByCallsign
getPositionNodeByCallsign('some-callsign');