Contents page

Index

rtSpread


reqtools.library/rtSpread

  NAME  rtSpread()

rtSpread (posarray, sizearray, totalsize, min, max, num);

void rtSpread (ULONG *, ULONG *, ULONG, ULONG, ULONG, ULONG); A0 A1 D0 D1 D2 D3

DESCRIPTION Evenly spread a number of objects over a certain length. Primary use is for arrangement of gadgets in a window.

Example:

'sizearray' holds following values: 4, 6, 4, 2 and 8, 'totalsize' is 24 (= 4 + 6 + 4 + 2 + 8), 'min' is 3, 'max' is 43, and finally, 'num' is 5.

After calling rtSpread() 'posarray' would hold the following values: 3, 11, 19, 26 and 31.

My attempt at a visual representation:

| | | | | | | OOOO OOOOOO OOOO OO OOOOOOOO | | | | | | 1 1 2 2 3 3 4 4 0----5----0----5----0----5----0----5----0----5

INPUTS posarray - pointer to array to be filled with positions. sizearray - pointer to array of sizes. totalsize - total size of all objects (sum of all values in sizearray). min - first position to use. max - last position, first _NOT_ to use. num - number of objects (size of posarray and sizearray).

RESULT none

NOTE This function is for the advanced ReqTools user.

BUGS none known

SEE ALSO