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
HotKeyIt



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

PostPosted: Sun Jun 07, 2009 7:31 pm    Post subject: Reply with quote

At the bottom of ToolTip() post you will find alternative function that requires RemoteBuf.ahk which can be found here: [module] RemoteBuffer 2.0.
Using this function you can show ToolTip at TrayIcon coordinates of your app.
For example:
Code:
ToolTip(1,"text","title","C1 O1 xTrayIcon yTrayIcon")

_________________
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 Jun 09, 2009 5:40 pm    Post subject: Reply with quote

Fix wrote:
- Fixed to display ToolTip correct when icon in tray is hidden
- Fixed Q option so now enabling usual ToolTip will work and colored ToolTips in Vista are possible (did nobody try it Question Confused)

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



Joined: 27 Oct 2006
Posts: 648

PostPosted: Sun Jun 14, 2009 5:09 am    Post subject: Reply with quote

I would like to have a ToolTip which can also

- change the font size
- support physical effects (gravitation, swinging), especially e.g. to show visually which file/song was deleted or moved into a given directory
- auto-fade out


In short having some kind of ToolTip which does not distract the user but should look bigger and cooler. I am not sure if anything similar exists already?
Back to top
View user's profile Send private message
HotKeyIt



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

PostPosted: Sun Jun 14, 2009 6:07 am    Post subject: Reply with quote

automaticman wrote:
I would like to have a ToolTip which can also

- change the font size
- support physical effects (gravitation, swinging), especially e.g. to show visually which file/song was deleted or moved into a given directory
- auto-fade out


In short having some kind of ToolTip which does not distract the user but should look bigger and cooler. I am not sure if anything similar exists already?


I have no idea how to change the size of font and font itself, if I find anything I will try to transcribe.
You can use E option to make it bigger.
All we have is Animatewindow
Fade out is done when you call:
Code:
ToolTip(1,"","","GTTM_POP")

_________________
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: Sat Jun 20, 2009 3:26 pm    Post subject: Reply with quote

Option J wrote:
Specify J1 to center the ToolTip on a control

Code:
Gui,Add,Button,,Button1
ToolTip(1,"A centered ToolTip","","J1 P1 AButton1")
Gui,Add,Button,,Button2
ToolTip(2,"A centered BalloonTip","Balloon","J1 O1 P1 AButton2")
Gui, Show
Return
GuiClose:
ToolTip()
ExitApp


Option XTrayIcon + YTrayIcon wrote:
RemoteBuf is now optional.
This means if you got it, the coordinates of TrayIcon will be found else not and controlpos will be used.


ToolTipClick wrote:
When option L1 is not used so your ToolTip has no Links you can still perform an action when your ToolTip is clicked or closed


Code:
OnMessage(0x201,"WM_LBUTTONDOWN") ;Will make ToolTip Click possible
WM_LBUTTONDOWN(wParam,lParam,msg,hWnd){
   If tt%hwnd% {
      MsgBox, 262148,ToolTip Clicked, Close ToolTip
      IfMsgBox Yes
         ToolTip(tt%hwnd%)
   }
}
OnMessage(0x4e,"WM_NOTIFY") ;Will make LinkClick and ToolTipClose possible
WM_NOTIFY(wParam, lParam, msg, hWnd){
   ToolTip("",lParam,"")
}
Sleep, 10
ToolTip(1,"<a>Click</a>`n<a>Onother one</a>`n"
. "<a This link is different`nit uses different text>Different</a>`n"
. "<a>ExitApp</a>","ClickMe","L1 P99 C1")
hwnd:=ToolTip(2,"Click me anywhere!","Click Me","P99 xTrayIcon yTrayIcon C1")
tt%hwnd%:= 1
Return

ToolTip:
link:=ErrorLevel
SetTimer, MsgBox, -10
Return

1ToolTipClose:
ExitApp

MsgBox:
If Link=ExitApp
   ExitApp
MsgBox % Link
Return

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





PostPosted: Wed Jul 01, 2009 12:55 pm    Post subject: Help with tooltip Reply with quote

I was trying to get diferent text tip depending on listview row behind the cursor.

I have a funtion that gets the info of the row, and can change de text of the tip, but I would like how to make the function was launched automatically as the tooltip() function.

Is there any option in tooltip() to make this (call a function that can change the content of the tip, just before it is showed)?

Thanks.
Back to top
HotKeyIt



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

PostPosted: Thu Jul 02, 2009 8:12 pm    Post subject: Re: Help with tooltip Reply with quote

New Feature - Dynamic Text wrote:

You can change ToolTip text, title, color and much more before a ToolTip is shown now.
Usage is simmilar to LinkClick but instead launching a function,
ToolTip("",lParam) returns your control id.
ErrorLevel contains toolId that you need to specify using A option.
For example:
Code:
...
WM_NOTIFY(wParam,lParam){
 If (control:=ToolTip("",lparam)){
     ToolTip(control,"newtext","","G1 A" . ErrorLevel)
...


Here are 2 examples that I used for testing.
This one is included in function help:
Code:

OnMessage(0x4e,"WM_NOTIFY")
Gui,Add,Button,,Time
Gui,Add,Button,,Username
Gui,Add,Button,,User is Admin?
Gui,Add,Button,,IP addresses
Loop 4
   ToolTip("Button1"," ","","p1 aButton" . A_Index)
gui,show
Return

WM_NOTIFY(wParam,lParam){
   If (control:=ToolTip("",lparam)){
      Tool:=ErrorLevel
      MouseGetPos,,,,ClassNN
      If (ClassNN="Button1"){
         FormatTime,text,%A_Now%,HH:mm:ss
         Title:="Time"
      } else if (ClassNN="Button2"){
         text:=A_UserName,title:="UserName"
      } else if (ClassNN="Button3"){
         text:=(A_ISAdmin ? "Yes" : "No"),title:="User is Admin?"
      } else if (ClassNN="Button4"){
         text:= "1: " A_IPAddress1 "`n2: " A_IPAddress2 "`n3: " A_IPAddress3 "`n4: " A_IPAddress4
         title:="IP Addresses"
      }
      ToolTip(control,text,title,"G1 A" . Tool . " I" (InStr("Button1Button2",ClassNN) ? "2" : "1"))
   }
}

GuiClose:
ExitApp


@ segalion, thanks for your request, this might help you, enjoy Wink
Code:
OnMessage(0x4e,"WM_NOTIFY")
Gui,Add,ListView,r20 AltSubmit Checked gFocus hwndLVhWnd vListView,Test
Gui,+LastFound
hwnd:=WinExist()
ToolTip("ListView","default","","P1 aSysListView321")
Loop 20
   LV_Add("",A_Index)
gui,show
Return

WM_NOTIFY(wParam,lParam){
   global
   If (control:=ToolTip("",lparam)){
      Tool:=ErrorLevel
      If (control="ListView" and row>0){
         LV_GetText(text,row,1)
         ToolTip(control,"Row Text: " text,action,"G1 A" . Tool)
      } else
         ToolTip(control,"check or select an item`nthen move mouse away and back to list","","G1 A" . Tool)
   }
}

Focus:
   If InStr(ErrorLevel,"F",1){
      row:=A_EventInfo
      action:="Focused"
   } else If InStr(ErrorLevel,"C",1){
      row:=A_EventInfo
      action:="Checked"
   }
SetTimer,PostMessage,-10
Return

PostMessage:
KeyWait,LButton
PostMessage,0x200,1,,,ahk_id %hwnd%
MouseGetPos,x,y
MouseMove,% x+1,% y
Return

GuiClose:
ExitApp

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





PostPosted: Fri Jul 03, 2009 12:06 pm    Post subject: Reply with quote

Thanks a lot HotKeyIt.

I have reached that with WM_NOTIFY(wParam,lParam)
Inside I make things to discover options about content list behind listbox, and then call ToolTip("MyList", Tip, "G1")

But the problem now is that havent the correct working tooltip. I was searching somethig like explorer tooltip over files (it show you information if you stop the mouse over the files), but you dont need to get outside listbox to get info of other file row.

Thanks for this great function...
Back to top
HotKeyIt



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

PostPosted: Fri Jul 03, 2009 12:26 pm    Post subject: Reply with quote

I found this great example made by PhiLho, you do not need ToolTip() function to use it, check it out.
http://www.autohotkey.com/forum/viewtopic.php?t=17349
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
segalion
Guest





PostPosted: Fri Jul 03, 2009 12:48 pm    Post subject: Reply with quote

HotKeyIt wrote:
I found this great example made by PhiLho, you do not need ToolTip() function to use it, check it out.
http://www.autohotkey.com/forum/viewtopic.php?t=17349



Thanks thanks a lot...
Seems tha this was exactly was I trying...
Back to top
automaticman



Joined: 27 Oct 2006
Posts: 648

PostPosted: Tue Aug 25, 2009 4:55 pm    Post subject: Reply with quote

automaticman wrote:
In short having some kind of ToolTip which does not distract the user but should look bigger and cooler. I am not sure if anything similar exists already?
Snarl seems to be just that. http://www.fullphat.net
Back to top
View user's profile Send private message
HotKeyIt



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

PostPosted: Tue Aug 25, 2009 6:30 pm    Post subject: Reply with quote

This program does not use ToolTips.

As far as I understand it is using GDI to draw that windows.

automaticman wrote:
In short having some kind of ToolTip which does not distract the user but should look bigger and cooler. I am not sure if anything similar exists already?


Does ToolTip distract the user Confused
I think it was created to not distract the user Exclamation

You can change the color of it and you can use WinSet, Transparent...

You can do something like USB Detection
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
ballyhairs



Joined: 02 Feb 2009
Posts: 112

PostPosted: Tue Aug 25, 2009 8:37 pm    Post subject: Reply with quote

First thanks alot for this..
3 things:
I looked into the script code but couldn't find out the following:

-Why can't I get it to be transparent when using D (Delay)?
-How can I not have the arrow at the corner of the tooltip?
-How can I change the font and font size?

Code:
{
ToolTip(99,"Drive D Is Mounted:`n`n"
      . "`n`n"
      , "TrueCrypt"
      , "D5 Q1 O1 T180 E0.0.100.50 BWhite FBlack I" . GetAssociatedIcon("C:\Program Files\TrueCrypt\TrueCrypt.exe")
      . " P99 X" 1590 . " Y" . 1196)
Return
}
Back to top
View user's profile Send private message
HotKeyIt



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

PostPosted: Tue Aug 25, 2009 9:21 pm    Post subject: Reply with quote

ballyhairs wrote:

I looked into the script code but couldn't find out the following:

-Why can't I get it to be transparent when using D (Delay)?


Because there is no way to make it acceptable as it flickers:
Code:
Sleep, 100
hwnd:=ToolTip(1,"test","","e60.60.60.60")
Loop
{
   ToolTip(1,"","","GTTM_TRACKPOSITION.TTMTRACKACTIVATE")
   WinSet,Transparent,100,ahk_id %hwnd%
}

Escape::ExitApp


ballyhairs wrote:

-How can I not have the arrow at the corner of the tooltip?


You can have a square ToolTip (remove o1) or BallonTip (use o1). http://msdn.microsoft.com/en-us/library/bb760248.aspx

ballyhairs wrote:

-How can I change the font and font size?


As far as I understand this is not possible Sad
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
ballyhairs



Joined: 02 Feb 2009
Posts: 112

PostPosted: Tue Aug 25, 2009 9:53 pm    Post subject: Reply with quote

Thanks for the reply.. Now one question my friend..
How do I get special color code, this was your example
Quote:
- this can be 0x00FF00 or 00FF00 or Blue, Lime, Black, White...


I use Colorpix.exe to pick a color on the screen and get its code, but its different, for example, if Colorpix.exe points at a color as RGB 237.237.237, now how do I translate that to your script?
Back to top
View user's profile Send private message
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 5 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