makeinstall Posted December 3, 2009 Share Posted December 3, 2009 (edited) I'm trying to work out the best way to get simple visual feedback of what the script is doing but without using msgbox as I do not want the script to pause, awaiting user input. For instance, one script I'm working on downloads a zip file from a server and displays a progress bar but leading up to that, it checks the local folder structure exists [if not, creates] and if a copy of the file exists locally & deletes if it does. How can I have a simple panel that says something like?: - checking if folder structure exists.... - it does not so will create.... - folders created. - checking if remote file exists.... - it does. beginning download.... etc etc There might be a very simple solution but I haven't really done anything with a GUI as of yet so its all new territory and everything I have read so far has been confusing so I would really appreciate if anyone could tell me what functions I should be reading up on. Thanks in advance for any help or pointers anyone can offer. Edited December 3, 2009 by makeinstall Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 3, 2009 Moderators Share Posted December 3, 2009 makeinstall, Here is one way you might like to do it: #include <GUIConstantsEx.au3> #include <ListboxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hList = GUICtrlCreateList("", 10, 10, 200, 200, $LBS_NOSEL) $hButton = GUICtrlCreateButton("Exit", 10, 250, 80, 30) GUISetState() Sleep(1000) GUICtrlSetData($hList, "- checking if folder structure exists....") Sleep(1000) GUICtrlSetData($hList, "- it does not so will create....") Sleep(1000) GUICtrlSetData($hList, "- folders created") Sleep(1000) GUICtrlSetData($hList, "- checking if remote file exists....") Sleep(1000) GUICtrlSetData($hList, "- it does. beginning download....") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $hButton Exit EndSwitch WEnd M23 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...
Carlo84 Posted December 3, 2009 Share Posted December 3, 2009 (edited) In your Gui$progresstxt=GuiCtrlCreateLabel("Status:", 0, 0)Then before each action add thisGUICtrlSetData ( $progresstxt, "doing this or that")Not sure if this was what you mean. but i hope soEdit: Check post above thats a more clear example =] Edited December 3, 2009 by Hellstrong _SplashProgressImage | _Regionselector | _IsPressed360 | _UserAccountContol_SetLevel | _ListSubFolders Link to comment Share on other sites More sharing options...
makeinstall Posted December 3, 2009 Author Share Posted December 3, 2009 Thanks for the prompt reply. The main function that sends data to the GUI is GUICtrlSetData? So I would just insert that function call at the various places in my script to indicate a milestone has been reached / about to be executed, with the GUI creation at the start & the While loop at the end? Looking structure wise something like this? #includes GUICreate() GUISetState() ; my script function calls GUICtrlSetData($hList, $messageToDisplay) ;etc etc While 1 ; blah blah Wend Also, where can I find more about the various calls of globals such as "$LBS_NOSEL" because I cant seem to find a page that lists them all like in the docs for @macros or functions? Once again, thanks for your help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 3, 2009 Moderators Share Posted December 3, 2009 makeinstall,So I would just insert that function call at the various places in my script to indicate a milestone has been reached / about to be executed, with the GUI creation at the start & the While loop at the end?You have it in one! Your code just replaces the Sleep commands.where can I find more about the various calls of globals such as "$LBS_NOSEL"These are style constants - usually stored in the *Constants.au3 include file for that type of control (did you notice the #include <ListboxConstants.au3> line? ). You can find the styles that refer the particular control in the Help file - look at the relevant GUICtrlCreate* page and then under the style and exStyle parameter explanation, there is a link to the appropriate Help file selections there.M23 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...
makeinstall Posted December 8, 2009 Author Share Posted December 8, 2009 Sorry to bump this back up but I have some more questions about the styling of a GUI:When I have sent various statements to the GUI through GUICtrlSetData($hList, "[message.....]"), it does not scroll when the listbox area fills up. How can I do this? I have tried looking through the styles list but cannot see one associated with 'overflow'.Also, is there anyway to style the text being sent to the GUI? Style as in send in bold or italics for instance?Once again, TIA anyone who can help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 11, 2009 Moderators Share Posted December 11, 2009 makeinstall,Everything you want to do is possible. Please post your code so we can see exactly what you are trying to do - it is always easier when you have something to work on. M23P.S. When you post your script, please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). 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...
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