Jump to content

Recommended Posts

Posted

Hello,

I was wondering if there was a solution to getting the text of a ToolTip?
The closest thing I found was this, but the link mentioned does not work:

p.s. I just want to use the basic ToolTip("hello") and then read its value. If I have to resort to creating an entire GUI just for this, then I will probably just pass, as it's not TOO important for me.

Reason, I have the following script:

Func togglePause()
   $paused = Not($paused)

   If($paused = True) Then
      $_previousMessage = GetToolTip() ;This is what I would like to do.
      ToolTip("Script Paused!", 0, 0)
   Else
      ToolTip("")
      ToolTip($_previousMessage) ;This is what I would like to do instead of the line above (which I currently do).
   EndIf

   While($paused = True)
      Sleep(500)
   WEnd
EndFunc

 

Thank you in advance.

Posted

@Subz That is what I am doing now. It is not ideal, because I wanted this extra bit done only when I pause the script, not in all of my scripts and areas which update the tooltip.

However, it works...

Posted

All you do is create a _ToolTip function, based upon the ToolTip function.  Then replace all other calls to ToolTip with _ToolTip.

Example:

Global $sToolTip

Func _ToolTip($sText, $x, $y, $sTitle = "", $iIcon = 0, $vOptions = 0)
    $sToolTip = $sText
    ToolTip($sText, $x, $y, $sTitle, $iIcon, $vOptions)
EndFunc

 

Posted

@Subz Yep, the only thing then is that everyone needs to use that functions, or else the unpause will misbehave. It is what I am doing now.

Posted
1 hour ago, IAMK said:

Yep, the only thing then is that everyone needs to use that functions,

Why is that a problem and what's wrong with using the _GUIToolTip* functions, or just keeping track of what YOU put into the text of the tooltip? You seem to be trying to take the lazy man's approach instead of the programmer's approach for this.

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!

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 (edited)

@BrewManNH That's because I'm the only programmer. I need to make things ASAP (as simple as possible) for the people who work with me and will be required to maintain these scripts. Otherwise, it all comes back to me to handhold. Trust me on this...

In a personal project, I would do it the suggested way.

Edit: The only time I've ever used complex code, is in files which get included and don't need to be looked at by anyone. I'm also 99% sure these functions will never need to be maintained.

Edited by IAMK

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...