Lemming
Joined: 20 Dec 2005 Posts: 150 Location: Malaysia
|
Posted: Tue Jul 03, 2007 9:13 am Post subject: Slider tooltip bug when Invert is used (Gui) |
|
|
If you choose the "Invert" option for a Slider and also enable the ToolTip option, the tooltip continues to display non-invert values.
E.g. if your slider is from 100-0, the tooltip will still display values from 0-100. So if you click on 0 it displays 100, click on 10 it displays 90, and so on. This may create confusion and errors for users.
Here's some gutted code from an app I'm working on. The tooltip for the slider on the left works correctly, the one on the right does not. The text boxes display the correct values for both sliders:
| Code: | DefaultCropL = 0
DefaultCropR = 0
Gui, Add, Button, x95 y93 w50 h28 gConvert , Convert
Gui, Add, Button, x160 y93 w50 h28 gCancel , Cancel
; The Crop sliders
Gui, Add, Text, x21 y145 w65 h28 , Crop (left)
Gui, Add, Text, x90 y145 w35 h22 vLcropText 0x1000 0x200 Center
, %DefaultCropL%
; 0x1000 Draws a half-sunken border around a static control.
; 0x200 centers text vertically
Gui, Add, Slider, x13 y170 w80 Tooltip Range0-80 gLeftSlidePosi vCropChoiceL
, %DefaultCropL%
;
Gui, Add, Text, x351 y145 w80 h28 , Crop (right)
Gui, Add, Text, x300 y145 w35 h22 vRcropText 0x1000 0x200 Center
, %DefaultCropR%
Gui, Add, Slider, x359 y170 w80 Tooltip Invert Range0-80 gRightSlidePosi vCropChoiceR
, %DefaultCropR%
;Invert: Reverses the control so that the lower value is considered to be on the right rather than the left.
;
Gui, Show, h500 w450, Pict Saver
Return
Convert:
Gui, Submit, NoHide ; Save the input from the user to each control's associated variable.
; other useful code
ExitApp
; auto-update of text boxes next to sliders
LeftSlidePosi:
GuiControl, , LcropText , %CropChoiceL%
Return
RightSlidePosi:
GuiControl, , RcropText , %CropChoiceR%
Return
Refresh:
; other useful code
ExitApp
Cancel:
GuiClose:
ExitApp |
Bug appears in latest AHK ver 1.0.47, and in 1.0.46.17. I did not test other versions.
-Lemming |
|