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 ());
}
}
}