1
0
Fork 0

Merge commit '9fd7e88'

This commit is contained in:
Ryan Miller 2010-12-28 18:55:43 -08:00
commit 2d00d51107
3 changed files with 142 additions and 80 deletions

View file

@ -724,8 +724,17 @@ var showWeightDialog = func {
dialog[name].set("name", name); dialog[name].set("name", name);
dialog[name].set("layout", "vbox"); dialog[name].set("layout", "vbox");
var header = dialog[name].addChild("text"); var header = dialog[name].addChild("group");
header.set("label", title); header.set("layout", "hbox");
header.addChild("empty").set("stretch", "1");
header.addChild("text").set("label", title);
header.addChild("empty").set("stretch", "1");
var w = header.addChild("button");
w.set("pref-width", 16);
w.set("pref-height", 16);
w.set("legend", "");
w.set("default", 0);
w.setBinding("dialog-close");
dialog[name].addChild("hrule"); dialog[name].addChild("hrule");
@ -801,15 +810,17 @@ var showWeightDialog = func {
weightitem = nil; weightitem = nil;
} }
dialog[name].addChild("hrule");
var buttonBar = dialog[name].addChild("group"); var buttonBar = dialog[name].addChild("group");
buttonBar.set("layout", "hbox"); buttonBar.set("layout", "hbox");
buttonBar.set("default-padding", 10); buttonBar.set("default-padding", 10);
var ok = buttonBar.addChild("button"); var close = buttonBar.addChild("button");
ok.set("legend", "OK"); close.set("legend", "Close");
ok.set("key", "esc"); close.set("default", "true");
ok.setBinding("dialog-apply"); close.set("key", "Enter");
ok.setBinding("dialog-close"); close.setBinding("dialog-close");
# Temporary helper function # Temporary helper function
var tcell = func(parent, type, row, col) { var tcell = func(parent, type, row, col) {

View file

@ -979,12 +979,12 @@ var dialog = {
titlebar.set("layout", "hbox"); titlebar.set("layout", "hbox");
titlebar.addChild("empty").set("stretch", 1); titlebar.addChild("empty").set("stretch", 1);
titlebar.addChild("text").set("label", "Wildfire settings"); titlebar.addChild("text").set("label", "Wildfire settings");
titlebar.addChild("empty").set("stretch", 1);
var w = titlebar.addChild("button"); var w = titlebar.addChild("button");
w.set("pref-width", 16); w.set("pref-width", 16);
w.set("pref-height", 16); w.set("pref-height", 16);
w.set("legend", ""); w.set("legend", "");
w.set("default", 0); w.set("default", 0);
w.set("key", "esc");
w.setBinding("nasal", "wildfire.dialog.destroy(); "); w.setBinding("nasal", "wildfire.dialog.destroy(); ");
w.setBinding("dialog-close"); w.setBinding("dialog-close");
me.dialog.addChild("hrule"); me.dialog.addChild("hrule");
@ -1011,13 +1011,25 @@ var dialog = {
} }
me.dialog.addChild("hrule"); me.dialog.addChild("hrule");
# Buttons
var buttons = me.dialog.addChild("group");
buttons.node.setValues({"layout" : "hbox"});
# Load button. # Load button.
var load = me.dialog.addChild("button"); var load = buttons.addChild("button");
load.node.setValues({"legend" : "Load Wildfire log", load.node.setValues({"legend" : "Load Wildfire log",
"halign" : "center"}); "halign" : "center"});
load.setBinding("nasal", load.setBinding("nasal",
"wildfire.dialog.select_and_load()"); "wildfire.dialog.select_and_load()");
# Close button
var close = buttons.addChild("button");
close.node.setValues({"legend" : "Close",
"default" : "true",
"key" : "Esc"});
close.setBinding("nasal", "wildfire.dialog.destroy();");
close.setBinding("dialog-close");
fgcommand("dialog-new", me.dialog.prop()); fgcommand("dialog-new", me.dialog.prop());
fgcommand("dialog-show", me.namenode); fgcommand("dialog-show", me.namenode);
}, },

View file

@ -224,12 +224,17 @@ command interface /autopilot/route-manager/input:
<!-- departure / arrival airport information --> <!-- departure / arrival airport information -->
<group> <group>
<layout>hbox</layout> <layout>table</layout>
<text> <text>
<row>0</row>
<col>0</col>
<halign>right</halign>
<label>Departure:</label> <label>Departure:</label>
<pref-width>80</pref-width>
</text> </text>
<input> <input>
<row>0</row>
<col>1</col>
<halign>left</halign>
<name>departure-airport</name> <name>departure-airport</name>
<pref-width>60</pref-width> <pref-width>60</pref-width>
<property>/autopilot/route-manager/departure/airport</property> <property>/autopilot/route-manager/departure/airport</property>
@ -246,6 +251,8 @@ command interface /autopilot/route-manager/input:
</input> </input>
<text> <text>
<row>0</row>
<col>2</col>
<format>%s</format> <format>%s</format>
<property>/autopilot/route-manager/departure/name</property> <property>/autopilot/route-manager/departure/name</property>
<live>true</live> <live>true</live>
@ -254,11 +261,16 @@ command interface /autopilot/route-manager/input:
</text> </text>
<text> <text>
<row>0</row>
<col>3</col>
<halign>right</halign>
<label>Rwy:</label> <label>Rwy:</label>
</text> </text>
<combo> <combo>
<row>0</row>
<col>4</col>
<halign>left</halign>
<name>departure-runway</name> <name>departure-runway</name>
<pref-width>60</pref-width>
<property>/autopilot/route-manager/departure/runway</property> <property>/autopilot/route-manager/departure/runway</property>
<editable>false</editable> <editable>false</editable>
<properties>/sim/gui/dialogs/route-manager/departure-runways</properties> <properties>/sim/gui/dialogs/route-manager/departure-runways</properties>
@ -274,11 +286,16 @@ command interface /autopilot/route-manager/input:
</combo> </combo>
<text> <text>
<row>0</row>
<col>5</col>
<halign>right</halign>
<label>SID:</label> <label>SID:</label>
</text> </text>
<combo> <combo>
<row>0</row>
<col>6</col>
<halign>left</halign>
<name>sid</name> <name>sid</name>
<pref-width>100</pref-width>
<property>/autopilot/route-manager/departure/sid</property> <property>/autopilot/route-manager/departure/sid</property>
<editable>false</editable> <editable>false</editable>
<properties>/sim/gui/dialogs/route-manager/sids</properties> <properties>/sim/gui/dialogs/route-manager/sids</properties>
@ -288,17 +305,19 @@ command interface /autopilot/route-manager/input:
<object-name>sid</object-name> <object-name>sid</object-name>
</binding> </binding>
</combo> </combo>
</group>
<group>
<layout>hbox</layout>
<text> <text>
<row>1</row>
<col>0</col>
<halign>right</halign>
<label>Arrival:</label> <label>Arrival:</label>
<pref-width>80</pref-width>
</text> </text>
<input> <input>
<name>destination-airport</name> <row>1</row>
<col>1</col>
<halign>left</halign>
<pref-width>60</pref-width> <pref-width>60</pref-width>
<name>destination-airport</name>
<property>/autopilot/route-manager/destination/airport</property> <property>/autopilot/route-manager/destination/airport</property>
<live>true</live> <live>true</live>
<binding> <binding>
@ -311,7 +330,10 @@ command interface /autopilot/route-manager/input:
</binding> </binding>
</input> </input>
<text> <text>
<row>1</row>
<col>2</col>
<stretch>true</stretch> <stretch>true</stretch>
<pref-width>200</pref-width>
<format>%s</format> <format>%s</format>
<property>/autopilot/route-manager/destination/name</property> <property>/autopilot/route-manager/destination/name</property>
<live>true</live> <live>true</live>
@ -319,11 +341,16 @@ command interface /autopilot/route-manager/input:
</text> </text>
<text> <text>
<row>1</row>
<col>3</col>
<halign>right</halign>
<label>Rwy:</label> <label>Rwy:</label>
</text> </text>
<combo> <combo>
<row>1</row>
<col>4</col>
<halign>left</halign>
<name>destination-runway</name> <name>destination-runway</name>
<pref-width>60</pref-width>
<property>/autopilot/route-manager/destination/runway</property> <property>/autopilot/route-manager/destination/runway</property>
<editable>false</editable> <editable>false</editable>
<properties>/sim/gui/dialogs/route-manager/destination-runways</properties> <properties>/sim/gui/dialogs/route-manager/destination-runways</properties>
@ -340,11 +367,16 @@ command interface /autopilot/route-manager/input:
</combo> </combo>
<text> <text>
<row>1</row>
<col>5</col>
<halign>right</halign>
<label>STAR:</label> <label>STAR:</label>
</text> </text>
<combo> <combo>
<row>1</row>
<col>6</col>
<halign>left</halign>
<name>star</name> <name>star</name>
<pref-width>100</pref-width>
<property>/autopilot/route-manager/destination/star</property> <property>/autopilot/route-manager/destination/star</property>
<editable>false</editable> <editable>false</editable>
<properties>/sim/gui/dialogs/route-manager/stars</properties> <properties>/sim/gui/dialogs/route-manager/stars</properties>
@ -375,28 +407,28 @@ command interface /autopilot/route-manager/input:
<group> <group>
<layout>hbox</layout> <layout>hbox</layout>
<text> <text>
<halign>right</halign>
<label>Cruise Speed (kts):</label> <label>Cruise Speed (kts):</label>
<pref-width>80</pref-width>
</text> </text>
<input> <input>
<name>cruise-speed</name> <name>cruise-speed</name>
<live>true</live> <live>true</live>
<halign>fill</halign> <halign>left</halign>
<stretch>true</stretch> <stretch>true</stretch>
<pref-width>150</pref-width> <pref-width>100</pref-width>
<property>/autopilot/route-manager/cruise/speed-kts</property> <property>/autopilot/route-manager/cruise/speed-kts</property>
</input> </input>
<text> <text>
<label>Cruise Altitude (ft/FL):</label> <label>Cruise Altitude (ft/FL):</label>
<pref-width>80</pref-width> <halign>right</halign>
</text> </text>
<input> <input>
<name>cruise-alt</name> <name>cruise-alt</name>
<live>true</live> <live>true</live>
<halign>fill</halign> <halign>left</halign>
<stretch>true</stretch> <stretch>true</stretch>
<pref-width>150</pref-width> <pref-width>100</pref-width>
<property>/autopilot/route-manager/cruise/altitude-ft</property> <property>/autopilot/route-manager/cruise/altitude-ft</property>
</input> </input>
</group> </group>
@ -582,5 +614,12 @@ command interface /autopilot/route-manager/input:
<script>save_selector.open();</script> <script>save_selector.open();</script>
</binding> </binding>
</button> </button>
<button>
<legend>Close</legend>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group> </group>
</PropertyList> </PropertyList>