A little tip for accelerating adaptive-size control updates in Soui

Source: Internet
Author: User

The controls in Soui have both the specified size and the adaptive size of the two types of controls.

Specifies the size of a control that does not need to be re-laid when the content of the control is updated, whereas an adaptive-sized control causes the parent window to re-layout after the content changes.

Recently, some netizens found that the performance of Soui was very low when the adaptive control of a window was updated in high-speed batches (such as 50 times/S Speed batch update of 30 file controls).

The key to tracking discovery is that in a single refresh process, every update of a control needs to be re-laid out, which is obviously inefficient.

There are two ways to solve this problem:

An easy way to do this is to change the adaptive-sized text control to a fixed-size text control, so that you do not need to perform a re-layout on a timed refresh.

One limitation of the above approach is that the desired dimensions of the control must be known at design time and not applicable to layout of controls that do need to be adaptive in size.

To solve this problem, the Soui new kernel adds two methods to Swindow:

    void swindow::locklayout ()    {        = TRUE;    }     void swindow::unlocklayout ()    {        = FALSE;        Updatechildrenposition ();    }

As the name implies, LockLayout and Unlocklayout are both methods of layout locking and unlocking.

As a result, when you need to bulk update a child window of adaptive size, you only need to lock the layout of the parent window without repeating the window layout.

Note: These two methods are the new additions in 2015.4.27.

A little tip for accelerating adaptive-size control updates in Soui

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.