1
0
Fork 0

Updated pilot offset dialog from Henning

(Happy birthday!)
This commit is contained in:
James Turner 2020-06-08 19:41:33 +01:00
parent d6da41c617
commit 47a5ffe3d1

View file

@ -1,140 +1,320 @@
<?xml version="1.0"?>
<PropertyList>
<name>pilot_offset</name>
<layout>vbox</layout>
<name>pilot_offset</name>
<layout>vbox</layout>
<width>450</width>
<nasal>
<open>
<![CDATA[
var view_listener = setlistener("sim/current-view/view-number-raw", func(n) {
var x = getprop("sim/view["~int(n.getValue())~"]/config/x-offset-m");
var y = getprop("sim/view["~int(n.getValue())~"]/config/y-offset-m");
var z = getprop("sim/view["~int(n.getValue())~"]/config/z-offset-m");
setprop("sim/current-view/config/x-offset-m", x);
setprop("sim/current-view/config/y-offset-m", y);
setprop("sim/current-view/config/z-offset-m", z);
<group>
<layout>hbox</layout>
<empty><stretch>1</stretch></empty>
},1,0);
]]>
</open>
<close>
<![CDATA[
removelistener(view_listener);
props.getNode("sim/current-view/config/x-offset-m").remove();
props.getNode("sim/current-view/config/y-offset-m").remove();
props.getNode("sim/current-view/config/z-offset-m").remove();
]]>
</close>
</nasal>
<text>
<label>Adjust View Position</label>
</text>
<group>
<layout>hbox</layout>
<empty><stretch>1</stretch></empty>
<text>
<label>Adjust View Position</label>
</text>
<empty><stretch>1</stretch></empty>
<button>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<legend></legend>
<keynum>27</keynum>
<border>2</border>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<empty><stretch>1</stretch></empty>
<hrule/>
<button>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<legend></legend>
<keynum>27</keynum>
<border>2</border>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<group>
<layout>table</layout>
<text>
<row>0</row>
<col>0</col>
<label>left</label>
</text>
<button>
<row>0</row>
<col>1</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&lt;&lt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/x-offset-m</property>
<step>-0.1</step>
</binding>
</button>
<button>
<row>0</row>
<col>2</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&lt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/x-offset-m</property>
<step>-0.01</step>
</binding>
</button>
<input>
<row>0</row>
<col>3</col>
<name>offset-x</name>
<pref-width>65</pref-width>
<label>m</label>
<live>true</live>
<property>/sim/current-view/x-offset-m</property>
<binding>
<command>dialog-apply</command>
<object-name>offset-x</object-name>
</binding>
</input>
<hrule/>
<button>
<row>0</row>
<col>4</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&gt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/x-offset-m</property>
<step>0.01</step>
</binding>
</button>
<button>
<row>0</row>
<col>5</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&gt;&gt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/x-offset-m</property>
<step>0.1</step>
</binding>
</button>
<text>
<row>0</row>
<col>6</col>
<label>right</label>
</text>
<button>
<row>0</row>
<col>7</col>
<legend>Reset</legend>
<binding>
<command>property-assign</command>
<property>/sim/current-view/x-offset-m</property>
<property>/sim/current-view/config/x-offset-m</property>
</binding>
</button>
<group>
<layout>hbox</layout>
<text>
<row>1</row>
<col>0</col>
<label>down</label>
</text>
<button>
<row>1</row>
<col>1</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&lt;&lt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/y-offset-m</property>
<step>-0.1</step>
</binding>
</button>
<button>
<row>1</row>
<col>2</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&lt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/y-offset-m</property>
<step>-0.01</step>
</binding>
</button>
<input>
<row>1</row>
<col>3</col>
<name>offset-y</name>
<pref-width>65</pref-width>
<label>m </label>
<live>true</live>
<property>/sim/current-view/y-offset-m</property>
<binding>
<command>dialog-apply</command>
<object-name>offset-y</object-name>
</binding>
</input>
<group>
<layout>vbox</layout>
<button>
<row>1</row>
<col>4</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&gt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/y-offset-m</property>
<step>0.01</step>
</binding>
</button>
<button>
<row>1</row>
<col>5</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&gt;&gt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/y-offset-m</property>
<step>0.1</step>
</binding>
</button>
<text>
<row>1</row>
<col>6</col>
<label>up</label>
</text>
<button>
<row>1</row>
<col>7</col>
<text><label>Left/Right</label></text>
<dial>
<wrap>false</wrap>
<min>-100</min>
<max>100</max>
<stretch>true</stretch>
<property>/sim/current-view/x-offset-m</property>
<binding><command>dialog-apply</command></binding>
</dial>
<button>
<legend>Zero</legend>
<binding>
<command>property-assign</command>
<property>/sim/current-view/x-offset-m</property>
<value>0</value>
</binding>
</button>
<legend>Reset</legend>
<binding>
<command>property-assign</command>
<property>/sim/current-view/y-offset-m</property>
<property>/sim/current-view/config/y-offset-m</property>
</binding>
</button>
<text>
<label>-100.00</label>
<format>%-0.2f m</format>
<live>true</live>
<property>/sim/current-view/x-offset-m</property>
</text>
</group>
<text>
<row>2</row>
<col>0</col>
<label>fwd.</label>
</text>
<button>
<row>2</row>
<col>1</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&lt;&lt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/z-offset-m</property>
<step>-0.1</step>
</binding>
</button>
<button>
<row>2</row>
<col>2</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&lt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/z-offset-m</property>
<step>-0.01</step>
</binding>
</button>
<input>
<row>2</row>
<col>3</col>
<name>offset-z</name>
<pref-width>65</pref-width>
<label>m</label>
<live>true</live>
<property>/sim/current-view/z-offset-m</property>
<binding>
<command>dialog-apply</command>
<object-name>offset-z</object-name>
</binding>
</input>
<button>
<row>2</row>
<col>4</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&gt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/z-offset-m</property>
<step>0.01</step>
</binding>
</button>
<button>
<row>2</row>
<col>5</col>
<pref-width>25</pref-width>
<pref-height>25</pref-height>
<legend>&gt;&gt;</legend>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/z-offset-m</property>
<step>0.1</step>
</binding>
</button>
<text>
<row>2</row>
<col>6</col>
<label>back</label>
</text>
<button>
<row>2</row>
<col>7</col>
<legend>Reset</legend>
<binding>
<command>property-assign</command>
<property>/sim/current-view/z-offset-m</property>
<property>/sim/current-view/config/z-offset-m</property>
</binding>
</button>
</group>
<group>
<layout>vbox</layout>
<hrule/>
<text><label>Down/Up</label></text>
<dial>
<wrap>false</wrap>
<min>-100</min>
<max>100</max>
<stretch>true</stretch>
<property>/sim/current-view/y-offset-m</property>
<binding><command>dialog-apply</command></binding>
</dial>
<button>
<legend>Zero</legend>
<binding>
<command>property-assign</command>
<property>/sim/current-view/y-offset-m</property>
<value>0</value>
</binding>
</button>
<text>
<label>-100.00</label>
<format>%-0.2f m</format>
<live>true</live>
<property>/sim/current-view/y-offset-m</property>
</text>
</group>
<group>
<layout>vbox</layout>
<text><label>Fwd/Back</label></text>
<dial>
<wrap>false</wrap>
<min>-100</min>
<max>100</max>
<stretch>true</stretch>
<property>/sim/current-view/z-offset-m</property>
<binding><command>dialog-apply</command></binding>
</dial>
<button>
<legend>Zero</legend>
<binding>
<command>property-assign</command>
<property>/sim/current-view/z-offset-m</property>
<value>0</value>
</binding>
</button>
<text>
<label>-100.00</label>
<format>%-0.2f m</format>
<live>true</live>
<property>/sim/current-view/z-offset-m</property>
</text>
</group>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<button>
<legend>Close</legend>
<equal>true</equal>
<default>true</default>
<key>Esc</key>
<binding><command>dialog-apply</command></binding>
<binding><command>dialog-close</command></binding>
</button>
<empty><stretch>true</stretch></empty>
</group>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<button>
<legend>Close</legend>
<equal>true</equal>
<default>true</default>
<key>Esc</key>
<binding><command>dialog-apply</command></binding>
<binding><command>dialog-close</command></binding>
</button>
<empty><stretch>true</stretch></empty>
</group>
</PropertyList>