Jump to content

Quick-Update Display with a lot of labels


Recommended Posts

I've got a tracker/wallboard project underway.  I previously wrote the project in Classic ASP, but since it will now be distributed throughout the company, I am rewriting it in AutoIT for ease of setup.

The tracker contains a good deal of data that is updated every few seconds.  With the ASP version, the display is updated quickly, with only a very minor, almost unnoticeable flicker.  As I transcribe it into AutoIT, and I haven't even gotten to updating all the information yet, there appears to be a very noticeable "scroll" as it updates each of the labels.

Is there a way to "freeze" the display during update, then display the newly updated data quickly?

If you remember the old DOS days, you could display screen 0 page, while updating the other, then flip the displays, producing an instant update.

Link to comment
Share on other sites

GUISetState with @SW_LOCK (Lock the window to avoid repainting) and @SW_UNLOCK (Unlock windows to allow painting)?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

GUISetState with @SW_LOCK (Lock the window to avoid repainting) and @SW_UNLOCK (Unlock windows to allow painting)?

Yes, that almost had it!  However, when @SW_UNLOCK was called, it would actually cause a flicker, I suppose as the entire screen was repainted.  That flicker wasn't as bad as it was before, but still noticeable.

My current solution is a little different.  I wrote this small function to only update if the text, foreground or background colors have changed.

#include "_GetCtrlColorEx.au3"

Func UpdateLabel($LabelhWnd,$LabelText,$FGColor,$BGColor)
   ;only updates if values have changed.  Mitigates display flicker/speed issues
   
   ;text
   if GUICtrlRead($LabelhWnd) <> $LabelText then GUICtrlSetData($LabelhWnd,$LabelText)
   ;fgcolor
   if _GUICtrlGetTextColorEx($LabelhWnd,1) <> $FGColor then GUICtrlSetColor($LabelhWnd,$FGColor)
   ;bgcolor
   if _GUICtrlGetBkColorEx($LabelhWnd,1) <> $BGColor then GUICtrlSetBkColor($LabelhWnd,$BGColor)
EndFunc

There is still a sort of roll while it updates, but it's checking/updating over 200 labels, and while it's difficult to measure it, seems to take less than 1/10th second.

Any ideas for further improvement?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...