1
0
Fork 0

Consistent Close and title bars for Fuel & Payload, Wildfire and Route Manager dialogs.

This commit is contained in:
Stuart Buchanan 2010-12-28 19:51:34 +00:00
parent 9e354344af
commit 16b7ffba05
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("layout", "vbox");
var header = dialog[name].addChild("text");
header.set("label", title);
var header = dialog[name].addChild("group");
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");
@ -801,15 +810,17 @@ var showWeightDialog = func {
weightitem = nil;
}
dialog[name].addChild("hrule");
var buttonBar = dialog[name].addChild("group");
buttonBar.set("layout", "hbox");
buttonBar.set("default-padding", 10);
var ok = buttonBar.addChild("button");
ok.set("legend", "OK");
ok.set("key", "esc");
ok.setBinding("dialog-apply");
ok.setBinding("dialog-close");
var close = buttonBar.addChild("button");
close.set("legend", "Close");
close.set("default", "true");
close.set("key", "Enter");
close.setBinding("dialog-close");
# Temporary helper function
var tcell = func(parent, type, row, col) {

View file

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

View file

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