AutoHotkey Community

It is currently May 27th, 2012, 10:20 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: July 3rd, 2007, 9:13 am 
Offline

Joined: December 20th, 2005, 4:15 am
Posts: 165
Location: Malaysia
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

[Moved from Bug Reports forum. ~jaco0646]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2007, 10:01 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 5th, 2007, 10:27 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Yes, I seem to remember it's an OS limitation. In any case, there was definitely something substantial that blocked an easy solution.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2010, 4:53 pm 
Offline

Joined: January 13th, 2008, 6:00 pm
Posts: 115
Has anybody found a workaround for this?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2010, 5:13 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
You could provide your own tooltip manually by putting a g-label onto the slider.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, robotkoer and 69 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group