Jump to content

Recommended Posts

Posted (edited)

I have been working on rewriting the GUIToolTip UDF that comes standard with AutoIt3. Most of the work has involved removing all instances of "magic" numbers and creating working examples for the help file. I have also rewritten most of the ToolTip function entries in the help file to better explain how they work, and how to use them. The original UDF worked well for the most part, but unfortunately there were no examples in the help file and the descriptions for the functions and/or what they did was sorely lacking. Attached is an archive that contains the updated GUIToolTip.au3 UDF, the ToolTipConstants.au3 file, the updated help file entries for the functions, and example scripts for as many of the UDF's functions that I could get working.

There is also a script breaking changes document in the archive that describes what was changed and how it will affect any scripts written to use the functions previously. As of this writing, I can almost guarantee that if you have a script that used the original UDF it will NOT work with this one. By that I don't mean it won't work well, I mean it won't work at all, so make sure you read the script breaking changes information.

There are some functions in the original UDF that I couldn't get working even with the rewrite, mostly that is because I lack the knowledge necessary to make them work, or they just don't work as written and I can't tell the difference. Any of the functions that don't have example scripts in the help file entries I couldn't get to work, except for the function _GUIToolTip_ToolToArray, which appears to be mostly used as an internal function but I left it as is in case someone ever used it for a script.

The new UDF removes the function _GUIToolTip_TTFToBits as it is no longer needed for anything and adds a new function called _GUIToolTip_Deactivate.

Please look over the functions, the examples, and the help file entries and give some feedback as to what can be improved, changed, removed etc. Also, please take a look at the functions that I couldn't make work and let me know if you can get them working and an example showing what it does and how it should work. The more eyes looking at this the better it will be in the end. Thanks.

 

GUIToolTip.zip

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

in:

script_breaking_changes_tooltip_udf.htm

_GUIToolTip_Dectivate

wrong name ?

it suppose to be:

_GUIToolTip_Decativate

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

You mean "_GUIToolTip_Deactivate", right ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

See, that's why I need the eyes on this. :D

EDIT: Updated the first post with corrected script breaking changes file.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

I have boosters = glasses

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

I propose

Small change, i mean links

so much easier and faster to read the documentation.

see attached file

 

script_breaking_changes_tooltip_udf.htm

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 11/4/2013 at 4:57 PM, mlipok said:

I propose

Small change, i mean links

so much easier and faster to read the documentation.

see attached file

So far, none of the script breaking changes have links to the functions that are being broken, so I continued the tradition.

  On 11/4/2013 at 5:05 PM, jaberwocky6669 said:

In function _GUIToolTip_EnumTools, would $fResult return true all of the time? Return _GUIToolTip_ToolToArray($hWnd, $tToolInfo, $fResult = True)

It would only return true if the $fResult variable could be evaluated to True, so if the _SendMessage returned false or anything that wouldn't evaluate to True, then ($fResult = True) would evaluate to False, and that's what it would return.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Yeah, it's a little confusing when you first look at it, I honestly hadn't even noticed it previously, and then when you pointed it out it took me a bit to figure out what that was doing.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

I see that this has been downloaded a few times now, I would appreciate any positive or negative feedback about this. 

I would like to have this added to the next beta release, but I need to hear of anything either positive, and especially negative, before I go ahead and commit the changes. Thanks for looking.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

I have looked over this myself and was also hoping for a little more feedback. Perhaps just commit and see what comes of it.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I suppose we can see where the chips fall. :D

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

  • Moderators
Posted

BrewManNH,

Thanks for the effort you have put into this - only just got around to playing with this. A few points I have noticed so far:

 

BubbleSize/Ht/Width: produces nonsense results on my system - returns 14x6 whereas the tip is around double that.

GetTitleText: does not.

Popup: once gone the tooltip does not reappear even when hovering over the button as requested

All the rest seem to work fine. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)

What OS are you running this on?

Never mind, I put an older version of GUIToolTip.au3 in the archive, it didn't have the bug fix for the GetTitleText and GetTitleBitMap functions. The attached file is the correct version with the fix.

As to the bubble size functions, I just did some digging into that function (TTM_GETBUBBLESIZE), and unbeknownst to me that only works on a tracking tooltip.

This updated function for the help file will properly display the information. This one is for the GetBubbleSize function, and the others will be similar.

#include <GUIConstantsEx.au3>
#include <GUIToolTip.au3>
#include <MsgBoxConstants.au3>
Example()

Func Example()
    Local $hGUI = GUICreate(StringTrimRight(@ScriptName, 4), 350, 200)

    Local $iButton = GUICtrlCreateButton("This is a button", 30, 32, 130, 28)
    Local $hButton = GUICtrlGetHandle($iButton)
    ; create a tooltip control using default settings
    Local $hToolTip = _GUIToolTip_Create(0)
    ; add a tool to the tooltip control
    _GUIToolTip_AddTool($hToolTip, 0, "This is a ToolTip", $hButton)
    GUISetState()
    _GUIToolTip_TrackActivate($hToolTip, True, 0, $hButton) ; <<<<<<<<<<<< have to activate tracking

    Local $iBubbleHeight = _WinAPI_HiWord(_GUIToolTip_GetBubbleSize($hToolTip, 0, $hButton))
    Local $iBubbleWidth = _WinAPI_LoWord(_GUIToolTip_GetBubbleSize($hToolTip, 0, $hButton))
    ; Display the height of the tooltip bubble in pixels
    MsgBox($MB_SYSTEMMODAL, "Info", "Bubble Height = " & @TAB & $iBubbleHeight & " Pixels" & @CRLF & _
            "Bubble Width = " & @TAB & $iBubbleWidth & " Pixels")
    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    ; Destroy the tooltip control
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example

GUIToolTip.au3

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

  • Moderators
Posted

BrewManNH,

Vista x32 SP2 - Autoit 3.3.9.22.

Let me know if I can help with debugging - either here or via PM. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

See my updated post.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

  • Moderators
Posted

BrewmanNH,

BubbleSize/Ht/Width and GetTitleText now work. :thumbsup:

Popup still never reappears. :(

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Hmmmm....popup worked at one time, now I can't get the example to work at all.

There's no tooltip popping back up unless you are hovering over the button at the same time the popup message is sent. When I first tried this, it would pop up the tooltip as long as the button said Hover Now, but now it's not unless you're already hovering.

I don't get half of the tooltip functions, as they just don't work the way Microsoft says they're supposed to.

I suppose, instead of popping a tooltip off using _GUIToolTip_Pop and bringing it back to view with _PopUp, I'd probably have to use Activate and Deactivate.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

  • Moderators
Posted

BrewManNH,

 

  Quote

There's no tooltip popping back up unless you are hovering over the button at the same time the popup message is sent

It works if I do that. :thumbsup:

Perhaps change the button text like this? :huh:

#include <GUIConstantsEx.au3>
#include <GUIToolTip.au3>

Example()

Func Example()
    Local $hGUI = GUICreate(StringTrimRight(@ScriptName, 4), 350, 200)

    Local $iButton = GUICtrlCreateButton("ToolTip showing", 30, 32, 130, 28)
    Local $hButton = GUICtrlGetHandle($iButton)

    Local $hToolTip = _GUIToolTip_Create($hGUI, BitOR($_TT_ghTTDefaultStyle, $TTS_BALLOON))
    _GUIToolTip_AddTool($hToolTip, 0, " ", $hButton)
    GUISetState()

    _GUIToolTip_TrackActivate($hToolTip, True, 0, $hButton)
    Local $Msg, $Display = True
    $hTimer = TimerInit()
    While 1
        Sleep(10)
        Local $aMousePos = MouseGetPos()
        _GUIToolTip_TrackPosition($hToolTip, $aMousePos[0] + 10, $aMousePos[1] + 20)
        _GUIToolTip_UpdateTipText($hToolTip, 0, $hButton, "X: " & $aMousePos[0] & " Y: " & $aMousePos[1])
        $Msg = GUIGetMsg()
        Switch $Msg
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
        ; Every 8 seconds the tooltip will be "popped" in or out of view
        ; to get it to display after the 8 seconds has passed, you have to hover
        ; over the button.
        If TimerDiff($hTimer) > 8000 Then
            $Display = Not $Display
            $hTimer = TimerInit()
            If $Display Then
                GUICtrlSetData($iButton, "ToolTip showing")
                $iRet = _GUIToolTip_PopUp($hToolTip)
                ConsoleWrite($iRet & @CRLF)
            Else
                GUICtrlSetData($iButton, "Hover here now")
                _GUIToolTip_Pop($hToolTip)
            EndIf
        EndIf
    WEnd
    ; Destroy the tooltip control
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example
M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

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
×
×
  • Create New...