Series 60 3rd-solution to inconsistency with scroll bar after adjusting the position and size of list box

Source: Internet
Author: User
After s60 2nd fp3, the scroll bar in the standard control is no longer two triangles at the bottom of the screen, but a style similar to the scroll bar in windows. This style is more intuitive and the user feels better. however, this problem was encountered when porting a project to s60 3rd: the position and size of the list box were adjusted, resulting in inconsistency with the scroll bar. for example, if setextent () is called on the list box so that it does not occupy the customer zone, the size of the scroll bar does not change, causing dislocation between the list box and scroll bar.

Solution:
First, use the list box base class ceiklistbox: scrollbarframe () to obtain the ceikscrollbarframe pointer of the scroll bar framework object. Then, use ceikscrollbarframe: getscrollbarhandle, finally, use ceikscrollbar: setextent () to adjust the position of the scroll bar. code: // set the position of ListBox
Void cxxxcontainer: setlistboxpos (const tpoint apoint)
{
Ilistpos = apoint;
 
If (ilistbox)
{
Trect rect = rect ();
Tsize size (rect (). width (), rect (). IBR. iy-ilistpos. iy); ilistbox-> setextent (ilistpos, size); ceikscrollbar * scrollbar = ilistbox-> scrollbarframe ()-> getscrollbarhandle (ceikscrollbar: evertical );
If (scrollbar)
{Tpoint Pos = scrollbar-> position ();
POs. Iy = ilistpos. Iy; scrollbar-> setextent (Pos, scrollbar-> minimumsize ());
}
}
}

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.