1
0
Fork 0

Remove some debug code. Misc. cleanups.

This commit is contained in:
andy 2003-12-08 05:45:03 +00:00
parent 3677b96fad
commit dfb39d9099

View file

@ -25,21 +25,18 @@ popupNode = nil;
labelNode = nil; labelNode = nil;
fovDialog = nil; fovDialog = nil;
INIT = func { INIT = func {
print("view.INIT()");
fovProp = props.globals.getNode("/sim/current-view/field-of-view"); fovProp = props.globals.getNode("/sim/current-view/field-of-view");
screenProp = props.globals.getNode("/sim/startup/xsize"); screenProp = props.globals.getNode("/sim/startup/xsize");
# Set up the dialog property node: # Set up the dialog property node:
tmpl = { name : "fov", modal : 0, width : "120", height : "40", tmpl = { name : "fov", modal : 0, width : 120, height : 40,
text : { x : 10, y : 6, label : "FOV:" } }; text : { x : 10, y : 6, label : "FOV:" } };
popupNode = props.Node.new(tmpl); popupNode = props.Node.new(tmpl);
text = popupNode.getNode("text", 1); text = popupNode.getNode("text", 1);
labelNode = popupNode.getNode("text/label"); labelNode = popupNode.getNode("text/label");
fgcommand("dialog-new", popupNode); fgcommand("dialog-new", popupNode);
# Cache the FGCommand argument # Cache the command argument for popup/popdown
fovDialog = props.Node.new({ "dialog-name" : "fov" }); fovDialog = props.Node.new({ "dialog-name" : "fov" });
} }
settimer(INIT, 0); settimer(INIT, 0);
@ -102,16 +99,11 @@ decrease = func {
# #
popdown = func { fgcommand("dialog-close", fovDialog); } popdown = func { fgcommand("dialog-close", fovDialog); }
popup = func { popup = func {
fov = arg[0]; # Make sure it isn't already showing, initialize it, show it,
fov = format(fov); # and kill it automatically after a second
labelNode.setValue("FOV: " ~ fov);
# Create it, show it
popdown(); popdown();
labelNode.setValue("FOV: " ~ format(arg[0]));
fgcommand("dialog-show", fovDialog); fgcommand("dialog-show", fovDialog);
# And kill it automatically after a second
settimer(popdown, 1); settimer(popdown, 1);
} }