Jump to content

_MouseHover UDF


marfdaman
 Share

Recommended Posts

marfdaman,

Came in this morning and saw your posts. I tried them and like them -- might incorporate them in some of my stuff. I also noticed the flickering in your last example. I tried various obvious things but could'nt cure the flickering. Keep us posted as you go.

Thanks

Link to comment
Share on other sites

  • Replies 89
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I noticed the first post hasn't been updated with the new script (SetText and Local Variables)

I will do that tonight :">

marfdaman,

Came in this morning and saw your posts. I tried them and like them -- might incorporate them in some of my stuff. I also noticed the flickering in your last example. I tried various obvious things but could'nt cure the flickering. Keep us posted as you go.

Thanks

YWC, glad people besides me will use this as well :D

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

Insted of the functions I posted earlier use these ones:

;===============================================================================
; Description:      Is called when a defined control loses its hover.
; Parameter(s):  None
; Requirement:      None
; Return Value(s):  None
;===============================================================================
Func _HoverUndo()
    $title = WinGetTitle("")
    If StringLeft($HoverUndo[$Global_I],7) = "SetText" Then
        $execute = "ControlSetText" & Chr(40) & "'" & $title & "','',$" & _StringBetween($HoverUndo[$Global_I], "$", ",") & "," & _StringBetween($HoverUndo[$Global_I], ",", Chr(41)) & Chr(41)
        Execute($execute)
    Else
        Execute($HoverUndo[$Global_I])
    EndIf
EndFunc



;===============================================================================
; Description:      Is called when a defined control acquires hover.
; Parameter(s):  None
; Requirement:      None
; Return Value(s):  None
;===============================================================================
Func _HoverFound()
    $title = WinGetTitle("")
    If StringLeft($HoverActions[$Global_I],7) = "SetText" Then
        $execute = "ControlSetText" & Chr(40) & "'" & $title & "','',$" & _StringBetween($HoverActions[$Global_I], "$", ",") & "," & _StringBetween($HoverActions[$Global_I], ",", Chr(41)) & Chr(41)
        Execute($execute)
    Else
        Execute($HoverActions[$Global_I])
    EndIf
EndFunc

Func _StringBetween($s, $from, $to)
    $x = StringInStr($s, $from) + StringLen($from)
    $y = StringInStr(StringTrimLeft($s, $x), $to)
    Return StringMid($s, $x, $y)
EndFunc

They allow for spaces between SetText( and $ControlId

Edited by RazerM
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Ok, the UDF has been updated with various small (but rather important) bugs, and I've added support for GuiCtrlSetColor. RazerM, your updates are included as well, finally :D

Edit: Just want to point out that even with the Adlib set to 50 ms, my 1600 line script which I'm doing my tests on, consumes a very nice 0% cpu (i.c.w. OnEvent). This is with, so far, 8 controls to check for. Not quite as resource-eating as I thought it would be when I began making the funcs :wacko:

Edited by marfdaman

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

marfdaman,

Thanks, small point -- when describing actions (or anything) in code don't use abreviations.

; Note(s): If you want to use this i.c.w. an AdlibEnable in your current script, make your Adlib call "_HoverCheck()" as well.

; In this case, _HoverOn must NOT be called.

Sorry, but I don't immediatly know what i.c.w. means.

Thanks again

Link to comment
Share on other sites

marfdaman,

Thanks, small point -- when describing actions (or anything) in code don't use abreviations.

Sorry, but I don't immediatly know what i.c.w. means.

Thanks again

Sorry for that, thought it was an official one in English. By i.c.w. I meant "in combination with".

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

Thanks,

Nope I've been at this a long time and I've not run into it but then YMMV :wacko:

Now that's one I don't know :D

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

I like the additions but I think you should split the GUICtrlSetColor with "," not ", " incase there isn't a space.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Yes, you're right about that, updating it now...tnx

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

I think another use of this function will be pop up help files. Similar to tooltips but allows much more detail.

We intend to try it with this code later today. I'll post full example if iot works....

Currently a right clik in the area of the control is required to bring up the "Whats this?" message. Your function should enable the pop up when hovered over the control...

called from another function:

$Start_Mining_Menu = GUICtrlCreateContextMenu($Start_Mining)

$Start_Mining_Item = GUICtrlCreateMenuitem("What's This?", $Start_Mining_Menu)

Edited by Buckw1
Link to comment
Share on other sites

Yes, it could be used for such purposes as well, if you need help, let me (us) know :D

Alzo

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

Added support for GUICtrlSetBkColor:

;===============================================================================
; Description:          Is called when a defined control loses its hover.
; Parameter(s):     None
; Requirement:          None
; Return Value(s):  None
;===============================================================================
Func _HoverUndo()
    $title = WinGetTitle("")
    Select
        Case StringLeft($HoverUndo[$Global_I],7) = "SetText"
            $execute = "ControlSetText" & Chr(40) & "'" & $title & "','',$" & _StringBetween($HoverUndo[$Global_I], "$", ",") & "," _
            & _StringBetween($HoverUndo[$Global_I], ",", Chr(41)) & Chr(41)
            Execute($execute)
        Case StringLeft($HoverUndo[$Global_I], 15) = "GUICtrlSetColor"
            $szTemp__Args = StringReplace($HoverUndo[$Global_I], 'GUICtrlSetColor(', "")
            $szTemp__Args = StringReplace($szTemp__Args, ")", "")
            $szTemp__Args = StringSplit($szTemp__Args, ",", 1)
            For $i = 1 To UBound($szTemp__Args)-1
                If StringLeft($szTemp__Args[$i], 1) = " " Then $szTemp__Args[$i] = StringReplace($szTemp__Args[$i], " ", "", 1)
            Next
            GUICtrlSetColor(Execute($szTemp__Args[1]), Execute($szTemp__Args[2]))
        Case StringLeft($HoverUndo[$Global_I], 17) = "GUICtrlSetBkColor"
            $szTemp__Args = StringReplace($HoverUndo[$Global_I], 'GUICtrlSetBkColor(', "")
            $szTemp__Args = StringReplace($szTemp__Args, ")", "")
            $szTemp__Args = StringSplit($szTemp__Args, ",", 1)
            For $i = 1 To UBound($szTemp__Args)-1
                If StringLeft($szTemp__Args[$i], 1) = " " Then $szTemp__Args[$i] = StringReplace($szTemp__Args[$i], " ", "", 1)
            Next
            GUICtrlSetBkColor(Execute($szTemp__Args[1]), Execute($szTemp__Args[2]))
        Case Else
            Execute($HoverUndo[$Global_I])
    EndSelect
EndFunc

;===============================================================================
; Description:          Is called when a defined control acquires hover.
; Parameter(s):     None
; Requirement:          None
; Return Value(s):  None
;===============================================================================
Func _HoverFound()
    $title = WinGetTitle("")
    Select
        Case StringLeft($HoverActions[$Global_I],7) = "SetText"
            $execute = "ControlSetText" & Chr(40) & "'" & $title & "','',$" & _StringBetween($HoverActions[$Global_I], "$", ",") _
            & "," & _StringBetween($HoverActions[$Global_I], ",", Chr(41)) & Chr(41)
            Execute($execute)
        Case StringLeft($HoverActions[$Global_I], 15) = "GUICtrlSetColor"
            $szTemp__Args = StringReplace($HoverActions[$Global_I], 'GUICtrlSetColor(', "")
            $szTemp__Args = StringReplace($szTemp__Args, ")", "")
            $szTemp__Args = StringSplit($szTemp__Args, ", ", 1)
            For $i = 1 To UBound($szTemp__Args)-1
                If StringLeft($szTemp__Args[$i], 1) = " " Then $szTemp__Args[$i] = StringReplace($szTemp__Args[$i], " ", "", 1)
            Next
            GUICtrlSetColor(Execute($szTemp__Args[1]), Execute($szTemp__Args[2]))
        Case StringLeft($HoverActions[$Global_I], 17) = "GUICtrlSetBkColor"
            $szTemp__Args = StringReplace($HoverActions[$Global_I], 'GUICtrlSetBkColor(', "")
            $szTemp__Args = StringReplace($szTemp__Args, ")", "")
            $szTemp__Args = StringSplit($szTemp__Args, ",", 1)
            For $i = 1 To UBound($szTemp__Args)-1
                If StringLeft($szTemp__Args[$i], 1) = " " Then $szTemp__Args[$i] = StringReplace($szTemp__Args[$i], " ", "", 1)
            Next
            GUICtrlSetBkColor(Execute($szTemp__Args[1]), Execute($szTemp__Args[2]))
        Case Else
            Execute($HoverActions[$Global_I])
    EndSelect
EndFunc
Edited by RazerM
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Should have said it, I already added that one this afternoon :">

I'll have a look at your's and see if it's more versatile.

Edit: it's exactly the same, except mine supports ", " as well as "," in the functions, so I'll stick with that one.

Great work nonetheless, all these contributions!

Edit 2: I did that too lol

Alzo

Edited by marfdaman

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

It's ok just copied SetColor and changed it a bit

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Decided to add my other UDF as well, see first post.

Edited by marfdaman

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

MARFDAMAN!!!!

That's a very very very nice future !!

but how to use it with 'Guictrlsetpic' ?

can you give me a example Gui with picture buttons :wacko:

Recards JPAM

ps; Superslim bedacht man ! :D

Link to comment
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
 Share

  • Recently Browsing   0 members

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