Jump to content



Photo

GUI Enhance


  • Please log in to reply
26 replies to this topic

#1 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 05 September 2007 - 06:07 PM

I have made some functions for "enhancing" how a GUI is dynamically changed, to create visually better transitions. My aim was to make easy to use GUI effects and have the ability for simplistic GUIs with visual changes to help user see what's going on.

Window Functions:
_GUIEnhanceAnimateTitle - animates the title of a window
_GUIEnhanceScaleWin - resizes a window step by step to create a smooth resize
_GUIEnhanceAnimateWin - Animates a window when showing/hiding (originally posted by raindancer)

Control Functions:
_GUIEnhanceCtrlFade - Fades a controls foreground and/or background colours
_GUIEnhanceCtrlDrift - Moves a control smoothly

There are only a few so far but I'll think of more effects etc

Include file:
Attached File  GUIEnhance.au3   13.57K   2053 downloadsPrevious Downloads: 259

Example showing all functions:
Attached File  test.au3   2.92K   1850 downloadsPrevious Downloads: 57

Simple example showing one possible use:
Attached File  test2.au3   2.29K   1533 downloads

Update 01:
  • Paramater added to _GUIEnhanceScaleWin. If true, gui centres relative to previous position. Parameter order different to previous function.
  • Paramater added to _GUIEnhanceCtrlFade (at end), adds option of how many colour changes (more is smooth but flickers more, less won't flicker as much but may appear to "jump" colours.
Update 02: All variables declared local, now works with MustDeclareVars option (Thanks MCP)

Edited by RazerM, 11 October 2007 - 03:38 PM.

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.





#2 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 05 September 2007 - 06:59 PM

Cool ideas!!! Razer


... keep up the great work!!!

8)

Edited by Valuater, 11 October 2007 - 03:45 PM.

Posted Image

Clic The Pic!!!


#3 fisofo

fisofo

    If you can read this, then I suck at being a ninja

  • Active Members
  • PipPipPipPipPipPip
  • 374 posts

Posted 05 September 2007 - 07:00 PM

Awesome! I could have used this one a while back :)

It seems like the fade (esp. to black) on the labels is still not great (flickers a good deal), but otherwise the effects are really nice.... thank you!
SplitMon: Window Management SuiteSudoku-It!: An all-in-one Sudoku Generator/Solver

#4 gseller

gseller

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,057 posts

Posted 05 September 2007 - 07:16 PM

Oh Baby! That is too cool. I love the radio buttons changing the position and adding or taking away the button. Looking forward to seeing more examples...

edit: Cool Valuater, Just got your example working. Pretty neat entrances...

Edited by gesller, 05 September 2007 - 08:06 PM.


#5 _Kurt

_Kurt

    I can only imagine the world without Autoit (see above)

  • Active Members
  • PipPipPipPipPipPip
  • 865 posts

Posted 05 September 2007 - 08:20 PM

Wow, looks great. Good work, very interesting functions, espescially __ColorGradient().

Maybe there should be an option for _GUIEnhanceScaleWin so that if you want you could re-scale the GUI, but always keeping it centered from it's original position (I'm not the best at explaining). So for example say you have a GUI at 100,100,200,200 (X,Y,W,H), and I wanted to resize my GUI to 300 width & 300 height, the final coordinates would be 50,50,300,300. Using WinGetPos it should be easy to add something like this in (maybe add another parameter if people don't want it to resize like that).

Just an idea :)
Kurt
Awaiting Diablo III..

#6 WeMartiansAreFriendly

WeMartiansAreFriendly

    Where's the kaboom?

  • Active Members
  • PipPipPipPipPipPip
  • 1,245 posts

Posted 05 September 2007 - 08:53 PM

Great work!

You should add this: http://www.autoitscript.com/forum/index.ph...st&p=390847
Posted ImageDon't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

#7 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 05 September 2007 - 09:24 PM

@mrRevoked
Good idea, i'll add it in soon

@Valuater
I'll play around with your function.. Thanks

@Kurt
Yes I never thought about that, good idea! I like the function a lot and hope to improve it by adding centering (optional)
CoePSX is author of gradient function, I love it :)

@fisofo
Fading cannot be improved easily (I have a few things in mind though.)
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.

#8 MCP

MCP

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 06 September 2007 - 07:33 AM

I have made some functions for "enhancing" how a GUI is dynamically changed, to create visually better transitions. My aim was to make easy to use GUI effects and have the ability for simplistic GUIs with visual changes to help user see what's going on.


Thank you, dude! Nice job. It has been easy to add it to the project I am currently working on. Keep up the good work.

#9 James

James

    jbrooksuk

  • MVPs
  • 9,468 posts

Posted 06 September 2007 - 08:12 AM

Do you have a screenshot of what this can do? Im at college at the moment and I want to see what its like before I use all my bandwidth (we have this weird system in college)...

#10 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 06 September 2007 - 09:22 AM

@all

It would be nice to group them all together.

This is something I found in the old box :

AutoIt         
;K2000 animation 2006 By Arcker ;For The AutoIt community #include <GUIConstants.au3> ;Dim $light[9],$lightvalue[9] _display_progress("AUTO IT VERSION 3.2.X.X", 1, 0x040000, 0xff0000, -1, 25, 30, 5, 0,3) GUISetState(@sw_hide) sleep(100) _display_progress("And his community", 1, 0x040000, 0xff0000, -1, 10, 30, 5, 2,6) GUISetState(@sw_hide) sleep(100) _display_progress("Wish you a merry christmas ", 1, 0x040000, 0xff0000, -1, 20, 30, 5, 1,4) GUISetState(@sw_hide) sleep(100) _display_progress("and a happy new year ", 1, 0x040FFF, 0xffFF00, -1, 20, 30, 5, 1,4) GUISetState(@sw_hide) sleep(100) _display_progress(" thanx for this year of code addicting ", 1, 0x040FFF, 0xffFF00, -1, 10, 30, 5, 1,4) GUISetState(@sw_hide) sleep(100) _display_progress("  LONG LIFE TO AUTOIT  ", 1, 0x0F0F0F, 0xffFFFF, -1, 150, 40, 15, 1,4) Func _display_progress($size = 5, $sizevaluefade = 1, $valuefade = 0x110000, $valuemaxcolor = 0xff0000, $croissance = -1, $delay = 50, $itemwidth = 20, $itemspace = 5, $switch = 0,$limit=0)     Dim $tabsize, $istring = 0     If IsInt($size) Then         $size = $size     Else         $string = $size         $size = StringLen($size)         $istring = 1     EndIf     $tabsize = $size - 1     $middle = Mod($size, 2)     If $middle = 0 Then Exit     $middle = $size / 2 - 0.5     ConsoleWrite("middle = > " & $middle & @CRLF)     Dim $light[$size], $lightvalue[$size], $currentheight[$size], $currentwidth[$size], $sizevalue[$size]     ConsoleWrite("value fade => " & $valuefade)     ;ConsoleWrite(Int($valuemax))     $widthtoset = $itemwidth + $itemspace     $width = 10 + $size * $widthtoset     $height = 25 + $size     $setheight = $height - $size - 5     $Form1 = GUICreate("AForm1", $width, $height, -1, -1, $WS_POPUP)     $totalsize = 20 + $size     If $croissance = -1 Then         $valuemax = $totalsize     Else         $valuemax = 3     EndIf     $widthset = 5     For $i = 0 To $middle - 1         $currentwidth[$i] = $widthset         $light[$i] = GUICtrlCreateLabel("", $widthset, $setheight - $i, $itemwidth, $i + $size)         GUICtrlSetBkColor(-1, $valuemaxcolor)         If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1))         GUICtrlSetFont(-1, $size * 1.4, 800)         $widthset += $widthtoset     Next     $light[$middle] = GUICtrlCreateLabel("", $widthset, $setheight - $middle, $itemwidth, $middle + $size)     GUICtrlSetBkColor(-1, $valuemaxcolor)     If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1))     GUICtrlSetFont(-1, $size * 1.4, 800)     $currentwidth[$middle] = $widthset     $widthset += $widthtoset     ;$setheight = 0;$middle - 1     $k = 0     ;$scale = $size -29     $itemheight = $setheight - $middle + 1     $itemsize = $middle + $size - 1     For $i = $middle + 1 To $tabsize         $currentwidth[$i] = $widthset         $light[$i] = GUICtrlCreateLabel("", $widthset, $itemheight, $itemwidth, $itemsize)         GUICtrlSetBkColor(-1, $valuemaxcolor)         If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1))         GUICtrlSetFont(-1, $size * 1.4, 800)         $widthset += $widthtoset         $itemheight += 1         $itemsize -= 1     Next     GUISetState(@SW_SHOW)     GUISetBkColor(0x000000)     AdlibEnable("messageHandler", 50)     $countlimit=1     While 1         If $limit = 0 Then             ;ContinueLoop         Else             If $countlimit = $limit Then ExitLoop             $countlimit += 1         EndIf         For $i = 0 To $tabsize             $lightvalue[$i] = $valuemaxcolor             $sizevalue[$i] = $valuemax             ;$switch = 0             GUICtrlSetBkColor($light[$i], $valuemax)             ;pour tous les éléments APRES la lumière "principale"             If $i <= $tabsize Then                 For $current = $i + 1 To $tabsize                     If $croissance = -1 Then                         $sizevalue[$current] -= $sizevaluefade                     Else                         $sizevalue[$current] += $sizevaluefade                     EndIf                     Switch $switch                         Case 0                             GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $itemwidth, $sizevalue[$current])                         Case 1                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]) / 2, $itemwidth, $sizevalue[$current])                         Case 2                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]), $itemwidth, $sizevalue[$current])                     EndSwitch                     $lightvalue[$current] -= $valuefade                     GUICtrlSetBkColor($light[$current], $lightvalue[$current])                 Next             EndIf             If $i > 0 Then                 For $current = $i - 1 To 0 Step - 1                     If $croissance = -1 Then                         $sizevalue[$current] -= $sizevaluefade                     Else                         $sizevalue[$current] += $sizevaluefade                     EndIf                     Switch $switch                         Case 0                             GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $itemwidth, $sizevalue[$current])                         Case 1                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]) / 2, $itemwidth, $sizevalue[$current])                         Case 2                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]), $itemwidth, $sizevalue[$current])                     EndSwitch                     $lightvalue[$current] -= $valuefade                     GUICtrlSetBkColor($light[$current], $lightvalue[$current])                 Next             EndIf             Sleep($delay)         Next                         For $i = $tabsize To 0 Step - 1             $lightvalue[$i] = $valuemaxcolor             $sizevalue[$i] = $valuemax             GUICtrlSetBkColor($light[$i], $valuemax)             ;pour tous les éléments APRES la lumière "principale"             If $i < $tabsize Then                 For $current = $i + 1 To $tabsize                     If $croissance = -1 Then                         $sizevalue[$current] -= $sizevaluefade                     Else                         $sizevalue[$current] += $sizevaluefade                     EndIf                     Switch $switch                         Case 0                             GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $itemwidth, $sizevalue[$current])                         Case 1                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]) / 2, $itemwidth, $sizevalue[$current])                         Case 2                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]), $itemwidth, $sizevalue[$current])                     EndSwitch                     $lightvalue[$current] -= $valuefade                     GUICtrlSetBkColor($light[$current], $lightvalue[$current])                 Next             EndIf             If $i > 0 Then                 For $current = $i - 1 To 0 Step - 1                     If $croissance = -1 Then                         $sizevalue[$current] -= $sizevaluefade                     Else                         $sizevalue[$current] += $sizevaluefade                     EndIf                     Switch $switch                         Case 0                             GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $itemwidth, $sizevalue[$current])                         Case 1                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]) / 2, $itemwidth, $sizevalue[$current])                         Case 2                             GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $sizevalue[$current]), $itemwidth, $sizevalue[$current])                     EndSwitch                     $lightvalue[$current] -= $valuefade                     GUICtrlSetBkColor($light[$current], $lightvalue[$current])                 Next             EndIf             Sleep($delay)         Next     WEnd EndFunc   ;==>_display_progress Func messageHandler()     If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit EndFunc   ;==>messageHandler


And there where more.

If I find more I will post them.

Regards

ptrex

#11 WolfWorld

WolfWorld

    Mr.Terminator

  • Active Members
  • PipPipPipPipPipPip
  • 646 posts

Posted 06 September 2007 - 09:30 AM

Very Nice

#12 gseller

gseller

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,057 posts

Posted 06 September 2007 - 02:34 PM

Sweet!

#13 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 06 September 2007 - 05:31 PM

See update log in first post, _GUIEnhanceScaleWin centre is very nice. :)
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.

#14 Armand

Armand

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 541 posts

Posted 20 September 2007 - 11:29 AM

interesting & very usefull !!!

#15 MCP

MCP

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 11 October 2007 - 08:11 AM

@RazerM

Running your nice include with Opt('MustDeclareVars', 1), I have found a few undeclared (thus unwillingly defined global) scopes.
  • In _GUIEnhanceScaleWin, variable $iWidthDiff
  • In _GUIEnhanceCtrlDrift, variables $iDeltaX, $iDeltaY, $iError, $iDeltaError, $iYVal, $iYStep
  • In __ColorGradient, variables: $iNowBlue, $iNowGreen
Thanks! and HTH

#16 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 11 October 2007 - 03:39 PM

Thanks, the errors are fixed, download in first post.

Glad you like it.
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.

#17 Spymode

Spymode

    Seeker

  • New Members
  • 2 posts

Posted 05 January 2008 - 11:22 AM

Thanks RazerM :)

#18 WeMartiansAreFriendly

WeMartiansAreFriendly

    Where's the kaboom?

  • Active Members
  • PipPipPipPipPipPip
  • 1,245 posts

Posted 19 September 2008 - 05:35 AM

This is really cool, RazerM! :)
Posted ImageDon't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

#19 ChromeFan

ChromeFan

    Universalist

  • Banned (NOT IN USE)
  • 280 posts

Posted 19 September 2008 - 11:48 AM

it's really a very good script, i am in love with it. thanks for the best GUI Enhancer UDF :)
Posted ImageWebsite: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, ‘What happened?’” –Casey Stengel

#20 DeeRiee

DeeRiee

    Wayfarer

  • Active Members
  • Pip
  • 89 posts

Posted 22 September 2008 - 09:45 AM

Hello, Your UDF is Very Cool!! >_<
but, if i used in my gui even in your example, there is a little black on topleft and topright corner of gui...

look at this
Posted Image


Can It Disappeared??
It's look not good for me... :)

Edited by member429, 22 September 2008 - 09:50 AM.

Sorry 4 Bad English, I'm Indonesian...I'm really need 'Translator' for helping me posting in this forum (http://deeriee.wordpress.com)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users