Sign in to follow this  
Followers 0
cappy2112

Control Tooltip

12 posts in this topic

Has anyone implemented a "traditional tooltip"- that is, when the mouse is over a certain control, a tooltip is displayed until the mouse is ,moved off of the control, or the tooltip timer expires.

This would require MouseOver functionality for a control, which I haven't been able to find either.

Share this post


Link to post
Share on other sites



hows about

#include <GUIConstants.au3>
#include <Date.au3>


GUICreate("MY GUI")

$Button_1 = GUICtrlCreateButton("Select", 10, 50, 50, 20)
GUICtrlSetTip( -1, "Select button")
$Button_2 = GUICtrlCreateButton("Exit", 60, 50, 50, 20)
GUICtrlSetTip( -1, "Exit button")
$Label_4 = GUICtrlCreateLabel("Mouse over any control", 10, 10, 400, 30)
GUICtrlSetTip( -1, "Label Message")
GUISetState()



While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button_1
            MsgBox(64,"Mouse over","this is a mouse over control test")
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_2
            Exit
    EndSelect
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Has anyone implemented a "traditional tooltip"- that is, when the mouse is over a certain control, a tooltip is displayed until the mouse is ,moved off of the control, or the tooltip timer expires.

This would require MouseOver functionality for a control, which I haven't been able to find either.

Yes like this...

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

$gui=GuiCreate("Task Drawer", 150, 150, 150, 150, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor (0x660000)

$lbl = GUICtrlCreateLabel("Tool tip here", 3, 0, 150, 20, $SS_CENTER, $SS_NOTIFY)

GUICtrlSetBkColor ( $lbl, 0x3399CC)

GUICtrlSetFont ($lbl, 10, 600, "", "Arial Bold")

GUICtrlSetColor ( $lbl, 0x660000)

GUICtrlSetOnEvent($lbl, "Exitit")

GUICtrlSetTip($lbl, "Click here to exit" )

GuiSetState()

While 1

Sleep(10)

WEnd

Func Exitit()

Exit

EndFunc

Share this post


Link to post
Share on other sites

Oops my forum options got wacked.. Fixed.

Share this post


Link to post
Share on other sites

hows about

#include <GUIConstants.au3>
#include <Date.au3>
GUICreate("MY GUI")

$Button_1 = GUICtrlCreateButton("Select", 10, 50, 50, 20)
GUICtrlSetTip( -1, "Select button")
$Button_2 = GUICtrlCreateButton("Exit", 60, 50, 50, 20)
GUICtrlSetTip( -1, "Exit button")
$Label_4 = GUICtrlCreateLabel("Mouse over any control", 10, 10, 400, 30)
GUICtrlSetTip( -1, "Label Message")
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button_1
            MsgBox(64,"Mouse over","this is a mouse over control test")
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_2
            Exit
    EndSelect
WEnd

8)

Great Thanks.

If these APIS were named Tooltip, as they should be, the search through the helpfile woul d have returned something other than ToolTip()

Share this post


Link to post
Share on other sites

Yes like this...

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

$gui=GuiCreate("Task Drawer", 150, 150, 150, 150, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor (0x660000)

$lbl = GUICtrlCreateLabel("Tool tip here", 3, 0, 150, 20, $SS_CENTER, $SS_NOTIFY)

GUICtrlSetBkColor ( $lbl, 0x3399CC)

GUICtrlSetFont ($lbl, 10, 600, "", "Arial Bold")

GUICtrlSetColor ( $lbl, 0x660000)

GUICtrlSetOnEvent($lbl, "Exitit")

GUICtrlSetTip($lbl, "Click here to exit" )

GuiSetState()

While 1

Sleep(10)

WEnd

Func Exitit()

Exit

EndFunc

thanks

Share this post


Link to post
Share on other sites

Sadly, cappy2112's comment about the helpfile is still very much true. I searched for over an hour for this, and it's one simple built-in function! I'd already given up and started work on a "mouse coordinate matrix"! :)

Search the helpfile for "tooltip" and this doesn't appear!

When people are looking for tooptips, believe me, THIS is what they are looking for.

There are LOADS of functions like that. The hours I've wasted!

Can whoever works on the manual please make a note. It's not just AutoIt n00bs who's time is wasted, but those having to support them, and then there's all those potential users wandering off muttering "can't even make a simple bloody tooptip! Useless P.O.S" under their breath....

The manual is good. Very good.

But the indexing sucks, a lot.

GUICtrlSetToolTip( -1, "My ToolTip")

MUCH BETTER!

-mu

Share this post


Link to post
Share on other sites

Yup, that's what it is. But there are many examples of this.

For instance, searching for "dns name" or "domain name", even "tcp name" (quotes for illustration, here), eventually you give up and figure that AutoIt simply can't translate names to IP addresses and perhaps begin to write a name resolution function yourself, the pain!

Or wander off muttering "Can't even translate a bloody domain name..." under your breath.

Oh! What's this ...

TCPNameToIP()

Notice that my last search example is two words which are BOTH contained within the function name ('tcp' and 'name'), and yet the result is blank. Isn't there some way to specify that the .chm search return words within bigger words?

Yes, adding "tooltip" to the GUICtrlSetToolTip -

No! Wait a minute, that was My version of the function name, that's what it *should* be! I really meant..

Yes, adding "tooltip" to the GUICtrlSetTip (who named that function!?!?!) page in the help would be good, but tweaking the chm so that it can return partial/fuzzy matches would probably be much more fruitful and productive.

Or perhaps a "keywords" section in each help entry, stuffed with EVERY possible combination of potential search queries.

-mu

ps.. AND, function list at the very top of UDF's please guys! :)

Share this post


Link to post
Share on other sites

#10 ·  Posted

I need to make a string lower case. So now I'm now searching for..

String Lower

(nothing, okay, what about...)

String case

(nada. hmmm, okay, I'll try...)

Lower case

(FUCK ALL!)

What a pity that AutoIt doesn't have a function to simply convert a string to lower case.

I guess I'd better go and Google for an ASCII table and see if I can cook up some kind of routine to do this conversion. What a nightmare!

-mu

Share this post


Link to post
Share on other sites

What a pity that AutoIt doesn't have a function to simply convert a string to lower case.

I guess I'd better go and Google for an ASCII table and see if I can cook up some kind of routine to do this conversion. What a nightmare!

-mu

Bit it does try StringLower


Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Share this post


Link to post
Share on other sites

:(

Too late!

I discovered an old ASCII table, and have written a nice function to do the conversion.

At only 600 lines of code, quite frankly it's a masterpiece, and only took four hours.

No way I'm using your new function just because it's built-in!

And much quicker, too.

:)

-mu

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