in my program I use window.class window and the WINDOW_HorizProp & _VertProp scrollers created with tag value 1. I use the following code to adjust the scrollers according to the view size and position:
Code: Select all
void AdjustVProp(struct sdoc *dobj)
{
LONG DotsPI = dobj->dotsperinch;
if (dobj->gads[GAD_VPROP])
{
IIntuition->SetGadgetAttrs((struct Gadget *)dobj->gads[GAD_VPROP],dobj->win,NULL,
SCROLLER_Top,dobj->globy / dobj->scrollstepy,
SCROLLER_Visible,PIX2DPOINT(((struct Gadget *)dobj->gads[GAD_DRAWAREA])->Height) / dobj->scrollstepy,
SCROLLER_Total,dobj->vtotal / dobj->scrollstepy,
TAG_DONE);
}
}
Top 25, visible 50, total 83
Visually the scroller shows as the Top would be 0. When setting different values works as it should, but when going to visible == total and then reusing the values above problem reoccur. Very odd is, that when I changed the order of SetGadgetAttrs() to Visible,Total,Top, the scroller works as it should. Why is this, shouldn't the scroller work regardless of the order of the SetGadgetAttrs() arguments?
Marko