1
0
Fork 0

- better layout (done by embedded Nasal)

- no longer modal (this caused problems with dialogs opened by keystrokes)
This commit is contained in:
mfranz 2007-07-02 14:34:01 +00:00
parent 04f9a0b2ea
commit aa411b3e73

View file

@ -1,25 +1,60 @@
<?xml version="1.0"?>
<!--
generic one-button-message; MESSAGE and BUTTONTEXT are
to be filled in before displaying. Used for the screenshot
message and others.
-->
<PropertyList>
<name>message</name>
<modal>true</modal>
<modal>false</modal>
<layout>vbox</layout>
<default-padding>10</default-padding>
<default-padding>6</default-padding>
<group-template>
<hide>1</hide>
<layout>hbox</layout>
<default-padding>0</default-padding>
<text>
<label>MESSAGE</label>
</text>
<empty><stretch>1</stretch></empty>
</group-template>
<group>
<layout>hbox</layout>
<default-padding>8</default-padding>
<group>
<layout>vbox</layout>
<default-padding>0</default-padding>
</group>
</group>
<button>
<legend>BUTTONTEXT</legend>
<legend>OK</legend>
<default>true</default>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
<nasal>
<open>
var self = cmdarg();
var dlgname = self.getNode("name").getValue();
var dlg = props.globals.getNode("/sim/gui/dialogs/" ~ dlgname, 1);
var msg = dlg.getNode("message", 1).getValue();
var textgroup = self.getNode("group-template");
self.getNode("group/group").removeChildren("group");
var lines = split("\n", msg);
forindex (var i; lines) {
var target = self.getNode("group/group").getChild("group", i, 1);
props.copy(textgroup, target);
target.getNode("text/label").setValue(lines[i]);
target.getNode("hide").setValue(0);
}
</open>
<close>
dlg.getParent().removeChild(dlg.getName(), dlg.getIndex());
</close>
</nasal>
</PropertyList>