找回密码
 加入
搜索
查看: 193747|回复: 110

[特效] GDI进度条 [转自官网]

 火... [复制链接]
发表于 2010-2-6 11:02:26 | 显示全部楼层 |阅读模式
请看图和附件
#include <GDIpProgress.au3>
;##################################
; EXAMPLE
#Region EXAMPLE

$Gui = GUICreate("Gradient ProgressBar", 400, 350)

;Progress 1 + Controls
$slid = GUICtrlCreateSlider(5, 20, 310, 30) ;; check only for first bar
$Status_Label = GUICtrlCreateLabel("0%", 330, 30, 30, 20)
$btn_0 = GUICtrlCreateButton("0", 2, 100, 15, 25, 0)
$btn_25 = GUICtrlCreateButton("25", 20, 100, 75, 25, 0)
$btn_50 = GUICtrlCreateButton("50", 120, 100, 75, 25, 0)
$btn_75 = GUICtrlCreateButton("75", 220, 100, 75, 25, 0)
$btn_cl1 = GUICtrlCreateButton("Colors 1", 20, 140, 75, 25, 0)
$btn_cl2 = GUICtrlCreateButton("Colors 2", 220, 140, 75, 25, 0)
$btn_vistOK = GUICtrlCreateButton("Vista OK", 220, 180, 75, 25, 0)
$btn_vistError = GUICtrlCreateButton("Vista Error", 220, 210, 75, 25, 0)
$btn_vistPause = GUICtrlCreateButton("Vista Pause", 220, 240, 75, 25, 0)
$btn_txt = GUICtrlCreateButton("Set Text", 100, 180, 75, 25, 0)
$in_txt = GUICtrlCreateInput("%P%", 20, 180, 75, 25, 0)
GUICtrlSetTip(-1, "Use %P% to show Percentage" & @CRLF & "Leave empty to show no text")
$sID = _ProgressCreate(10, 60, 300, 40)
_ProgressSetText($sID, "Install %P%%")

; End Progress 1 + Controls

;Progress 2 + Controls
$Progress2 = _ProgressCreate(10, 280, 300, 20)
_ProgressSet($Progress2, 43)
$input = GUICtrlCreateInput("43", 320, 280, 50, 20, $ES_NUMBER)
GUICtrlSetLimit($input, 3, 1)
$updown = GUICtrlCreateUpdown($input)
GUICtrlSetLimit($updown, 100, 0)
;End Progress 2 + Controls

;Progress Marquee + Controls
$PMarquee = _ProgressCreate(10, 310, 300, 30)
_ProgressSetImages($PMarquee, @ScriptDir & "\prgimgs\marquee.jpg", @ScriptDir & "\prgimgs\bg.jpg")
_ProgressMarquee($PMarquee, 2, 0)
$marVist = GUICtrlCreateCheckbox("Vista Style",315,315,100,20)
GUICtrlSetState(-1,$GUI_CHECKED)
;End Progress Marquee + Controls

GUISetState()

While 1

        $nMsg = GUIGetMsg()
        Switch $nMsg

                Case $btn_0
                        _ProgressSet($sID, 0)
                        GUICtrlSetData($slid, 0)
                Case $btn_25
                        _ProgressSet($sID, 25)
                        GUICtrlSetData($slid, 25)
                Case $btn_50
                        _ProgressSet($sID, 50)
                        GUICtrlSetData($slid, 50)
                Case $btn_75
                        _ProgressSet($sID, 75)
                        GUICtrlSetData($slid, 75)
                        
                Case $btn_cl1
                        _ProgressSetColors($sID, 0xFF0000, 0x00FF00, 0xA1B0BB, 0x4455FF)
                        _ProgressSetFont($sID, "", -1, -1, 0xFFBBBBFF, True)
                Case $btn_cl2
                        _ProgressSetColors($sID, 0x89A49B, 0xF0D6C7, 0xFFFFFF, 0xFFFFFF)
                        _ProgressSetFont($sID, "", -1, -1, 0x000000)
                Case $btn_vistOK
                        _ProgressSetImages($sID, @ScriptDir & "\prgimgs\green.jpg", @ScriptDir & "\prgimgs\bg.jpg")
                        _ProgressSetFont($sID, "", -1, -1, 0x0000FF)
                Case $btn_vistPause
                        _ProgressSetImages($sID, @ScriptDir & "\prgimgs\yellow.jpg", @ScriptDir & "\prgimgs\bg.jpg")
                        _ProgressSetFont($sID, "", -1, -1, 0xFF0000)
                Case $btn_vistError
                        _ProgressSetImages($sID, @ScriptDir & "\prgimgs\red.jpg", @ScriptDir & "\prgimgs\bg.jpg")
                        _ProgressSetFont($sID, "", -1, -1, 0x000000)
                        
                Case $btn_txt
                        _ProgressSetText($sID, GUICtrlRead($in_txt))
                Case $input, $updown
                        _ProgressSet($Progress2, GUICtrlRead($input))
                        
                Case $marVist
                        If BitAND(GUICtrlRead($marVist),$GUI_CHECKED) = $GUI_CHECKED Then
                                _ProgressSetImages($PMarquee, @ScriptDir & "\prgimgs\marquee.jpg", @ScriptDir & "\prgimgs\bg.jpg")
                        Else
                                _ProgressSetColors($PMarquee, 0xFFFF00, 0x00FF00, 0xAAAA00, 0xFF0000)
                                _ProgressMarquee($PMarquee, 2, 1)
                        EndIf
                        
                Case $GUI_EVENT_CLOSE
                        _ProgressDelete($sID) ; MUST BE DONE ON EXIT
                        _Progress_CallBack_Free(1) ; Force Killing Timer

                        _GDIPlus_Shutdown()

                        Exit
        EndSwitch

        If $iPercent <> GUICtrlRead($slid) Then
                $iPercent = GUICtrlRead($slid)
                GUICtrlSetData($Status_Label, $iPercent & "%")
                _ProgressSet($sID, $iPercent)
        EndIf


WEnd

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-2-6 11:15:18 | 显示全部楼层
下载附件不要钱,真不错。
 楼主| 发表于 2010-2-6 11:17:01 | 显示全部楼层
下载附件不要钱,真不错。
lpxx 发表于 2010-2-6 11:15



    那是自然,新版块嘛
发表于 2010-2-6 12:01:26 | 显示全部楼层
支持一下。
发表于 2010-2-6 13:47:09 | 显示全部楼层
喜欢,而且免费
发表于 2010-2-6 14:11:55 | 显示全部楼层
那是自然,新版块嘛
kn007 发表于 2010-2-6 11:17


要是。。。
要是你是国家银行总裁多好。。。。
 楼主| 发表于 2010-2-7 07:20:22 | 显示全部楼层
要是。。。
要是你是国家银行总裁多好。。。。
lpxx 发表于 2010-2-6 14:11



    `````

服了你了
发表于 2010-2-7 09:04:56 | 显示全部楼层
这个不错   
发表于 2010-2-7 12:56:07 | 显示全部楼层
哈哈,我也来享受一下不花钱的心情
发表于 2010-2-7 15:04:45 | 显示全部楼层
免费又实用的东西就是好
发表于 2010-2-25 20:34:59 | 显示全部楼层
真好,不花钱又能下到好东西!
发表于 2010-3-5 13:37:33 | 显示全部楼层
这么好的东西,下了回复个。。。。
发表于 2010-3-6 10:10:14 | 显示全部楼层
回复 1# kn007


    下载附件不要钱,真不错。
发表于 2010-3-10 21:38:07 | 显示全部楼层
多谢楼主分享, 下载附件不要钱,真不错。
发表于 2010-3-11 08:51:50 | 显示全部楼层
顶一个,支持下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-19 00:30 , Processed in 0.080971 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表