Jump to content


Photo

Ahk_L - Tooltip - Suggested features.


  • Please log in to reply
4 replies to this topic

Poll: Which of the suggestions (outlined below) would be useful and should be added to Ahk_L. (4 member(s) have cast votes)

Which of the suggestions (outlined below) would be useful and should be added to Ahk_L.

  1. Suggestion 1: Auto close Tooltip (1 votes [25.00%])

    Percentage of vote: 25.00%

  2. Suggestion 2: Moving Tooltips (Follows Mouse) (0 votes [0.00%])

    Percentage of vote: 0.00%

  3. All of the Above :) (3 votes [75.00%])

    Percentage of vote: 75.00%

Vote Guests cannot vote

#1 Cephei1

Cephei1
  • Members
  • 388 posts

Posted 25 January 2012 - 05:11 PM

Hi

I would like to suggest a two additional features for Tooltip in Ahk_L.

1. Auto close Tooltip.As you know, at the moment in Ahk_L (and Ahk Basic), the way to close a Tooltip after a specific time is through using SetTimer to go to a Label which contains something like...
ToolTip, This will close in 3 seconds
[color=red]SetTimer, LABELNAME, 3000[/color]
Return

[color=red]LABELNAME:
SetTimer, LABELNAME, Off
ToolTip
Return[/color]
I would like to suggest a time option. So something like...
ToolTip [, Text, X, Y, WhichToolTip, [color=red]CloseAfter[/color]]
"CloseAfter" Options
...... Time in mili-seconds (ms)
2. Moving Tooltips (Personally, I find them more helpful)When a Tooltip appears, it's usually static. I prefer them to follow the Mouse where ever it goes. This is more effective and helpful (personally). Therefore I would like to suggest something like...

Instead of "X, Y" marked in Green:
ToolTip [, Text,[color=green] X, Y, [/color]WhichToolTip, [color=red]CloseAfter[/color]]
Have instead a "Behaviourc" option, marked in Green:
ToolTip [, Text,[color=green] Behaviour[/color], WhichToolTip, [color=red]CloseAfter[/color]]
"Behaviour" Option (Specify one of the following):
Option 1 ... Xn Yn
...... X = X-Axis position,
...... Y = Y-Axis position,
...... n = Actual Coordinates of X/Y Axis respectively.

Option 2 ... FollowMouse
...... Follows the Mouse.

Option 3 ... Static
...... Displays Tooltip at the current Mouse coordinates.

Please comment AND vote on these suggestions :)
Thanks in advance.

#2 Guests

  • Guests

Posted 25 January 2012 - 05:48 PM

1. Auto close Tooltip.

+1.

2. Moving Tooltips (Personally, I find them more helpful)

:? This is not so common. I think it should be left to users.

#3 Cephei1

Cephei1
  • Members
  • 388 posts

Posted 25 January 2012 - 07:22 PM

At the moment, I use this function which I created. It performs both of the Suggestions. Place this at the beginning of the script:
CoordMode, Mouse, Screen
SetWinDelay, -1
TTN=1 ; Tooltip number used for "WhichToolTip" part of a Tooltip
Then this at the end:
TTD(Data="",Time="") {
	Global
	If ! Data ; Close Tooltip if no paramaters passed to the function
	{
		SetTimer, TT_DisplayOff, 1
		Return
	}
	ToolTip, %Data%,,,%TTN% ; TTN = Tooltip Number, I set this at the Start of script.
	WinGet, TT_HWND, ID, ahk_class tooltips_class32 ; get Tooltip HWND
	SetTimer, TT_DisplayOn, 10 ; Moves Tooltip to follow mouse
	If Time > 0 ; Sets the Auto Close timer for Tooltip if Time is specified, else displays indefinately.
		SetTimer, TT_DisplayOff, %Time%
}

TT_DisplayOff:
SetTimer, TT_DisplayOff, Off
SetTimer, TT_DisplayOn, Off
Time:= "", Data:= "", TT_HWND:= "", X:="", Y:=""
ToolTip,,,,%TTN%
Return

TT_DisplayOn:
MouseGetPos,X,Y
WinMove, ahk_id %TT_HWND%,,% x+17,% y+18
Return


Then this to create a Moving, self-closing tooltip:
TTD("This tooltip is moving and will close in 5 seconds","5000")
And if you want to close it manually (if you didn't enter a time and it is displayed indefinately):
TTD()


#4 Learning one

Learning one
  • Members
  • 1295 posts

Posted 25 January 2012 - 09:09 PM

Moving Tooltip - FollowMouse :wink:

#5 Cephei1

Cephei1
  • Members
  • 388 posts

Posted 26 January 2012 - 07:48 AM

@Learning One

Thank you :) That's another way you could do it. My function above does not flicker the Tooltip either :) Only once - when it is updated.