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 

Colour ToolTip's.... Lil help... Please

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
D4BST3R



Joined: 04 Aug 2008
Posts: 65
Location: UK: Crawley

PostPosted: Tue Aug 12, 2008 5:44 pm    Post subject: Colour ToolTip's.... Lil help... Please Reply with quote

Hey I Use Control + Scroll Up/Down To Change The Volume...

This Is The Code For It:
Code:
^WheelUp::
SoundSetWaveVolume, +5
SoundGetWaveVolume, CurrentVolI
SetFormat float, 0.0
CurrentVolI+=0
ToolTip, Volume: %CurrentVolI% Percent
SetTimer, RemoveVolume2, 2000
Return
RemoveVolume2:
SetTimer, RemoveVolume2, Off
ToolTip
Return


^WheelDown::
SoundSetWaveVolume, -5
SoundGetWaveVolume, CurrentVolII
SetFormat float, 0.0
CurrentVolII+=0
ToolTip, Volume: %CurrentVolII% Percent
SetTimer, RemoveVolume2, 2000
Return
RemoveVolume2:
SetTimer, RemoveVolume2, Off
ToolTip
Return


Once The Volume Is Changed A Tooltip Comes Up For 2 Seconds Saying The New Set Volume...

How Do I Change The Colours Of The Tooltip?

I Looked Up The Colour Tool Tip Post But Didn't Quiet Understand It... Lil Help?

If You Do Reply To This And Know The Solution To This Can You Please Re-write The Whole Script And Paste The Code, As I Will Not Be Able To Work Out Where To Put The Code That You Will Enter...

Here's The Code For Tooltip Colours I Got From This Post:

Code:
sTooltip("Tooltip with custom Colors",5,0xffff00,0x00ff00)


sTooltip(sTooltipTxt,seconds=5,bg=0xFFFFE7,fg=0x0,x=-1,y=-1) {
   ; (w) derRaphael / zLib Style released / v 0.3
   if (Seconds+0=0)
      Seconds = 5
   StartTime := EndTime := A_Now
   EnvAdd,EndTime,Seconds,Seconds
   
   fg := ((fg&255)<<16)+(((fg>>8)&255)<<8)+(fg>>16) ; rgb -> bgr
   bg := ((bg&255)<<16)+(((bg>>8)&255)<<8)+(bg>>16) ; rgb -> bgr
   
   tooltip,% (ttID:="TooltipColor " A_TickCount)
   tThWnd1:=WinExist(ttID ahk_class tooltips_class32)
   ; remove border
   ; WinSet,Style,-0x800000,ahk_id %tThWnd1%
   SendMessage, 0x413, bg,0,, ahk_id %tThWnd1%   ; 0x413 is TTM_SETTIPBKCOLOR
   SendMessage, 0x414, fg,0,, ahk_id %tThWnd1%   ; 0x414 is TTM_SETTIPTEXTCOLOR
   ; according to http://msdn.microsoft.com/en-us/library/bb760411(VS.85).aspx
   ; there is no limitation on vista for this.
   Loop,
   {
      if (EndTime=A_Now)
         Break
      else
         if (x<0) || (y<0)
            ToolTip, %sTooltipTxt%
         else
            ToolTip, %sTooltipTxt%, %x%, %y%
      sleep, 50
   }
   ToolTip
}


URL: http://www.autohotkey.com/forum/viewtopic.php?t=34490

Thanks Man!

Please Help...

Thanks Everyone
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Tue Aug 12, 2008 6:16 pm    Post subject: Reply with quote

Code:
^WheelUp::
SoundSetWaveVolume, +5
SoundGetWaveVolume, CurrentVolI
SetFormat float, 0.0
CurrentVolI+=0
tooltiptext = Volume: %CurrentVolI% Percent
sTooltip(tooltiptext,5,0xff8000)
Return

sTooltip(sTooltipTxt,seconds=5,bg=0xFFFFE7,fg=0x0,x=-1,y=-1) {
   ; (w) derRaphael / zLib Style released
   if (Seconds+0=0)
      Seconds = 5
   StartTime := EndTime := A_Now
   EnvAdd,EndTime,Seconds,Seconds
   
   fg := ((fg&255)<<16)+(((fg>>8)&255)<<8)+(fg>>16) ; rgb -> bgr
   bg := ((bg&255)<<16)+(((bg>>8)&255)<<8)+(bg>>16) ; rgb -> bgr
   
   tooltip,% (ttID:="TooltipColor " A_TickCount)
   tThWnd1:=WinExist(ttID ahk_class tooltips_class32)
   ; remove border
   ; WinSet,Style,-0x800000,ahk_id %tThWnd1%
   SendMessage, 0x400+19, bg,fg,, ahk_id %tThWnd1%
   ToolTip, %sTooltipTxt%
   MouseGetPos, lastx, lasty
   Loop,
    if (EndTime=A_Now)
      Break
    else {
      MouseGetPos, x, y
      if (lastx != x) || (lasty != y) {
       ToolTip, %sTooltipTxt%
       lastx := x, lasty := y
     }
     sleep, 50
   }
   ToolTip
}

_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
DerRaphael



Joined: 23 Nov 2007
Posts: 604
Location: 127.0.0.1

PostPosted: Tue Aug 12, 2008 7:53 pm    Post subject: Reply with quote

usage:
Code:
sTooltip(sTooltipTxt,seconds=5,bg=0xFFFFE7,fg=0x0,x=-1,y=-1)


aboves line is from function declaration it can be read as this:

sTooltipTxt is a variable or a String containing the text to show
seconds is the time in seconds to show the tip the =5 shows its default value of 5 seconds
bg is the backgroundcolor - the 0x (needed) is to show its a hexadecimal number of 6 digits length (3 pairs). each pair represents a part of color. eg 1st two the redcolor, 2nd the green color, 3rd the blue part. it works much the same as colors in html - its default is ffffe7 which is the yellowish standard color.
fg is the foregroundcolor. the declaration is the same as with background
0x0 is the same as 0x000000 and means black as default value.
x and y are coordinates. unless u need to u can dismiss these safely to follow the tooltip the mouse for the time being displayed.

i hope this makes it a lil bit clearer of how to use it.

greets
dR
_________________
Back to top
View user's profile Send private message
D4BST3R



Joined: 04 Aug 2008
Posts: 65
Location: UK: Crawley

PostPosted: Wed Aug 13, 2008 10:08 am    Post subject: Reply with quote

Thanks A Lot Guys And Gurls.. It's Fixed My Problem Very Happy Thanks For The Explanation As Well Derraphael
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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