Jump to content
Sign in to follow this  
fisheronline

AutoIt, "X" time progress bar on button?

Recommended Posts

fisheronline

Just got auto it, I have a form and I want to add a progress bar which fills up to 100% when a button is pressed, how do I make it so when a button is used the progress bar fills in an "X" amount of time?

Edited by fisheronline

Share this post


Link to post
Share on other sites
fisheronline

no one?

Share this post


Link to post
Share on other sites
fisheronline

why would I be kidding, all I want to know is how to implement my progress bar to take an X amount of time to fill when a button is pressed

Share this post


Link to post
Share on other sites
FireFox

You would be kidding to remove the keygen word from your topic's title.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Jos

So you feel it is reasonable to bump a post after 19 minutes?

Maybe you need to start reading our Forumrules and show a little effort first.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
fisheronline

or maybe someone could point me in the right direction rather than replying and criticizing someone looking for a tip

Share this post


Link to post
Share on other sites
fisheronline

Look in help file at GUICtrlCreateProgress()

It has example.

I have literally just got this programme, I have no idea what to type, the example is alone is longer than my whole script. :S

Share this post


Link to post
Share on other sites
Edano

you say you have a form and a script. please post it so we can help.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
fisheronline

you say you have a form and a script. please post it so we can help.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=form2.kxf
$form2 = GUICreate("form2", 621, 251, 204, 205)
$Pic1 = GUICtrlCreatePic("C:\Users\Jack\Desktop\PPD Files\Skin.jpg", 0, 0, 620, 124)
$Radio1 = GUICtrlCreateRadio("option 1", 20, 150, 113, 17)
$Radio2 = GUICtrlCreateRadio("option 2", 160, 150, 113, 17)
$Radio3 = GUICtrlCreateRadio("option 3", 20, 180, 113, 17)
$Radio4 = GUICtrlCreateRadio("option 4", 160, 180, 113, 17)
$Radio5 = GUICtrlCreateRadio("option 5", 20, 210, 113, 17)
$Radio6 = GUICtrlCreateRadio("option 6", 160, 210, 113, 17)
$Button1 = GUICtrlCreateButton("Generate", 360, 144, 187, 57)
$Progress1 = GUICtrlCreateProgress(360, 210, 187, 17, BitOR($PBS_SMOOTH,$WS_BORDER))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $form2
    EndSwitch
WEnd

ok that is my code, it has just basic radio buttons as options and a button, I wanted to know how to make it so when the button is pressed the progress bar I have will take an X amount of time to fill and then once done pop up with a message of my choice.

this is my first code and I made it using Koda so if you tell me the script I need to add into it please show me where :D

Share this post


Link to post
Share on other sites
Melba23

fisheronline,

I would do it like this: ;)

#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>

$form2 = GUICreate("form2", 621, 251, 204, 205)
$Radio1 = GUICtrlCreateRadio("option 1", 20, 150, 113, 17)
$Radio2 = GUICtrlCreateRadio("option 2", 160, 150, 113, 17)
$Radio3 = GUICtrlCreateRadio("option 3", 20, 180, 113, 17)
$Radio4 = GUICtrlCreateRadio("option 4", 160, 180, 113, 17)
$Radio5 = GUICtrlCreateRadio("option 5", 20, 210, 113, 17)
$Radio6 = GUICtrlCreateRadio("option 6", 160, 210, 113, 17)
$Button1 = GUICtrlCreateButton("Generate", 360, 144, 187, 57)
$Progress1 = GUICtrlCreateProgress(360, 210, 187, 17, BitOR($PBS_SMOOTH,$WS_BORDER))
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            ; Start a loop
            For $i = 1 To 100
                ; Increase the progress bar
                GUICtrlSetData($Progress1, $i + 1) ; I find this gives a better response
                GUICtrlSetData($Progress1, $i)
                ; Wait a bit
                Sleep(100)
            Next
            ; Show the MsgBox
            MsgBox($MB_SYSTEMMODAL, "Hi", "Generated whatever it is!")
            ; Reset the progress bar
            GUICtrlSetData($Progress1, 0)
    EndSwitch
WEnd

All clear? :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
fisheronline

ok so I just go into edit script and replace it with all of that and then add labels?

Share this post


Link to post
Share on other sites
Melba23

fisheronline,

I would suggest that you make sure you undrstand what is going on in the script I posted before just pasting it into your own version or you will be back here in no time saying it does not work. ;)

For example, you will need to add code to do whatever it is happens when the "Generate" button is pressed, determine how long you want the progress bar to take to fill, and to read the option radios (otherwise why are they there?). :)

If this is your first script, just take it slowly and make sure you know why you are using certain code elements rather then just pasting chunks of other people's code into yours and expecting it to integrate without problem. ;)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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  

×