diff --git a/gui/dialogs/marker-adjust.xml b/gui/dialogs/marker-adjust.xml index f7fd05085..f07c071d4 100644 --- a/gui/dialogs/marker-adjust.xml +++ b/gui/dialogs/marker-adjust.xml @@ -1,4 +1,9 @@ + marker-adjust @@ -36,18 +41,22 @@ var self = cmdarg(); var dlgname = self.getNode("name").getValue(); + var kbdctrl = props.globals.getNode("/devices/status/keyboard/ctrl"); + var kbdshift = props.globals.getNode("/devices/status/keyboard/shift"); var Value = { - new : func(name, init = 0) { + new : func(name, factor, init = 0) { var m = { parents: [Value] }; m.name = name; + m.factor = factor; + m.init = init; var n = props.globals.getNode("/sim/model/marker/" ~ m.name, 1); m.sliderN = n.getNode("slider", 1); m.offsetN = n.getNode("offset", 1); m.valueN = n.getNode("value", 1); m.offsetN.setDoubleValue(0); m.sliderN.setDoubleValue(0); - m.valueN.setDoubleValue(init); + m.valueN.setDoubleValue(m.init); m.last_slider = 0; m.center(); m.sliderL = setlistener(m.sliderN, func { m.update() }); @@ -56,10 +65,20 @@ del : func { removelistener(me.sliderL); }, + reset : func { + me.center(); + me.valueN.setDoubleValue(me.init); + }, update : func { var offs = me.sliderN.getValue(); var v = me.offsetN.getValue() + me.sliderN.getValue() - me.last_slider; - me.valueN.setValue(me.valueN.getValue() + v * 0.1); + var f = me.factor; + if (kbdctrl.getValue()) { + f *= 5; + } elsif (kbdshift.getValue()) { + f *= 0.1; + } + me.valueN.setValue(me.valueN.getValue() + v * f); me.offsetN.setDoubleValue(0); me.last_slider = offs; }, @@ -70,10 +89,10 @@ }; var values = [ - Value.new("x"), - Value.new("y"), - Value.new("z"), - Value.new("scale", 1), + Value.new("x", 0.1), # aft/fore + Value.new("y", 0.1), # left/right + Value.new("z", 0.1), # down/up + Value.new("scale", 2, 1), ]; var center = func { @@ -82,6 +101,12 @@ } } + var reset = func { + foreach (var v; values) { + v.reset(); + } + } + var dump = func { print("<marker>"); foreach (var v; values) { @@ -121,7 +146,7 @@ property-adjust /sim/model/marker/x/offset - -10 + 10 nasal @@ -137,7 +162,7 @@ property-adjust /sim/model/marker/x/offset - -1 + 1 nasal @@ -148,11 +173,11 @@ x /sim/model/marker/x/slider - fore/aft + aft/fore 250 1 - -1 - 1 + 1 + -1 1.0 @@ -175,7 +200,7 @@ property-adjust /sim/model/marker/x/offset - 1 + -1 nasal @@ -191,7 +216,7 @@ property-adjust /sim/model/marker/x/offset - 10 + -10 nasal @@ -477,6 +502,17 @@ hbox 2 + + 1