Jump to content
Sign in to follow this  
telmob

Proper way to refresh lots of controls?

Recommended Posts

telmob

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.

Share this post


Link to post
Share on other sites
water

Can you post a screenshot of your GUI so we can suggest a proper solution?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
telmob

Sure!

Here you go.

post-65971-0-38655400-1331133904_thumb.jpost-65971-0-66717600-1331134049_thumb.jpost-65971-0-47579600-1331134219_thumb.jpost-65971-0-66439000-1331134234_thumb.jpost-65971-0-08176000-1331134256_thumb.j

Share this post


Link to post
Share on other sites
water

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 :oops:


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
telmob

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.

post-65971-0-58878900-1331137520_thumb.j

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
telmob

Can you tell me how to read a specific control and how to set data to a specific control in the array?

Share this post


Link to post
Share on other sites
water

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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
telmob

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?

Share this post


Link to post
Share on other sites
water
GUICtrlRead($aGUIControls[1][1]) - because the array starts with index 0.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
telmob

Ohh... now i understood :oops:

Well... it seems i need some hours to spend to do this this. lol

Thanks water!

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
telmob

Well, if you don't mind, i sure would apreciate it :oops:

Share this post


Link to post
Share on other sites
water

Done.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
telmob

Thank you so much man! :oops:

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  

×