Added a couple of simple demo dialogs, and bound the wind dialog to Ctrl-D.
This commit is contained in:
parent
c2ca4bf71a
commit
a5dcab7a5a
4 changed files with 177 additions and 110 deletions
107
gui/hello.xml
107
gui/hello.xml
|
@ -1,107 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Early sample GUI configuration.
|
||||
|
||||
This file will eventually hold (or point to) the configuration for all
|
||||
of the FlightGear GUI. For now, however, the contents are strictly
|
||||
experimentation. Here are some quick notes:
|
||||
|
||||
1. Coordinates are from the bottom left corner of the parent container
|
||||
(the bottom-left convention comes from OpenGL).
|
||||
|
||||
2. Allowed types are "group", "dialog", "input", "text", and
|
||||
"button".
|
||||
|
||||
3. Any component may have an "x", "y", "width", and "height"
|
||||
subproperty.
|
||||
|
||||
4. For GUI purposes, the FlightGear window is always assumed to be
|
||||
1024x768, no matter how large or small it is actually displayed.
|
||||
|
||||
5. The top-level dialog container will always be centered on the
|
||||
screen.
|
||||
|
||||
6. Top-level objects without a name will be ignored.
|
||||
|
||||
7. If changing a property value in an "input" component isn't working,
|
||||
it's probably a problem with the property; try the FlightGear
|
||||
property browser and see if it can be changed there.
|
||||
|
||||
8. Use these notes with caution; they're probably already out of date.
|
||||
|
||||
-->
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<type>dialog</type>
|
||||
|
||||
<!-- A sample dialog to say hello and control the orientation -->
|
||||
|
||||
<name>hello</name>
|
||||
<width>400</width>
|
||||
<height>180</height>
|
||||
<modal>false</modal>
|
||||
|
||||
<text>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<label>Hello, virtual FlightGear world!</label>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>degrees roll</label>
|
||||
<default-value-prop>/orientation/roll-deg</default-value-prop>
|
||||
</input>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>degrees pitch</label>
|
||||
<default-value-prop>/orientation/pitch-deg</default-value-prop>
|
||||
</input>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>degrees heading</label>
|
||||
<default-value-prop>/orientation/heading-deg</default-value-prop>
|
||||
</input>
|
||||
|
||||
<button>
|
||||
<x>5</x>
|
||||
<y>10</y>
|
||||
<legend>OK</legend>
|
||||
<action>close-apply</action>
|
||||
<default>true</default>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>105</x>
|
||||
<y>10</y>
|
||||
<legend>Apply</legend>
|
||||
<action>apply</action>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>205</x>
|
||||
<y>10</y>
|
||||
<legend>Update</legend>
|
||||
<action>update</action>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>305</x>
|
||||
<y>10</y>
|
||||
<legend>Cancel</legend>
|
||||
<action>close</action>
|
||||
</button>
|
||||
|
||||
</PropertyList>
|
87
gui/location.xml
Normal file
87
gui/location.xml
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<type>dialog</type>
|
||||
|
||||
<!-- Control the aircraft location -->
|
||||
|
||||
<name>location</name>
|
||||
<width>400</width>
|
||||
<height>180</height>
|
||||
<modal>false</modal>
|
||||
|
||||
<text>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<label>Aircraft Location</label>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>degrees longitude</label>
|
||||
<property>/position/longitude-deg</property>
|
||||
</input>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>degrees latitude</label>
|
||||
<property>/position/latitude-deg</property>
|
||||
</input>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>feet altitude MSL</label>
|
||||
<property>/position/altitude-ft</property>
|
||||
</input>
|
||||
|
||||
<button>
|
||||
<x>5</x>
|
||||
<y>10</y>
|
||||
<legend>OK</legend>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
<default>true</default>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>105</x>
|
||||
<y>10</y>
|
||||
<legend>Apply</legend>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>205</x>
|
||||
<y>10</y>
|
||||
<legend>Reset</legend>
|
||||
<binding>
|
||||
<command>dialog-update</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>305</x>
|
||||
<y>10</y>
|
||||
<legend>Cancel</legend>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
</PropertyList>
|
87
gui/winds.xml
Normal file
87
gui/winds.xml
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<type>dialog</type>
|
||||
|
||||
<!-- Control the weather -->
|
||||
|
||||
<name>winds</name>
|
||||
<width>400</width>
|
||||
<height>180</height>
|
||||
<modal>false</modal>
|
||||
|
||||
<text>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<label>Environment: Winds</label>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>wind direction (deg)</label>
|
||||
<property>/environment/wind-from-heading-deg</property>
|
||||
</input>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>base wind speed (kt)</label>
|
||||
<property>/environment/params/base-wind-speed-kt</property>
|
||||
</input>
|
||||
|
||||
<input>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>200</width>
|
||||
<height>25</height>
|
||||
<label>gust wind speed (kt)</label>
|
||||
<property>/environment/params/gust-wind-speed-kt</property>
|
||||
</input>
|
||||
|
||||
<button>
|
||||
<x>5</x>
|
||||
<y>10</y>
|
||||
<legend>OK</legend>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
<default>true</default>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>105</x>
|
||||
<y>10</y>
|
||||
<legend>Apply</legend>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>205</x>
|
||||
<y>10</y>
|
||||
<legend>Reset</legend>
|
||||
<binding>
|
||||
<command>dialog-update</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<x>305</x>
|
||||
<y>10</y>
|
||||
<legend>Cancel</legend>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
</PropertyList>
|
|
@ -42,10 +42,10 @@ calculated by adding 256 to the GLUT key value in glut.h.
|
|||
|
||||
<key n="4">
|
||||
<name>Ctrl-D</name>
|
||||
<desc>Dummy dialog</desc>
|
||||
<desc>weather dialog</desc>
|
||||
<binding>
|
||||
<command>gui</command>
|
||||
<name>hello</name>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>winds</dialog-name>
|
||||
</binding>
|
||||
</key>
|
||||
|
||||
|
|
Loading…
Reference in a new issue