Method XbpWindow():lockUpdate() Foundation

Suppresses automatic screen updates.

Syntax
:lockUpdate( <lLock> ) --> lSuccess
Parameters
<lLock>
A logical value is passed for <lLock>. It indicates whether an automatic screen update should be suppressed (<lLock> := .T.) or enabled (<lLock> := .F.).
Return

The method retuns a logical value indicating whether or not the desired screen-update mode could be set.

Description

This method is used to temporarily suppress the automatic screen update of Xbase Parts. This is advantageous, for example, when a complex dialog window is resized and contained dialog elements must be repositioned. If the automatic screen update is switched off by calling :lockUpdate(.T.), the calculation can be done faster and the entire dialog window can be displayed at once. This is achieved by calling :lockUpdate(.F.) and :invalidateRect() when the operation is complete. As a result, the program reacts faster.

Another example is the creation of XbpTreeView or XbpListBox objects having many items. If the screen update is suppressed while single items are transferred to the object using :addItem(), single items are not drawn. Instead, the object can be displayed when all items are added.

Multiple subsequent calls to :lockUpdate(.T.) are allowed but do not nest. This means that a single :lockUpdate(.F.) call enables the screen update regardless of the number of previous :lockUpdate(.T.) calls.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.