I am re-visiting this topic and I have created the two arrays aSchedule ( first screen shot )
and aDuration ( second screen shot ) and I am struggling to interpret your suggestion on drawing the rectangle .. I would appreciate your help!
Rick Lipkin
Just prepare the array like this. Prepare another array of same size with duration in the corresponding cell of the second array. Keep the duration as number of half-hours ( that gives the number of rows )
Example:
If aData[ 3, 4 ] contains an appointment, aDurn[ 3, 4 ] contains its duration. If the duration is less than 1/2 hour the value is 1. If more than 1/2 hour and less than 1 hour the value is 2. etc.
Then we can draw the cells on our own. Thats a lot better. First please make the two arrays.
I am also assuming that all the rows of the browse will fit into one screen. Right? Or not?
To color a rectangle:
Assume we have two Arrays as static vars.
aSelRows := { nTop, nBottom }
aSelCols := { nLeft, nRight }
Note: I am using two arrays instead one aRect, because this logic easily enables using oBrw:aSelected.
Code:
for each oCol in oBrw:aCols
SetClrStd( oCol )
next
....
....
static function SetClrStd( oCol )
oCol:bClrStd := { || { CLR_BLACK, If( oCol:oBrw:BookMark >= aSelRows[ 1 ] .and. oCol:oBrw:BookMark <= aSelRows[ 2 ] .and. oCol:nPos >= aSelCols[ 1 ] .and. oCol:nPos <= aSelCols[ 2 ], CLR_YELLOW, CLR_WHITE ) } }
aSchedule - master array
aDuration - same array with duration .. number in integer = 30 min
xBrowse - actual program