progress RANGE not working Topic is solved
progress RANGE not working
Gui new
Gui Add, Progress, w600 h20 cBlue backgroundyellow vProgbar
Gui show
myvar := 30 ;any arbitrary value
GuiControl ,,progbar, range1-%myvar%
guicontrol ,,progbar, %myvar%/2 ;<--- does NOT show correctly (ends up NOT in the bar's ->MIDDLE)
guicontrol ,,progbar, %myvar%*9/10 ;<--- NOT near bar's end :/
pause
can replace the %myvar% in the 6th and 7th lines with absolute values (15 and 27) and this won't make any difference
btw using any value grater than 100 for myvar gives a even worst result
seems like the bar range is always being set as the default, 0-100 :/ MYVAR not being considered by the runtime
I appreciate any help
Gui Add, Progress, w600 h20 cBlue backgroundyellow vProgbar
Gui show
myvar := 30 ;any arbitrary value
GuiControl ,,progbar, range1-%myvar%
guicontrol ,,progbar, %myvar%/2 ;<--- does NOT show correctly (ends up NOT in the bar's ->MIDDLE)
guicontrol ,,progbar, %myvar%*9/10 ;<--- NOT near bar's end :/
pause
can replace the %myvar% in the 6th and 7th lines with absolute values (15 and 27) and this won't make any difference
btw using any value grater than 100 for myvar gives a even worst result
seems like the bar range is always being set as the default, 0-100 :/ MYVAR not being considered by the runtime
I appreciate any help
Re: progress RANGE not working Topic is solved
RangeN-N is a options
https://www.autohotkey.com/docs/commands/GuiControl.htm#options
Calculation should be an expression
https://www.autohotkey.com/docs/Language.htm#expressions-vs-legacy-syntax
https://www.autohotkey.com/docs/commands/GuiControl.htm#options
Code: Select all
GuiControl +Range0-%myvar%, Progbar
https://www.autohotkey.com/docs/Language.htm#expressions-vs-legacy-syntax
Code: Select all
GuiControl,, Progbar, % myvar/2
GuiControl,, Progbar, % myvar*9/10
Re: progress RANGE not working
Thanks. Problem is that even using absolute numbers, progress ("+1" for instance) of this control is always a "percent" progress. So, why there'd have a range option?
For example, say:
Gui Add, Progress, w50 h20 cBlue backgroundyellow vProgbar ;<--- width = 50 pixels
GuiControl ,,progbar, range1-50 ;<--- every bar pixel should be a "unit" for the progress in such range "1-50"
Gui show
GuiControl ,,progbar, +50 ;<--- does not progress to the END of the bar but to its middle :/
So it seems progress ("+") is always a "%" of the bar despite its range... if so, why there'd have such option "range"?
Re: progress RANGE not working
I've found that the example based on variables I've used for my previous example actually doesn't matter for the essence of the problem. The problem remains even if using absolute numbers in the range option. For instance:
Gui Add, Progress, w50 h20 cBlue backgroundyellow vProgbar ;<--- bar width = 50 pixels
GuiControl ,,progbar, range1-50 ;<--- in this case, each bar PIXEL should be a bar "unit" of its progress
Gui show
GuiControl ,,progbar, 50 ;<--- does not progress to the END of the bar, but to its middle ?!? :/
GuiControl ,,progbar, 1
GuiControl ,,progbar, +25 ;<--- also does not progress to the bar's MIDDLE (since its range is 1-50) but to "a quarter" of the range
It seems indeed the number (or variable content) we pass to the positioning is never according to the range but is always a "percent" of the range...
so my question remains: why there has a range option for this control since we always have to use relative positioning ("%" of bar length), never can use absolute numbers for the positioning? :/
other: let's say you have 1000 lines of a text file to read into a var. If we set the range option to "0-1000"... we CAN'T use "+1" for progress of each line that was red. Because the value is "relative" to the bar range, not absolute in its range. We'd have to use a formula :/ to the progress value (in this example, it could be: #linesred/1000). Because "+1" in this example would mean TEN lines red (+1"%" of 1000) - not one line...
So, again, why there'd have an option for "ranges" since the value for the positioning seems is always "relative"/"%" to the bar lenght despite its range that was set..? :/
Gui Add, Progress, w50 h20 cBlue backgroundyellow vProgbar ;<--- bar width = 50 pixels
GuiControl ,,progbar, range1-50 ;<--- in this case, each bar PIXEL should be a bar "unit" of its progress
Gui show
GuiControl ,,progbar, 50 ;<--- does not progress to the END of the bar, but to its middle ?!? :/
GuiControl ,,progbar, 1
GuiControl ,,progbar, +25 ;<--- also does not progress to the bar's MIDDLE (since its range is 1-50) but to "a quarter" of the range
It seems indeed the number (or variable content) we pass to the positioning is never according to the range but is always a "percent" of the range...
so my question remains: why there has a range option for this control since we always have to use relative positioning ("%" of bar length), never can use absolute numbers for the positioning? :/
other: let's say you have 1000 lines of a text file to read into a var. If we set the range option to "0-1000"... we CAN'T use "+1" for progress of each line that was red. Because the value is "relative" to the bar range, not absolute in its range. We'd have to use a formula :/ to the progress value (in this example, it could be: #linesred/1000). Because "+1" in this example would mean TEN lines red (+1"%" of 1000) - not one line...
So, again, why there'd have an option for "ranges" since the value for the positioning seems is always "relative"/"%" to the bar lenght despite its range that was set..? :/
Re: progress RANGE not working
You’re wrong about it always being 1-100. Your GuiControl statement to set the range is not correct. You didn’t put stuff in the right parameters and didn’t use a + like neovis showed you, so you didn’t change the range.
Re: progress RANGE not working
Hi Boiler, indeed I had missed the "+" before the Range option.
However the help didn't even mention this "+" in the sintaxe...:
And then I tried adding this "+" before the Range keyword but result is the same:
Gui Add, Progress, w50 h20 cBlue backgroundyellow vProgbar ;<--- bar width = 50 pixels
GuiControl ,,progbar, +range1-50 ;<--- in this case each bar PIXEL should be the "unit" of such range
Gui show
GuiControl ,,progbar, 50 ;<--- does not progress to the END of the bar, but to its middle :/
(yet about the "stuff" I'd have not put in the "right" parameters, I didn't get what it would mean)
Re: progress RANGE not working
I pointed you to neovis' example. It looks like you didn't even try to compare them.
neovis' example:
Code: Select all
GuiControl +Range0-%myvar%, Progbar
Code: Select all
GuiControl ,,progbar, +range1-50