-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect.xml
84 lines (72 loc) · 2.17 KB
/
select.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0"?>
<PropertyList>
<name>select</name>
<layout>vbox</layout>
<resizable>true</resizable>
<default-padding>3</default-padding>
<group>
<layout>hbox</layout>
<default-padding>1</default-padding>
<empty>
<stretch>true</stretch>
</empty>
<text>
<label>Select</label>
</text>
<empty>
<stretch>true</stretch>
</empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<border>2</border>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<list>
<name>select-list</name>
<pref-width>200</pref-width>
<pref-height>250</pref-height>
<halign>fill</halign>
<valign>fill</valign>
<stretch>true</stretch>
<property>/sim/gui/dialogs/select/selected</property>
<properties>/sim/gui/dialogs/select/list</properties>
<binding>
<command>dialog-apply</command>
<object-name>select-list</object-name>
</binding>
<binding>
<command>nasal</command>
<script>select()</script>
</binding>
</list>
<nasal>
<open>
<![CDATA[
var self = props.globals.getNode("/sim/gui/dialogs/select", 1);
var propaty = props.globals.getNode("/autopilot/route-manager/", 1);
var terget = self.getValue("terget");
var selected = self.getNode("selected", 1);
var select = func {
var path = self.getValue("property");
propaty.setValue(path, selected.getValue());
#gui.dialog_apply("route-manager", terget);
}
#var L = setlistener(self.getNode("terget").getPath(), func {
# gui.dialog_update('select-list');
# gui.display_apply('select-list');
#}, 1, 0);
]]>
</open>
<close>
self.getNode("list").removeAllChildren();
#removelistener(L);
</close>
</nasal>
</PropertyList>