Sign in to follow this  
Followers 0
AndrewL

How to code Progress Bar and UpDown objects

5 posts in this topic

#1 ·  Posted (edited)

I've traditionally used the default AutoIT progress functions as part of my installer scripts and am considering using the new GUI functionality. I used AutoBuilder 0.4 to construct the shell code at the bottom. What I need is the additional code to populate the position in the progress bar and the text in the updown list with the following stages:

0% - Installer Started

25% - Extracted Files

50% - Installation Completed

75% - Configuration Completed

100% - Installer Completed

Can someone help me fill in the blanks please?

:D

Shell Code below->>>>>>>>

;Script generated by AutoBuilder 0.4

Opt("GUICoordMode", 1)

Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 331,144,(@DesktopHeight-331)/2, (@DesktopHeight-144)/2 , 0x04CF0000)

$progress_1 = GUISetControl("progress", "Progress 1", 20, 30, 290, 30)

$updown_1 = GUISetControl("updown", "Updown 1", 20, 80, 290, 60)

GuiShow()

While 1

sleep(100)

$msg = GuiMsg(0)

Select

Case $msg = -3

Exit

Case $msg = 0

;;;

Case $msg = $progress_1

;;;

Case $msg = $updown_1

;;;

EndSelect

WEnd

Exit

Edited by AndrewL

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

The progressbar-percent you can set either with:

GUISetControlEx($progress_1,50); where 50 means 50%

or

GUIWrite($progress_1,50)
Thanks.

Therefore, can I use GUISetControlEx or GUIWrite to write a line of text such as 0% - Installer Started to the $updown_1 as well?

Edited by AndrewL

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Here is an old sample of UPDOWN-controls:

$title = "My Guy UpDown"
GUICreate($title)

$input = GUISetControl("input","2",10,10)
$updown = GUISetControl("updown",$input,0,0)
GuiSetControlEx(-1,0,0,"",2,10); means only 'scrollable from 2 to 10
GuiWaitClose()

msgbox(0,"Updown",GuiRead($input),2)

So you could use UPDown-controls only together with Input-controls!

The values for the updown-limit are not written in the help-file, but I've looked into an old testfile from jpm :D

Edited by Holger

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thanks. I'll experiment now!

:D

Edited by AndrewL

Share this post


Link to post
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
Sign in to follow this  
Followers 0