Jump to content

Picture Based GUI Control


Dhilip89
 Share

Recommended Posts

There is some demo that show how picture based control work.

Picture Based Button:

http://www.autoitscript.com/forum/index.php?showtopic=35315

Picture Based ProgressBar:

ScreenShot:

Posted Image

Download:

http://dhilip89.serveftp.com/files/PicProgressBar.zip

Edited by Dhilip

[u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote]

Link to comment
Share on other sites

Code Update:

Replace all with this:

#include <GUIConstants.au3>
$A = 72
$B = 64
$C = 2
$D = 15
$E = 1
$F = 0
Dim $Pic[1000]
$Form1 = GUICreate("Picture Based ProgressBar Demo", 352, 150, 297, 277)
GUISetBkColor(0xFFFFFF)
$PicS = GUICtrlCreatePic("bitmap\A1.bmp", 72, 64, 2, 15, BitOR($SS_NOTIFY,$WS_GROUP))
For $i = 0 To 200 Step 1
$A = $A + $E
    $Pic[$i] = GUICtrlCreatePic("bitmap\A3.bmp", $A, 64, 2, 15, BitOR($SS_NOTIFY,$WS_GROUP))
    Next
    $PicE = GUICtrlCreatePic("bitmap\A2.bmp", $A +1, 64, 2, 15, BitOR($SS_NOTIFY,$WS_GROUP))
$Label1 = GUICtrlCreateLabel("Progress: 0 %", 16, 20, 200,29)
GUICtrlSetFont(-1, 9, 800, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Button1 = GUICtrlCreateButton("&Reverse", 268, 116, 75, 25, 0)
$Button2 = GUICtrlCreateButton("&Start", 188, 116, 75, 25, 0)
WinSetTrans($Form1, "", 0)
GUISetState(@SW_SHOW)
GUICtrlSetState($Button1, $GUI_DISABLE)
If @OSVersion <> "WIN_NT4" And @OSVersion <> "WIN_ME" And @OSVersion <> "WIN_98" And @OSVersion <> "WIN_95" And @OSVersion <> "WIN_6.0" And @OSVersion <> "WIN_6.1" Then
    For $transcount = 0 To 255 Step 17
        WinSetTrans($Form1, "", $transcount)
        Sleep(11)
    Next
EndIf


While 1
        $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            If @OSVersion <> "WIN_NT4" And @OSVersion <> "WIN_ME" And @OSVersion <> "WIN_98" And @OSVersion <> "WIN_95" And @OSVersion <> "WIN_6.0" And @OSVersion <> "WIN_6.1" Then
            For $transcount = 255 To 0 Step -17
                WinSetTrans($Form1, "", $transcount)
                Sleep(11)
            Next
        EndIf
        Exit
        Case $Button2
    GUICtrlSetState($Button2, $GUI_DISABLE)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetImage($PicS, "bitmap\B1.bmp")
    For $i = 0 To 200 Step 1
        GUICtrlSetData($Label1, "Progress: " & StringFormat("%.0f",$i/200 * 100) & " %" )
        GUICtrlSetImage($Pic[$i],"bitmap\A4.bmp")
        Sleep(12)
    Next
    GUICtrlSetImage($PicE, "bitmap\B2.bmp")
    GUICtrlSetState($Button1, $GUI_ENABLE)
Case $Button1
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetState($Button2, $GUI_DISABLE)
    GUICtrlSetImage($PicE, "bitmap\A2.bmp")
    For $i = 200 To 0 Step -1
        GUICtrlSetData($Label1, "Progress: " & StringFormat("%.0f",$i/200 * 100) & " %" )
        GUICtrlSetImage($Pic[$i],"bitmap\A3.bmp")
        Sleep(12)
    Next
    GUICtrlSetImage($PicS, "bitmap\A1.bmp")
    GUICtrlSetState($Button2, $GUI_ENABLE)
    EndSwitch
WEnd

[u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote]

Link to comment
Share on other sites

It will be more usefull if you write it again in UDF form :whistle:

I made an experimental UDF code, It's buggy.

Download : http://dhilip89.serveftp.com/files/PicProg...perimental).zip

You may help to update this code.

[u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote]

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...