Sign in to follow this  
Followers 0
ako673de

I want ToolTips being displayed (much) longer than default

4 posts in this topic

The windows default setting for the duration tooltips are being shown is 5000ms. For my application this is way too short. I would prefer at least 1 minute or - even better - endless, so that the reader has time enough to read, re-read and understand - without permanently needing to move the mouse to re-show a tooltip.

- GUICtrlSetTip has no parameter at all to control the display duration.

- The "_GUIToolTip_*" functions offer such parameter but so far all my efforts to show a tooltip with these funtions (on Input, Edit, Button (or the like) controls) failed. I can't find any help about this set of functions, just two examples about the usage with ToolBars and ListViews. I used these examples to check if the function "_GUIToolTip_SetDelayTime" at least fulfills what it promises to do, and I can say that for me this function does not work at all: "_GUIToolTip_GetDelayTime" always returns the default regardless what parameter is given to "_GUIToolTip_SetDelayTime" before. But maybe I'm just confusing all the handles these functions require...

Can anybody help (with a short sample script that shows a tooltip on a button for more than 5s)?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The windows default setting for the duration tooltips are being shown is 5000ms. For my application this is way too short. I would prefer at least 1 minute or - even better - endless, so that the reader has time enough to read, re-read and understand - without permanently needing to move the mouse to re-show a tooltip.

- GUICtrlSetTip has no parameter at all to control the display duration.

- The "_GUIToolTip_*" functions offer such parameter but so far all my efforts to show a tooltip with these funtions (on Input, Edit, Button (or the like) controls) failed. I can't find any help about this set of functions, just two examples about the usage with ToolBars and ListViews. I used these examples to check if the function "_GUIToolTip_SetDelayTime" at least fulfills what it promises to do, and I can say that for me this function does not work at all: "_GUIToolTip_GetDelayTime" always returns the default regardless what parameter is given to "_GUIToolTip_SetDelayTime" before. But maybe I'm just confusing all the handles these functions require...

Can anybody help (with a short sample script that shows a tooltip on a button for more than 5s)?

There are lots of ways, but here is one possibility. I'm sure people have posted other ways, I think Xenobiologist did before he was reincarnated.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 413, 298, 303, 219)
$Button1 = GUICtrlCreateButton("Button1", 32, 40, 75, 25, 0)
$Button2 = GUICtrlCreateButton("Button2", 232, 40, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
Global $lasttip
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch

    $mm = GUIGetCursorInfo()
    Switch $mm[4]
        Case $Button1, $Button2
            settip($mm[4])
            
    EndSwitch

WEnd


Func settip($bb)
    If $bb = $lasttip Then Return
    Notip()
    $lasttip = $bb
    ToolTip("")
    $mp = MouseGetPos()
    Switch $bb
        Case $Button1
            ToolTip("over button 1" & @CR & "with more text to read", $mp[0], $mp[1], "Title",1,5)
        Case $Button2
            ToolTip("over button 2", $mp[0], $mp[1])
    EndSwitch
    AdlibEnable("notip", 10000);10 second delay for tip
    
EndFunc;==>settip

Func Notip()
    
    ToolTip("")
    AdlibDisable()
$lasttip = 0
EndFunc;==>Notip
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

I think Xenobiologist did before he was reincarnated.

I assume you mean when he was known as th.meger? I always have an issue calling him Xeno lol.

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.

Share this post


Link to post
Share on other sites

I assume you mean when he was known as th.meger? I always have an issue calling him Xeno lol.

Yes, I still think of him as th.Meger.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0