1
0
Fork 0

cleanup: use new Widget.setBinding()

This commit is contained in:
mfranz 2006-08-26 07:32:16 +00:00
parent 74b5436cde
commit be8ca62fc9

View file

@ -927,8 +927,7 @@ showModelSelectDialog = func {
w.set("default", 1); w.set("default", 1);
w.set("keynum", 27); w.set("keynum", 27);
w.set("border", 1); w.set("border", 1);
w.prop().getNode("binding[0]/command", 1).setValue("nasal"); w.setBinding("nasal", "ufo.closeModelSelectDialog()");
w.prop().getNode("binding[0]/script", 1).setValue("ufo.closeModelSelectDialog()");
w = dialog[name].addChild("list"); w = dialog[name].addChild("list");
w.set("halign", "fill"); w.set("halign", "fill");
@ -937,9 +936,8 @@ showModelSelectDialog = func {
forindex (var i; modellist) { forindex (var i; modellist) {
w.prop().getChild("value", i, 1).setValue(modellist[i]); w.prop().getChild("value", i, 1).setValue(modellist[i]);
} }
w.prop().getNode("binding[0]/command", 1).setValue("dialog-apply"); w.setBinding("dialog-apply");
w.prop().getNode("binding[1]/command", 1).setValue("nasal"); w.setBinding("nasal", "ufo.modelmgr.setmodelpath(getprop('/cursor'))");
w.prop().getNode("binding[1]/script", 1).setValue("ufo.modelmgr.setmodelpath(getprop('/cursor'))");
fgcommand("dialog-new", dialog[name].prop()); fgcommand("dialog-new", dialog[name].prop());
gui.showDialog(name); gui.showDialog(name);
@ -988,9 +986,8 @@ showModelAdjustDialog = func {
w.set("default", 1); w.set("default", 1);
w.set("keynum", 27); w.set("keynum", 27);
w.set("border", 1); w.set("border", 1);
w.prop().getNode("binding[0]/command", 1).setValue("nasal"); w.setBinding("nasal", "delete(ufo.dialog, \"" ~ name ~ "\")");
w.prop().getNode("binding[0]/script", 1).setValue("delete(ufo.dialog, \"" ~ name ~ "\")"); w.setBinding("dialog-close");
w.prop().getNode("binding[1]/command", 1).setValue("dialog-close");
slider = func(legend, col, coarse, fine) { slider = func(legend, col, coarse, fine) {
group = dialog[name].addChild("group"); group = dialog[name].addChild("group");
@ -1003,8 +1000,7 @@ showModelAdjustDialog = func {
b.set("pref-width", 22); b.set("pref-width", 22);
b.set("pref-height", 22); b.set("pref-height", 22);
b.set("live", 1); b.set("live", 1);
b.prop().getNode("binding[0]/command", 1).setValue("nasal"); b.setBinding("nasal", 'ufo.adjust.step("'~legend~'", '~step~')');
b.prop().getNode("binding[0]/script", 1).setValue('ufo.adjust.step("'~legend~'", '~step~')');
return b; return b;
} }
@ -1019,7 +1015,7 @@ showModelAdjustDialog = func {
s.set("min", -1 * fine); s.set("min", -1 * fine);
s.set("max", 1 * fine); s.set("max", 1 * fine);
s.setColor(col[0], col[1], col[2]); s.setColor(col[0], col[1], col[2]);
s.prop().getNode("binding[0]/command", 1).setValue("dialog-apply"); s.setBinding("dialog-apply");
fr = button(">", fine); fr = button(">", fine);
cr = button(">>", coarse); cr = button(">>", coarse);
@ -1061,8 +1057,7 @@ showModelAdjustDialog = func {
w.set("legend", "Reset"); w.set("legend", "Reset");
w.set("pref-height", 22); w.set("pref-height", 22);
w.set("pref-width", wide); w.set("pref-width", wide);
w.prop().getNode("binding[0]/command", 1).setValue("nasal"); w.setBinding("nasal", "ufo.adjust.orient()");
w.prop().getNode("binding[0]/script", 1).setValue("ufo.adjust.orient()");
w = g.addChild("button"); w = g.addChild("button");
w.set("legend", "Sticky"); w.set("legend", "Sticky");
@ -1071,7 +1066,7 @@ showModelAdjustDialog = func {
w.set("pref-width", narrow); w.set("pref-width", narrow);
w.set("live", 1); w.set("live", 1);
w.set("property", adjust.stk_hdgN.getPath()); w.set("property", adjust.stk_hdgN.getPath());
w.prop().getNode("binding[0]/command", 1).setValue("dialog-apply"); w.setBinding("dialog-apply");
g.addChild("empty").set("stretch", 1); g.addChild("empty").set("stretch", 1);
@ -1080,8 +1075,7 @@ showModelAdjustDialog = func {
w.set("legend", "Center"); w.set("legend", "Center");
w.set("pref-height", 22); w.set("pref-height", 22);
w.set("pref-width", wide); w.set("pref-width", wide);
w.prop().getNode("binding[0]/command", 1).setValue("nasal"); w.setBinding("nasal", "ufo.adjust.center_sliders()");
w.prop().getNode("binding[0]/script", 1).setValue("ufo.adjust.center_sliders()");
g.addChild("empty").set("stretch", 1); g.addChild("empty").set("stretch", 1);
@ -1092,15 +1086,14 @@ showModelAdjustDialog = func {
w.set("pref-width", narrow); w.set("pref-width", narrow);
w.set("live", 1); w.set("live", 1);
w.set("property", adjust.stk_orientN.getPath()); w.set("property", adjust.stk_orientN.getPath());
w.prop().getNode("binding[0]/command", 1).setValue("dialog-apply"); w.setBinding("dialog-apply");
w = g.addChild("button"); w = g.addChild("button");
w.set("halign", "left"); w.set("halign", "left");
w.set("legend", "Reset"); w.set("legend", "Reset");
w.set("pref-height", 22); w.set("pref-height", 22);
w.set("pref-width", wide); w.set("pref-width", wide);
w.prop().getNode("binding[0]/command", 1).setValue("nasal"); w.setBinding("nasal", "ufo.adjust.upright()");
w.prop().getNode("binding[0]/script", 1).setValue("ufo.adjust.upright()");
fgcommand("dialog-new", dialog[name].prop()); fgcommand("dialog-new", dialog[name].prop());
gui.showDialog(name); gui.showDialog(name);
@ -1143,7 +1136,7 @@ showStatusDialog = func(v = nil) {
w.prop().setValues({"color-legend": {red:1, green:1, blue:1, alpha:1}}); w.prop().setValues({"color-legend": {red:1, green:1, blue:1, alpha:1}});
w.prop().setValues({"color-background": {red:0, green:0, blue:0, alpha:0}}); w.prop().setValues({"color-background": {red:0, green:0, blue:0, alpha:0}});
w.prop().setValues({"color-highlight": {red:0, green:0, blue:0, alpha:0}}); w.prop().setValues({"color-highlight": {red:0, green:0, blue:0, alpha:0}});
w.prop().getNode("binding[0]/command", 1).setValue("dialog-apply"); w.setBinding("dialog-apply");
# current object # current object
g = dialog[name].addChild("group"); g = dialog[name].addChild("group");