Dialog Slider not showing default value

Started by bertro

bertro Lv 1

In LUA v2, the dialog slider object (integer or decimal):

1) does not initially show a default value unless the default value is bigger than the minimum value. If you move the slider a bit, the value will appear. See attached file…

2) the left and right arrows are not working.

bertro Lv 1

Here is the code:

function AskVerbose()
local ask = dialog.CreateDialog("Test Dialog")
ask.Instructions = dialog.AddLabel("Set these values:")
ask.Invert = dialog.AddCheckbox("Invert", true)
ask.Iterations = dialog.AddSlider("Iterations", 1, 1, 25, 0) – (default, min, max, 1=Int/0=Decimal)
ask.Iterations1 = dialog.AddSlider("Iterations1", 2, 2, 25, 0) – (default, min, max, 1=Int/0=Decimal)
ask.Iterations2 = dialog.AddSlider("Iterations2", 1, 0, 25, 0) – (default, min, max, 1=Int/0=Decimal)
ask.BandStrength = dialog.AddSlider("Band Strength", 5.3, 0.1, 10.0, 1) – (default, min, max, 1=Int/0=Decimal)
ask.BandStrength1 = dialog.AddSlider("Band Strength1", 0.1, 0.1, 10.0, 1) – (default, min, max, 1=Int/0=Decimal)
ask.Comment = dialog.AddTextbox("Comment", "Cool!")
ask.OK = dialog.AddButton("OK", 1)
ask.Cancel = dialog.AddButton("Cancel", 0)
if (dialog.Show(ask) > 0) then
Verbose = true
local tell = dialog.CreateDialog("Test Dialog Results")
if (ask.Invert.value) then
tell.Invert = dialog.AddLabel("Invert=true")
else
tell.Invert = dialog.AddLabel("Invert=false")
end
tell.Iterations = dialog.AddLabel("Iterations="..ask.Iterations.value)
tell.BandStrength = dialog.AddLabel("Band Strength="..ask.BandStrength.value)
tell.Comment = dialog.AddLabel("Comment="..ask.Comment.value)
tell.OK = dialog.AddButton("OK", 1)
dialog.Show(tell)
else
Verbose = false
print("Dialog cancelled")
end
end

AskVerbose()