JackB Posted July 6, 2006 Share Posted July 6, 2006 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 More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 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.ThanksYWC, glad people besides me will use this as well Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
RazerM Posted July 6, 2006 Share Posted July 6, 2006 (edited) Insted of the functions I posted earlier use these ones: expandcollapse popup;=============================================================================== ; 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 July 6, 2006 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 More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 Will do! Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
WTS Posted July 6, 2006 Share Posted July 6, 2006 nice job! Link to comment Share on other sites More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 (edited) 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 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 Edited July 6, 2006 by marfdaman Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
JackB Posted July 6, 2006 Share Posted July 6, 2006 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 More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 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 againSorry 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 More sharing options...
JackB Posted July 6, 2006 Share Posted July 6, 2006 Thanks, Nope I've been at this a long time and I've not run into it but then YMMV Link to comment Share on other sites More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 Thanks,Nope I've been at this a long time and I've not run into it but then YMMV Now that's one I don't know Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
JackB Posted July 6, 2006 Share Posted July 6, 2006 Now that's one I don't know Hah! "Your Mileage May Vary" Link to comment Share on other sites More sharing options...
RazerM Posted July 6, 2006 Share Posted July 6, 2006 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 More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 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 More sharing options...
Buckw1 Posted July 6, 2006 Share Posted July 6, 2006 (edited) 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 July 6, 2006 by Buckw1 Link to comment Share on other sites More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 Yes, it could be used for such purposes as well, if you need help, let me (us) know Alzo Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
RazerM Posted July 6, 2006 Share Posted July 6, 2006 (edited) Added support for GUICtrlSetBkColor: expandcollapse popup;=============================================================================== ; 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 July 6, 2006 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 More sharing options...
marfdaman Posted July 6, 2006 Author Share Posted July 6, 2006 (edited) 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 July 6, 2006 by marfdaman Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
RazerM Posted July 6, 2006 Share Posted July 6, 2006 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 More sharing options...
marfdaman Posted July 7, 2006 Author Share Posted July 7, 2006 (edited) Decided to add my other UDF as well, see first post. Edited July 7, 2006 by marfdaman Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
jpam Posted July 7, 2006 Share Posted July 7, 2006 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 Recards JPAM ps; Superslim bedacht man ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now