Jump to content

Colored process udf


 Share

Recommended Posts

i think that could be quite useful....

#include <GuiConstants.au3>
DIM $process[2]


GuiCreate("Colored process", 441, 155,(@DesktopWidth-441)/2, (@DesktopHeight-155)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$start = GuiCtrlCreateButton("OK", 10, 120, 180, 30)
$Label_2 = GuiCtrlCreateLabel("", 20, 30, 400, 30)
$exit = GuiCtrlCreateButton("Exit", 250, 120, 180, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE or $msg = $exit
        ExitLoop
    Case $msg = $start
        _createcolorprocess(000000, 16711680, 20, 30,  400,  30)
        sleep(2000)
            _setcprocess(10, 20, 30, 400)
            sleep(500)
            _setcprocess(20, 20, 30, 400)
            sleep(500)
            _setcprocess(30, 20, 30, 400)
            sleep(500)
            _setcprocess(40, 20, 30, 400)
            sleep(500)
            _setcprocess(50, 20, 30, 400)
            sleep(500)
            _setcprocess(60, 20, 30, 400)
            sleep(500)
            _setcprocess(70, 20, 30, 400)
            sleep(500)
            _setcprocess(80, 20, 30, 400)
            sleep(500)
            _setcprocess(90, 20, 30, 400)
            sleep(500)
            _setcprocess(100, 20, 30, 400)
            sleep(500)
    EndSelect
WEnd
Exit





func _createcolorprocess($bgcolor, $fgcolor, $left, $top, $with, $height)
    DIM $process[2]
    $process[0] = GuiCtrlCreateLabel("", $left, $top, $with, $height, $ss_center)
        GUICtrlSetBkColor(-1, $bgcolor)
    $process[1] = GuiCtrlCreateLabel("", $left, $top, 1, $height)
        GUICtrlSetBkColor(-1, $fgcolor)
EndFunc

func _setcprocess($perc, $left, $top, $with)
    $allperc = $with / 100
    GUICtrlSetPos($process[1], $left, $top, $allperc * $perc)
EndFunc

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Link to comment
Share on other sites

Nice alternative to the standard progress bar.

Good Job! :)

Note: I think you meant to call it progress not process.

Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
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...