Jump to content



Photo

EasyTips - Simple Custom GUI Control ToolTips


  • Please log in to reply
2 replies to this topic

#1 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,217 posts

Posted 05 April 2012 - 01:26 AM

Ever wanted a custom GUI tooltip with custom colors, icon and delay time?

Well everyone probably knows about the GUIToolTips UDF included with autoit but the lack of examples and documentation makes using it a hassle. (For me at least...)

Here I present a small UDF wrapper with one function designed as a wrapper for the udf to make it simple to add a custom tooltip without the need for various different calls to different functions to set a particular style for the tooltip.

I made it with the intention of being an alternative for GuiCtrlSetTip().

Example
AutoIt         
#include <EasyTip.au3> ; GuiCtrlSetTip GUICreate("Form1", 296, 170, -1, -1) GUICtrlCreateButton("OEM", 8, 8, 81, 25) GUICtrlSetTip(-1,"Test tip with just text.") GUICtrlCreateButton("OEM 2", 8, 33, 81, 25) GUICtrlSetTip(-1,"Test tip with text and title.","Optional title") GUICtrlCreateButton("OEM 3", 8, 59, 81, 25) GUICtrlSetTip(-1,"Test tip with text, title and Icon.","Optional title",1) GUICtrlCreateButton("OEM 4", 8, 84, 81, 25) GUICtrlSetTip(-1,"Test tip with text, title, Icon & balloon style.","Optional title",1,1) GUICtrlCreateButton("OEM 5", 8, 109, 81, 25) GUICtrlSetTip(-1,"Test tip with text, title, Icon & hovering under control.","Optional title",1,2) GUICtrlCreateButton("OEM 6", 8, 135, 81, 25) GUICtrlSetTip(-1,"Test tip with text, title, Icon & hovering under control with stem pointing to item.","Optional title",1,3) ; _GuiCtrlSetTip GUICtrlCreateButton("Custom 1", 90, 8, 81, 25) _GUICtrlSetTip(-1,"Test tip with just text.") GUICtrlCreateButton("Custom 2", 90, 33, 81, 25) _GUICtrlSetTip(-1,"Test tip with text and title.","Optional title") GUICtrlCreateButton("Custom 3", 90, 59, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title and Icon.","Optional title",1) GUICtrlCreateButton("Custom 4", 90, 84, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Icon & balloon style.","Optional title",1,1) GUICtrlCreateButton("Custom 5", 90, 109, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Icon & hovering under control.","Optional title",1,2) GUICtrlCreateButton("Custom 6", 90, 135, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Icon & hovering under control with stem pointing to item.","Optional title",1,3) GUICtrlCreateButton("Custom 7", 172, 8, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Custom Icon & hovering under control with stem pointing to item.","Optional title",@SystemDir & "\taskmgr.exe,107",3) GUICtrlCreateButton("Custom 8", 172, 33, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Custom Icon, hovering under control with stem pointing to item & custom colors.","Optional title",@SystemDir & "\taskmgr.exe,107",3,0x000000,0x00ff00) GUICtrlCreateButton("Custom 9", 172, 59, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Custom Icon, hovering under control with stem pointing to item, custom colors and custom delay time.","Optional title",@SystemDir & "\taskmgr.exe,107",3,0x000000,0x00ff00,1000) GUICtrlCreateButton("Example 1", 172, 84, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Custom Icon, hovering under control with stem pointing to item & custom colors.","Optional title",@SystemDir & "\taskmgr.exe,107",0,0x000000,0x00ff00) GUICtrlCreateButton("Example 2", 172, 109, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Custom Icon, hovering under control with stem pointing to item & custom colors.","Optional title",@SystemDir & "\taskmgr.exe,107",1,0x000000,0x00ff00) GUICtrlCreateButton("Example 3", 172, 135, 81, 25) _GUICtrlSetTip(-1,"Test tip with text, title, Custom Icon, hovering under control with stem pointing to item & custom colors.","Optional title",@SystemDir & "\taskmgr.exe,107",2,0x000000,0x00ff00) GUISetState(@SW_SHOW) While GUIGetMsg() <> -3 WEnd



Attached File  EasyTip.rar   2.51KB   566 downloads

Edit: Fixed error...

Edited by ApudAngelorum, 05 April 2012 - 02:03 AM.

Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.







#2 soebis

soebis

    Seeker

  • Active Members
  • 13 posts

Posted 15 May 2012 - 01:17 PM

nice tooltips ;)
thanks

#3 funkey

funkey

    New Dad

  • Active Members
  • PipPipPipPipPipPip
  • 488 posts

Posted 15 May 2012 - 01:23 PM

Thanks for sharing.

Programming today is a race between software engineers striving to

build bigger and better idiot-proof programs, and the Universe

trying to produce bigger and better idiots.

So far, the Universe is winning.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users