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 

ToolTip() - Advanced ToolTip features + Unicode
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  

Do you think AutoHotkey should have that features/function internally?
Yes
33%
 33%  [ 4 ]
Yes, even more ToolTip features please
33%
 33%  [ 4 ]
No, I don't need them
0%
 0%  [ 0 ]
No, to complex to use
25%
 25%  [ 3 ]
No
8%
 8%  [ 1 ]
Total Votes : 12

Author Message
Drugwash



Joined: 07 Sep 2008
Posts: 921
Location: Ploiesti, RO

PostPosted: Tue May 05, 2009 9:33 pm    Post subject: Reply with quote

I thought I could turn all tooltips into balloons sistem-wide but that wouldn't enlarge maximum text size anyway, neither would it offer any other advantages without applications' support, so better forget that idea. Smile

In the example, the coordinates are read relative to the screen but tooltip processes them relative to the window so there's a discrepancy (at least that's what I recall from the test before I posted).

Thanks for considering my reports.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Sun May 10, 2009 8:04 pm    Post subject: Reply with quote

New Options, Many Thanks to Superfraggle for Add ToolTips to controls.

Quote:
phwnd - Parent window hwnd (necessary for addtool below)
ahwnd - ControlId to show ToolTip for, can be class=(Static1,Edit1), can be empty=(If P="" show for parent window only)


Example script: See top post.
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink


Last edited by HotKeyIt on Wed May 13, 2009 6:04 am; edited 2 times in total
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Mon May 11, 2009 10:23 pm    Post subject: Reply with quote

Looks useful. Thanks for sharing. Cool
Back to top
View user's profile Send private message Send e-mail
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Mon May 11, 2009 11:28 pm    Post subject: Reply with quote

Question: What is the purpose of the following code in your example:
Code:
OnMessage(0x4E,"test")

Just curious...

Edit: Also, I can't figure out what the _tool_tip_id_ parameter is used other than if it is blank or zero, all tooltip windows are deleted. In your example, I changed the value of _tool_tip_id_ parameter for all the examples to an arbitrary number (42) and it worked the same as before. Once again, just curious.
Back to top
View user's profile Send private message Send e-mail
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Tue May 12, 2009 6:23 am    Post subject: Reply with quote

Thanks jballi, I've removed OnMessage, this was not necessary.

_tool_tip_id_ is used for ToolTip number, it is stored in static variable like an array:
Code:
_tt_hwnd_list_.= "|" . _tool_tip_id_ . "." . hWnd . "|"

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Tue May 12, 2009 10:25 pm    Post subject: Reply with quote

A few bug fixes:

- Reset control works now. (Set new text and Title and Icon and ...)
- ToolTip displayed better and faster.
- All in one function now ToolTip(), using sub routines.
- Delay option works for ToolTip assosiated with GUI or Control as well.

Enjoy Wink
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink


Last edited by HotKeyIt on Wed May 13, 2009 6:04 am; edited 2 times in total
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Tue May 12, 2009 11:15 pm    Post subject: Reply with quote

HotKeyIt wrote:
A few bug fixes:

Nice changes. I just started playing with it but I had couple of comments...

1) Your example kills all Tooltips too quickly (3 seconds) after the GUI is displayed. It makes it look like your example works for a couple of tooltips and then stops working entirely. You might add a warning dialog (OK) or attach the "Clear All ToolTips" action to one of the buttons (better). Just a thought...

2) You might want to put your example in the first post. That way folks don't have to search through the thread for a latest example. Just a thought...

3) Whatever code you put in to make "ToolTip displayed better and faster" makes the balloon tooltips appear jumpy if moving the cursor from one balloon tooltip to another balloon tooltip. This is not a big deal for me since I don't plan to use many balloon tooltips but I thought I would point it out.

Addendum:
4) The "Click to Change" example doesn't work (at least for me). A new tooltip appears briefly but then when the cursor is moved away and then back, no tooltip is displayed for the two "ToolTip 1" buttons.

Keep up the good work! Smile
Back to top
View user's profile Send private message Send e-mail
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed May 13, 2009 6:06 am    Post subject: Reply with quote

jballi wrote:
HotKeyIt wrote:
A few bug fixes:

Nice changes. I just started playing with it but I had couple of comments...

1) Your example kills all Tooltips too quickly (3 seconds) after the GUI is displayed. It makes it look like your example works for a couple of tooltips and then stops working entirely. You might add a warning dialog (OK) or attach the "Clear All ToolTips" action to one of the buttons (better). Just a thought...

2) You might want to put your example in the first post. That way folks don't have to search through the thread for a latest example. Just a thought...

3) Whatever code you put in to make "ToolTip displayed better and faster" makes the balloon tooltips appear jumpy if moving the cursor from one balloon tooltip to another balloon tooltip. This is not a big deal for me since I don't plan to use many balloon tooltips but I thought I would point it out.

Addendum:
4) The "Click to Change" example doesn't work (at least for me). A new tooltip appears briefly but then when the cursor is moved away and then back, no tooltip is displayed for the two "ToolTip 1" buttons.

Keep up the good work! Smile


1 removed
2 gone
3 je I know, will check if possible to fix, looks like it is being redrawn.
4 should work now

Thank you Wink
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink


Last edited by HotKeyIt on Wed May 13, 2009 9:21 am; edited 1 time in total
Back to top
View user's profile Send private message
ruespe



Joined: 17 Jun 2008
Posts: 243

PostPosted: Wed May 13, 2009 7:04 am    Post subject: Reply with quote

Nice job. Razz
Das kann ich gut gebrauchen. Danke dafür.
_________________
Greetings
Rog
Back to top
View user's profile Send private message
Drugwash



Joined: 07 Sep 2008
Posts: 921
Location: Ploiesti, RO

PostPosted: Wed May 13, 2009 2:36 pm    Post subject: Reply with quote

Observations on the latest version:
- the timeout popup flickers like mad (happened in previous version too)
- the GUI tooltip appears even when hovering titlebar or min/max/close buttons (happened in previous version too)
- tooltip for button ToolTip1 (after change - the blue one) remains on screen until clicking the button again and then won't show up anymore
- inconsistent spelling throughout the script; correct is balloon and associated. Embarassed
- close button won't show up in tooltips (Win9x issue, reported only for whoever wonders if it works)

Everything else works fine. Thanks for the continuous improvements. Cool
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
ruespe nli
Guest





PostPosted: Wed May 13, 2009 3:57 pm    Post subject: Reply with quote

It seems, as If X and Y don't work any more. When I include them, no tooltip is shown. When I delete them, ToolTip is shown near mousepointer.
Back to top
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed May 13, 2009 5:27 pm    Post subject: Reply with quote

Drugwash wrote:
Observations on the latest version:
1 the timeout popup flickers like mad (happened in previous version too)
2 the GUI tooltip appears even when hovering titlebar or min/max/close buttons (happened in previous version too)
3 tooltip for button ToolTip1 (after change - the blue one) remains on screen until clicking the button again and then won't show up anymore
4 inconsistent spelling throughout the script; correct is balloon and associated. Embarassed
5 close button won't show up in tooltips (Win9x issue, reported only for whoever wonders if it works)

Everything else works fine. Thanks for the continuous improvements. Cool

Many thanks for testing and feedback
1. Can you try again, hope it is better now
2. Not sure how to get rid of that.
- Possibly it is better to associate the ToolTip to a GroupBox!?!
3. should work now
4. Embarassed
5. Thank you, I will add to top post.

ruespe nli wrote:
Posted: Wed May 13, 2009 5:57 pm Post subject:
It seems, as If X and Y don't work any more. When I include them, no tooltip is shown. When I delete them, ToolTip is shown near mousepointer.

Should work now Wink
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed May 13, 2009 7:03 pm    Post subject: Reply with quote

New functions, see top post Wink
Code:
hIcon:= GetAssociatedIcon(A_AhkPath)
ToolTip(1,"Test","AutoHotkey","I" . hIcon)

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Drugwash



Joined: 07 Sep 2008
Posts: 921
Location: Ploiesti, RO

PostPosted: Wed May 13, 2009 7:36 pm    Post subject: Reply with quote

Flickering still not fixed, but the rest looks good. Smile

Incidentally, few days ago I stumbled into an interesting couple of functions that I needed for one of my toys - hopefully you find them useful:
Code:
; http://msdn.microsoft.com/en-us/library/bb776414(VS.85).aspx
; shell32.dll
; Extracts the associated icon's index for the file specified in path
; Requires path and icon index
; Icon must be destroyed when no longer needed (see below)

ExtractAssociatedIcon(ByRef ipath, ByRef idx)
{
hInst=0   ; reserved, must be zero
hIcon := DllCall("ExtractAssociatedIcon", "UInt", hInst, "UInt", &ipath, "UShortP", idx)
return ErrorLevel
}

; http://msdn.microsoft.com/en-us/library/bb776415(VS.85).aspx
; shell32.dll
; Extracts the associated icon's index and ID for the file specified in path
; Requires path, icon index and ID
; Icon must be destroyed when no longer needed (see below)

ExtractAssociatedIconEx(ByRef ipath, ByRef idx, ByRef iID)
{
hInst=0   ; reserved, must be zero
hIcon := DllCall("ExtractAssociatedIconEx", "UInt", hInst, "UInt", &ipath, "UShortP", idx, "UShortP", iID)
return ErrorLevel
}

DestroyIcon(hIcon)
{
DllCall("DestroyIcon", UInt, hIcon)
}
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
hoppfrosch



Joined: 25 Jan 2006
Posts: 190
Location: Froschtümpel

PostPosted: Thu May 14, 2009 6:09 am    Post subject: [REQ] Example: Tooltip hovering over TrayBar Reply with quote

Could you please give an example to add a tooltip to the traybar?

I already tried the following, but didn't succeed
Code:
ControlGet, Tray_hWnd, hWnd,, TrayNotifyWnd1  , ahk_class Shell_TrayWnd
ToolTip(6,"This is a ToolTip with Title and close button","Welcome","C1 D5 P" . Tray_hWnd)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Page 2 of 8

 
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