telmob Posted March 7, 2012 Posted March 7, 2012 I have a GUI that creates lots of controls if i press a button (lets call it the 'next' button). When i press Next, lot's of items show and the previous items (inside the same page) hide. But i have 4 pages of different controls. So, when i press the next button, all the pages render (slowly) and only after rendering the controls appear correctly placed and hidden. My code is organized as follows (just an example, i have hundreds of controls): Func First() $Form $combo1 $combo2 $combo3 For $i = $combo1 To $combo3 GUICtrlSetState($i, $GUI_HIDE) Next _NextFunc() EndFunc Func _NextFunc() $combo4 $combo5 $input1 $input2 $combo6 $combo7 For $i = $combo4 To $combo7 GUICtrlSetState($i, $GUI_SHOW) Next EndFunc What is the proper way to show and hide controls without the huge lag? When i had the _NextFunction in a GUI of it's own and outside the function tag, it was much faster. Should I GUICtrlSetState(-1, $GUI_HIDE) all the controls? I have hundreds.
water Posted March 7, 2012 Posted March 7, 2012 Can you post a screenshot of your GUI so we can suggest a proper solution? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted March 7, 2012 Posted March 7, 2012 As I suggested I would try to store the ControlIDs in an array (one for each "page"). Then you can loop through the array for page 1 and disable all control plus loop through the array for page 2 and enable all controls.Seems to become a quite complex script just by the amount of controls My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
telmob Posted March 7, 2012 Author Posted March 7, 2012 So many things going on in my mind related to this darn script i completely forgot to update my script following your suggestion. Just a couple of questions though... how to i update a specific control data and how do i extract a specific control data? If you see the window below, if i input data randomly, the listview does not update properly.
water Posted March 7, 2012 Posted March 7, 2012 I assume the value "5" in row 2, column 2 is the last you entered (that's the only one missing from the displayed array)? You have to tell AutoIt that you have finished entering data using a finished button or something similar. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
telmob Posted March 7, 2012 Author Posted March 7, 2012 Can you tell me how to read a specific control and how to set data to a specific control in the array?
water Posted March 7, 2012 Posted March 7, 2012 (edited) GUICtrlRead reads the data from a control, GUICtrlSetData modifies the data of a control. If you read the code of my example you will see that there is a two dimensional array holding the ControlIDs and a two dimensional array holding the data of the control. Edited March 7, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
telmob Posted March 7, 2012 Author Posted March 7, 2012 Yes, i know that, i just want to know how i can use GUICtrlRead and GUICtrlSetData in a specific control in your array.For example, how can i read the control in the second line and second column?
water Posted March 7, 2012 Posted March 7, 2012 GUICtrlRead($aGUIControls[1][1]) - because the array starts with index 0. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
telmob Posted March 7, 2012 Author Posted March 7, 2012 Ohh... now i understood Well... it seems i need some hours to spend to do this this. lol Thanks water!
water Posted March 7, 2012 Posted March 7, 2012 If you like I can add some comments to my original code so you can easily understand how it is done. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
telmob Posted March 7, 2012 Author Posted March 7, 2012 Well, if you don't mind, i sure would apreciate it
water Posted March 7, 2012 Posted March 7, 2012 Done. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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