smashly Posted September 19, 2006 Share Posted September 19, 2006 (edited) Sorry to keep posting n00b how do I's and can I's , but I feel I'm not doing things correcttly in autoit all the time. Tooltips.. huh I read the excellent help file that comes with AutoIt constantly, as of late it's my bible you could say But tooltips just seem to do their own thing when I use them. example of expected and unexpected tooltip behaviour: Run this and hit ALT +1 , after the first tip dissappears hit ALT + 2 Close the script the run it again but this time use ALT + 2 first and you'll see what I mean. expandcollapse popup;~ ToolTip ( "text" [, x [, y [, "title" [, icon [, options]]]]] ) ;~ text The text of the tooltip. (An empty string clears a displaying tooltip) ;~ x, y [optional] The x,y position of the tooltip. ;~ title [optional] The title for the tooltip Requires IE5+ ;~ icon [optional] Pre-defined icon to show next to the title: Requires IE5+. Requires a title. ;~ 0 = No icon, 1 = Info icon, 2 = Warning icon, 3 = Error Icon ;~ options [optional] Sets different options for how the tooltip will be displayed (Can be added together): ;~ 1 = Display as Balloon Tip Requires IE5+ ;~ 2 = Center the tip at the x,y coordinates instead of using them for the upper left corner. ;~ Remarks ;~ To skip an optional parameter, leaving it's default value intact, use: ;~ "" for a string parameters ;~ -1 for a numeric parameters ;~ If the x and y coordinates are omitted the, tip is placed near the mouse cursor. #include <GUIConstants.au3> HotKeySet("!1","_ttexpected");ALT + 1 HotKeySet("!2","_ttonlytext");ALT + 2 $dh = @DesktopHeight/2 $dw = @DesktopWidth/2 GUICreate("Tooltip Test"); will create a dialog box that when displayed is centered GUISetState (@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Func _ttexpected() ToolTip("This is my tooltip with Text , X, Y, Title, Icon, Center Tip on XY"&@CR&"This is what I expect after reading the AutoIt3 non beta Help file", $dw, $dh,"Expexted ToolTip", 1, 2) Sleep(5000) ToolTip("") EndFunc Func _ttonlytext() ToolTip("This Tooltip should only be Text with no Title or Icon and should only and show near mouse pointer") Sleep(5000) ToolTip("") EndFunc It seems if I use the first tooltip and later use the second tooltip then the 2nd tooltip uses the Title of the first tooltip.. Am I missing something ? Spose this is one way I can have a title in a tooltip but retain the show tooltip near the mouse pointer , but then I'd have to call the first tooltip before it'll do that...dodgey. Seems I can't have a tooltip near my mouse pointer if it has a title/icon in it because If I use -1 for x y it won't show the tooltip near my mouse. Every turn I make with a tooltip it seems there another catch. So what can I actually Use as default in a tooltip with -1 or "" ? Because everything I've tried never turns out as expected apart from using all options or no options , anything else seems to be non workable. Can give mutiple examples of tooltip oddities I have.. this example just seemed to puzzle me. AutoIt non beta 13-Aug release and WinXP SP2. I had more to ask about hadles , but this post is long enough ftm and my net time is short... Cheers. Edited September 19, 2006 by smashly Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 19, 2006 Moderators Share Posted September 19, 2006 (edited) That is behavior I wouldn't expect considering you are supposed to be clearing it with ToolTip("")... Try this work aroundToolTip("This Tooltip should only be Text with no Title or Icon and should only and show near mouse pointer", MouseGetPos(0) + 5, MouseGetPos(1) + 10, '')oÝ÷ ØGbµ'̨º¯zÚæ«z÷«ÊØb¨ºëu«¢+Ø¥¹±Õ±ÐíU% ½¹ÍѹÑ̹ÔÌÐì()!½Ñ-åMÐ ÅÕ½ÐìÌÌìÄÅÕ½Ðì°ÅÕ½Ðí}ÑÑáÁÑÅÕ½Ðì¤í1P¬Ä)!½Ñ-åMÐ ÅÕ½ÐìÌÌìÈÅÕ½Ðì°ÅÕ½Ðí}Ñѽ¹±åÑáÐÅÕ½Ðì¤í1P¬È(((ÀÌØí ôÍѽÁ!¥¡Ð¼È(ÀÌØíÜôÍѽÁ]¥Ñ ¼È()U% ÉÑ ÅÕ½ÐíQ½½±Ñ¥ÀQÍÐÅÕ½Ðì¤ìÝ¥±°ÉÑ¥±½½àÑ¡ÐÝ¡¸¥ÍÁ±å¥Ì¹ÑÉ)U%MÑMÑÑ¡M]}M!=¤ìÝ¥±°¥ÍÁ±ä¸µÁÑ䥱½½à((ìIոѡU$չѥ°Ñ¡¥±½¥Ì±½Í)]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤((%ÀÌØíµÍôÀÌØíU%}Y9Q} 1=MQ¡¸á¥Ñ1½½À)]¹(()Õ¹}ÑÑáÁÑ ¤(Q½½±Q¥À ÅÕ½ÐíQ¡¥Ì¥Ìµäѽ½±Ñ¥ÀÝ¥Ñ Qáа`°d°Q¥Ñ±°%½¸° ¹ÑÈQ¥À½¸adÅÕ½ÐìµÀí HµÀìÅÕ½ÐíQ¡¥Ì¥ÌÝ¡Ð$áÁÐÑÈÉ¥¹Ñ¡Õѽ%Ð̹½¸Ñ!±À¥±ÅÕ½Ðì°ÀÌØíÜ°ÀÌØí °ÅÕ½ÐíáÁáÑQ½½±Q¥ÀÅÕ½Ðì°Ä°È¤(M±À ÔÀÀÀ¤(Q½½±Q¥À ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì¤)¹Õ¹()Õ¹}Ñѽ¹±åÑáÐ ¤(Q½½±Q¥À ÅÕ½ÐíQ¡¥ÌQ½½±Ñ¥ÀÍ¡½Õ±½¹±äQáÐÝ¥Ñ ¹¼Q¥Ñ±½È%½¸¹Í¡½Õ±½¹±ä¹Í¡½Ü¹Èµ½ÕÍÁ½¥¹ÑÈÅÕ½Ðì¤ì°5½ÕÍÑA½Ì À¤¬Ô°5½ÕÍÑA½Ì Ĥ¬ÄÀ°ÌäìÌäì¤(M±À ÔÀÀÀ¤(Q½½±Q¥À ÅÕ½ÐìÅÕ½Ðì¤)¹Õ¹ Edited September 19, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
smashly Posted September 19, 2006 Author Share Posted September 19, 2006 Cheers once again SmOke_N , I knew there was something I was missing.. now it all makes sense.. All Good. Yep I'm slapping my forehead as I type .. doh Thank You. Link to comment Share on other sites More sharing options...
Valik Posted September 19, 2006 Share Posted September 19, 2006 That's not right. Things should not carry over from one call to the next. I'll take a look at fixing this. 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