Sign in to follow this  
Followers 0
Fredp123

Combo Updates 2nd Combo but without screen flicker?

7 posts in this topic

Hi all,

This is not my first script, but it is my first time posting. What is the easiest way to have the selection made in Combo #1 update the values in Combo #2 when Combo #2 is being populated from a _FileListToArray?

Thanks!

-Fred

Share this post


Link to post
Share on other sites



Only update when the selection in ComboBox1 changes?

Yes. If there was something which value would change only when Combo 1 was changed that would be ideal. The constant polling of Combo 1 fails due to flicker.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yes. If there was something which value would change only when Combo 1 was changed that would be ideal. The constant polling of Combo 1 fails due to flicker.

Maybe you need to show some code here, but I think it should work fine when you update the Combo2 only when Combo1 changes.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Some resolutions to flicker problems are here.

http://www.autoitscript.com/forum/index.php?showtopic=94713&view=findpost&p=680434

In your case set a Variable to start and then check and update that variable before updating the 2nd combo.

;
$sCheck = GUICtrlRead($Combo_1)
;; Then in your Message loop (While 1) use
If GUICtrlRead($Combo_1) <> $sCheck Then
    GUICtrlSetData($Combo_2, "Whatever you want")
    $sCheck = GUICtrlRead($Combo_1)
EndIf
;

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Thank you both very much!GEO, I thought of that logic, but couldn't put it into code. Here is what I just came up with that works:

Case $Combo_State
            $Type=GUICtrlRead($Combo_State)
           ;MsgBox(0,"test",$Type)
            Switch $Type
                Case "TN"
                    $GUIlist = _FileListToArray("\\server\TN\Cust. Contracts")
                    $missing = _ArraySearch($GUIlist,"Missing Contracts") ; delete Missing Contracts Folder
                        _ArrayDelete($GUIlist,$missing)
                    GUICtrlSetData($hCombo,"")   ; clears out previous values
                    For $z = 1 to Ubound($GUIlist)-1   ; Populates the combo box
                            GUICtrlSetData($hCombo,$GUIlist[$z])
                        Next
                Case "AL"
                    $GUIlist = _FileListToArray("\\server\AL\Cust. Contracts")
                    $missing = _ArraySearch($GUIlist,"Missing Contracts") ; delete Missing Contracts Folder
                        _ArrayDelete($GUIlist,$missing)
                    GUICtrlSetData($hCombo,"")   ; clears out previous values
                    For $z = 1 to Ubound($GUIlist)-1   ; Populates the combo box
                            GUICtrlSetData($hCombo,$GUIlist[$z])
                        Next
                
            EndSwitch

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Try this logic to see if thats faster.

$temp = "|"
                    $GUIlist = _FileListToArray("\\server\TN\Cust. Contracts")
                    For $x = 1 To $GUIlist[0]
                        If $GUIlist[$x] <> "Missing Contracts" Then $temp &=  "|" & $GUIlist[$x]
                    Next
                    GUICtrlSetData($hCombo,$temp)
Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  
Followers 0