AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Slider tooltip bug when Invert is used (Gui)

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Lemming



Joined: 20 Dec 2005
Posts: 150
Location: Malaysia

PostPosted: Tue Jul 03, 2007 9:13 am    Post subject: Slider tooltip bug when Invert is used (Gui) Reply with quote

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
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue Jul 03, 2007 10:01 am    Post subject: Reply with quote

It is documented:
AHK's Manual wrote:
Invert: Reverses the control so that the lower value is considered to be on the right/bottom rather than the left/top. This is typically used to make a vertical slider move in the direction of a traditional volume control. Note: The ToolTip option described below will not obey the inversion and therefore should not be used in this case.
So I suppose it is a limitation of Windows itself.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10463

PostPosted: Thu Jul 05, 2007 10:27 pm    Post subject: Reply with quote

Yes, I seem to remember it's an OS limitation. In any case, there was definitely something substantial that blocked an easy solution.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group