Jump to content

How to code Progress Bar and UpDown objects


 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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