On Tuesday 19 June 2018 23:02:23 fredvs wrote:
> > In order to set the scrollbar positions set container.frame.scrollpos.
>
> Huh, not too easy for me to understand.
>
> container.frame.scrollpos.x := container.frame.scrollpos.x + 100;
>
> ==> Error: Argument cannot be assigned to
>
> container.frame.scrollpos_x := container.frame.scrollpos_x + 100;;
>
> ==> Compiles but does work only once.
>
> >Maybe it is already at 100% after the first call?
>
> No, only 20 %.
>
> Sorry, I do not understand how scrollpos works.
>
It sets the position of the topleft corner of the virtual client rectangle of 
the scrolling area (twidget.clientrect) which is bigger than the rectangle 
built by widget frame (twidget.paintrect). Reference is the topleft corner of 
paintrect.
"
 tscrollbox1.frame.scrollpos:= mp(-30,-10);
"
in order to set the origin of clientrect to 30 pixel left of the origin of 
paintrect and 10 pixels above paintrect.

> For example, if a Tslider.width = 16 * parent_form.width, how to jump to
> the 3th page (if each page = 1 form.width) using the scrollbar by code ?
>
container.frame.scrollpos_x:= -3*parentformwidth.

> > container.clampinview(<therect>);
>
It adjusts scrollpos so <therect> is in paintrect.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to