lte5000 Posted May 19, 2004 Share Posted May 19, 2004 (edited) Update: Added checking if BalloonTips are enabled. Thanks piccaso! I wrote this function in one of my scripts, and I decided to post it here, in case anyone's interested.What it does is automatically choose whether to display a ToolTip or TrayTip depending on your OS (TrayTip on 2000/XP, ToolTip on 9x/NT). It also has the ability to scroll in the 'Tip from left to right. It does NOT accept location parameters. The function should be called as such to display a scrolling ToolTip/TrayTip:Opt("WinTitleMatchMode", 4) Tip("AutoIt", "I am a scrolling 'Tip...", 1, 20) Sleep(2500) The third parameter turns scrolling on or off. ( 1=ON, anything else = OFF) The last parameter controls the scrolling speed, BIGGER number = SLOWER speed SMALLER number = FASTER speed.Or like this to display a non-scrolling tip:Opt("WinTitleMatchMode", 4) Tip("AutoIt", "I am NOT a scrolling 'Tip...", "", "") Sleep(2500) expandcollapse popupFunc Tip($header, $message, $scrolling, $speed) Local $header, $message, $scrolling, $parseTray, $scrollTray, $parseTool, $scrollTool, $i, $winSizes, $y, $trayEnable $trayEnable = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "EnableBalloonTips") If @error = -1 Or $trayEnable And @OSTYPE = "WIN32_NT" And @OSVersion <> "WIN_NT4" Then ;Non - scrolling TrayTips. If Not $scrolling Then TrayTip($header, $message, 30, 1) Else ;Scrolling TrayTips. $parseTray = StringSplit($message, "") Do $i = $i + 1 $scrollTray = $scrollTray & $parseTray[$i] TrayTip($header, $scrollTray, 30, 1) Sleep($speed) Until $i = $parseTray[0] EndIf Else $winSizes = WinGetClientSize("classname=Shell_TrayWnd") $y = @DesktopHeight - $winSizes[1] - 35 ;Make the title line-up better on tooltips. Select Case StringLen($message) - StringLen($header) > 30 $header = @TAB & @TAB & $header Case StringLen($message) - StringLen($header) > 20 $header = @TAB & $header EndSelect ;Non - scrolling ToolTips. If Not $scrolling Then ToolTip($header & @LF & $message, @DesktopWidth - (StringLen($message) * 4.5) - 100, $y) Else ;Scrolling ToolTips. $parseTool = StringSplit($message, "") Do $i = $i + 1 $scrollTool= ($scrollTool & $parseTool[$i]) ToolTip($header & @LF & $scrollTool, @DesktopWidth - (StringLen($message) * 4.5) - 100, $y) Sleep($speed) Until $i = $parseTool[0] EndIf EndIf EndFunc ;==>Tip Edited May 29, 2004 by lte5000 Link to comment Share on other sites More sharing options...
Valik Posted May 19, 2004 Share Posted May 19, 2004 (edited) Passing anything > 1 to the 3rd parameter causes a recursion error.Edit: Larry, you're a bastard. You tidy the script no more than a minute after I read the original left justified version. Edited May 19, 2004 by Valik Link to comment Share on other sites More sharing options...
emmanuel Posted May 19, 2004 Share Posted May 19, 2004 wouldn't it be cool as hell to have the forums run tidy on anything in code tags? or make a new type called [tidycode]? anyways, pipedreams... "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
lte5000 Posted May 19, 2004 Author Share Posted May 19, 2004 Or we should all use Tidy before we post. The code looks fairly fine in Crimson Editor, but it does not look so fine on hiddensoft.com. K Link to comment Share on other sites More sharing options...
emmanuel Posted May 19, 2004 Share Posted May 19, 2004 Or we should all use Tidy before we post. The code looks fairly fine in Crimson Editor, but it does not look so fine on hiddensoft.com. K lol, yup... I am kind of tidy compulsive, I like how it leaves me with a rolling history of the script I'm working on, though I've switched to SciTE and it does all the indents on the fly, which is hella cool... (I still tidy all the damned time, it's fun!) "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
trids Posted May 20, 2004 Share Posted May 20, 2004 Tidy is a cool tool, but I believe the best solution is to adopt the discipline of formatting while coding. This has benefits that aid development too .. not just maintenance Link to comment Share on other sites More sharing options...
jpm Posted May 20, 2004 Share Posted May 20, 2004 Tidy is a cool tool, but I believe the best solution is to adopt the discipline of formatting while coding. This has benefits that aid development too .. not just maintenance I always use tidy after typing just incase of Link to comment Share on other sites More sharing options...
lte5000 Posted May 20, 2004 Author Share Posted May 20, 2004 (edited) Actually I try to be rather tidy with my coding, too. But, I hadn't really considered the fact that in HTML the tabs have no effect (correct?). I've never used Tidy up to this point.Ken Edited May 20, 2004 by lte5000 Link to comment Share on other sites More sharing options...
trids Posted May 21, 2004 Share Posted May 21, 2004 Actually I try to be rather tidy with my coding, too. But, I hadn't really considered the fact that in HTML the tabs have no effect (correct?). .. Correct .. but spaces do, within the CODE tags supported by the forum. And if you use a cool editor (like TextPad ) then you can make your tabs come out as spaces anyway. (Then you don't have to use Tidy at all) Link to comment Share on other sites More sharing options...
lte5000 Posted May 21, 2004 Author Share Posted May 21, 2004 I use Crimson Editor, but I did try Scite last evening. I couldn't figure out how to change the default font (too small), though and the Scite helpfile seemed to be broken, so I guess I'll have to go back to Crimson (Excuses.... Excuses... )TextPad, hmm... You are welcome to download a copy for free evaluation. K Link to comment Share on other sites More sharing options...
Developers Jos Posted May 21, 2004 Developers Share Posted May 21, 2004 (edited) I use Crimson Editor, but I did try Scite last evening. I couldn't figure out how to change the default font (too small), though and the Scite helpfile seemed to be broken, so I guess I'll have to go back to Crimson (Excuses.... Excuses... )TextPad, hmm...  KThe Documentation can be found in the subdir doc called SciTEDoc.html.The Scitehelp will be fixed with the next release thats coming soon... tnx for mentioning it...The best thing is to make the changes in the User option files because this will not be overridden when you upgrade....To change the font just Open the User Option file and add these line to it:use.monospaced=1 -> this tell Scite to use mono space fontfont.monospace=font:Courier New,size:10and these are all the definitions for all different type of code color settingsyou can customise them all if you want.# White spacestyle.au3.0=fore:#000000,$(font.au3)# Comment linestyle.au3.1=fore:#009933,italics# Comment blockstyle.au3.2=fore:#669900,italics# Numberstyle.au3.3=fore:#AC00A9,bold,italics# Functionstyle.au3.4=fore:#000090,bold,italics# Keyword style.au3.5=fore:#0000FF,bold# Macrostyle.au3.6=fore:#FF33FF,bold# Stringstyle.au3.7=fore:#9999CC,bold# Operatorstyle.au3.8=fore:#FF0000,bold# Variablestyle.au3.9=fore:#AA0000,bold# Sent keys in stringstyle.au3.10=fore:#FF8800,bold# Pre-Processorstyle.au3.11=fore:#F000FF,italics Edited May 21, 2004 by JdeB SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
piccaso Posted May 21, 2004 Share Posted May 21, 2004 This is nice but your function does not check if Balloontips are enabled XP has Key:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced Value:EnableBalloonTips Set to 0 if they are disabled (missing means enabled) CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
lte5000 Posted May 21, 2004 Author Share Posted May 21, 2004 (edited) Thank you for you comments, piccaso! I updated the code above. JdeB, Thank you for your informative post, I'll want to try out your stuff sometime. Kendall Edited May 23, 2004 by lte5000 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now