AlchemistZim Posted August 31, 2010 Share Posted August 31, 2010 I'm trying to create a progres bar something like the Win XP Boot screen that just loops infinitely while a function is running. I'm extremely new to this and am just trying to give users a way to know if the program is working or not. Because there maybe multiple steps to the functions I'm also trying to display text in the GUI saying which steps are currently running, and which ones are done, and will clear the area, when another button is pressed. Below is an example of what I want a function to do. Any help is appreciated. Thanks in advance!!! Func script() *Start busy bar* *Clear gui area for text* *Display "step 1..." in gui step 1 *Display "step 1...Done" in gui *Display "Step 2..." in gui step 2 *Display "Step 2...Done" in gui * Stop busy bar* EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 31, 2010 Moderators Share Posted August 31, 2010 AlchemistZim,Welcome to the AutoIt forum. The infinite progress you are looking for is known as a "marquee" progress and is created thus:#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndAs to the list of steps, take a look at GUICtrlCreateList in the Help file - it should do just what you need. If you are new to scripting, then reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading.I know you want to start coding NOW, but a little study will save you a lot of trouble later on, believe me. Give it a go yourself - you know where we are if you run into diffculties. M23 ss26 1 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AlchemistZim Posted August 31, 2010 Author Share Posted August 31, 2010 AlchemistZim, Welcome to the AutoIt forum. The infinite progress you are looking for is known as a "marquee" progress and is created thus: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd As to the list of steps, take a look at GUICtrlCreateList in the Help file - it should do just what you need. If you are new to scripting, then reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. I know you want to start coding NOW, but a little study will save you a lot of trouble later on, believe me. Give it a go yourself - you know where we are if you run into diffculties. M23 i've been using batch scripts since i started working on computers, but you can only go so far with those. in a day with the help files, and the forum i've done alot check it out. the problem that i was having with this was that i didn't know the correct terminolgy to use when searching for answers...ex. marquee vs progress...thanks for the help. PS...AutoIt is amazing, and a huge thanks to the author of KodaPNC.au3 Link to comment Share on other sites More sharing options...
JohnOne Posted August 31, 2010 Share Posted August 31, 2010 Never new how to do them, thanks M23 how about an alternative vertical one #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 20, 400, BitOR($PBS_MARQUEE,$PBS_VERTICAL)) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 20) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
AlchemistZim Posted September 1, 2010 Author Share Posted September 1, 2010 ok i've figured out the list box and the marquee, the one problem that i'm running into is updating an already existing line. Below will add a line to the list, but how do i update an existing line. basically how do i change text on an existing line??? expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add1, $add2, $add3, $clear, $mylist, $close, $msg GUICreate("My GUI list") ; will create a dialog box that when displayed is centered $add1 = GUICtrlCreateButton("Add-1", 64, 32, 75, 25) $add2 = GUICtrlCreateButton("Add-2", 64, 64, 75, 25) $add3 = GUICtrlCreateButton("Add-3", 64, 96, 75, 25) $clear = GUICtrlCreateButton("Clear", 64, 128, 75, 25) $mylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 200, 97) GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling GUICtrlSetData(-1, $MESSAGE) $close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $add1 GUICtrlSetData($mylist, "You clicked button No1|") Case $msg = $add2 GUICtrlSetData($mylist, "You clicked button No2|") Case $msg = $add3 GUICtrlSetData($mylist, "You clicked button No3|") Case $msg = $clear GUICtrlSetData($mylist, "") Case $msg = $close MsgBox(0, "", "the closing button has been clicked", 2) Exit EndSelect WEnd EndFunc ;==>Example Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now