t0ddie Posted July 10, 2005 Share Posted July 10, 2005 i would like to make a tooltip appear when the mouse is over a button, or over a .avi or pretty much anything on a gui, and when the mouse is not over the specific label, or picture or whatever, i want it to dissappear. i can make a tooltip but im not sure how to make it appear when the mouse hovers over a control or something on the gui and then dissappear when the mouse is no longer there.. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
FuryCell Posted July 10, 2005 Share Posted July 10, 2005 (edited) I think GUICtrlSetTip is the func you are looking for. Edited July 10, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
t0ddie Posted July 10, 2005 Author Share Posted July 10, 2005 (edited) ty! edit: why is it when i make a list in gui, then i hover over it the tooltip is working fine, but when i click the list, the tooltip goes away and wont come back.. Edited July 10, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
FuryCell Posted July 11, 2005 Share Posted July 11, 2005 (edited) ty!<{POST_SNAPBACK}>Your welcome. edit: why is it when i make a list in gui, then i hover over it the tooltip is working fine, but when i click the list, the tooltip goes away and wont come back.<{POST_SNAPBACK}>Thats odd. I can't seem to reproduce the bug.What AutoIt version are you using?Under 3.1.1.1 this seems to work fine.#include <GuiConstants.au3> GuiCreate("List", 170, 123,(@DesktopWidth-170)/2, (@DesktopHeight-123)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $List = GuiCtrlCreateList("Test", 0, 0, 170, 123) GuiCtrlSetTip($List,"This Is a tooltip") GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Edited July 11, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
w0uter Posted July 11, 2005 Share Posted July 11, 2005 offtopic but shouldnt styles be BitOr'd ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
t0ddie Posted July 11, 2005 Author Share Posted July 11, 2005 ; AutoIt Version: 3.1.0 and it works fine when you click a label its the list... thats creating the problem. $mylist = GUICtrlCreateList("", 305, 139, 200, 173, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_NOSEL, $ES_AUTOVSCROLL, $WS_EX_WINDOWEDGE)) i click that list, the tooltip dissappears just like when you click a label. but it doesnt come back when you move the mouse back over it, and it will with the label. just not the list. and why bitor'ed? Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
FuryCell Posted July 11, 2005 Share Posted July 11, 2005 (edited) ; AutoIt Version: 3.1.0and it works fine when you click a labelits the list... thats creating the problem. $mylist = GUICtrlCreateList("", 305, 139, 200, 173, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_NOSEL, $ES_AUTOVSCROLL, $WS_EX_WINDOWEDGE))i click that list, the tooltip dissappears just like when you click a label.but it doesnt come back when you move the mouse back over it, and it will with the label.just not the list.and why bitor'ed?<{POST_SNAPBACK}>Maybe it is a weird bug that only occurs with certain scripts.Could you post the source code of your script?Thanks -SolidSnakeP.S. Haven't tested but something like this might be a quick fix for your problem.#include <GuiConstants.au3> GUICreate("List", 170, 123, (@DesktopWidth - 170) / 2, (@DesktopHeight - 123) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $List = GUICtrlCreateList("Test", 0, 0, 170, 123) GUICtrlSetTip($List, "This Is a tooltip") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $List GUICtrlSetTip($List, "This Is a tooltip") Case Else ;;; EndSelect WEnd Exit Edited July 11, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
LxP Posted July 11, 2005 Share Posted July 11, 2005 offtopic but shouldnt styles be BitOr'd ?<{POST_SNAPBACK}>If you want to add a new style to an already existing control then it's necessary to BitOR() it so as not to lose the existing style settings. When initially setting them up this isn't necessary because the specified styles are guaranteed not to be set. Link to comment Share on other sites More sharing options...
t0ddie Posted July 11, 2005 Author Share Posted July 11, 2005 #include <GUIConstants.au3> GUICreate("My GUI control tip") ; will create a dialog box that when displayed is centered GUICtrlCreateLabel ("my label", 10,20) GUICtrlSetTip(-1,"click here, and move mouse and i'll be back!") $mylist = GUICtrlCreateList("", 200, 200, 100, 100, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_NOSEL, $ES_AUTOVSCROLL, $WS_EX_WINDOWEDGE)) GUICtrlSetTip(-1,"click me and i wont be coming back!") GUISetState () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Valik Posted July 11, 2005 Share Posted July 11, 2005 If you want to add a new style to an already existing control then it's necessary to BitOR() it so as not to lose the existing style settings. When initially setting them up this isn't necessary because the specified styles are guaranteed not to be set.<{POST_SNAPBACK}>That is not the correct reason. The styles are binary ops. BitORing preserves any already set bits and sets any new bits that need to be set. No bits are ever reset. Addition may produce a result which causes some bits to be reset. In most cases, this is not a problem. The styles are defined in powers of 2 so that each style corresponds to one bit in a 32 bit unsigned integer. However, there are some meta-styles which are a combination of 2 or more styles bitwise or'd together. If you attempt to add a meta-style and one of the styles it contains, the results will be incorrect. However, bitwise or'ing a meta-style and a style it contains will not reset any bits.A casual user will not know the difference between one of these meta-styles and a single style. Its very easy to accidentally duplicate at least one of the single styles found within the meta-style. Therefore, its best to always BitOR styles together in case you've made a mistake and are including a style twice or in case you ever add a new style which may already be included in a meta-style.Note: Meta-style is my term for lack of a better description. In this context, I'm using the term to refer to a style that is composed of two or more other styles combined together to produce a "new" style which is more or less just shorthand notation for common styles. Link to comment Share on other sites More sharing options...
LxP Posted July 11, 2005 Share Posted July 11, 2005 However, there are some meta-styles which are a combination of 2 or more styles bitwise or'd together. If you attempt to add a meta-style and one of the styles it contains, the results will be incorrect.Thanks for clarifying that, Valik.While I have in fact used them, I was not consciously aware of 'meta-styles' (such as $GUI_DOCKMENUBAR and $LBS_STANDARD) and had wrongly assumed that all possibilities were powers of 2, and would therefore not interfere with eachother when starting from a style of '0'. 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