Re: Edita Requests
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jun 17, 2007
- 701 views
don cole wrote: > > Pete Lomax wrote: > > > > Are you saying that "dcole.zip" does not work? > > No that works fine. If I change the color of the text with > setTextColour(TABCONTROL2,White). > That works ok. > > If I change the background with setBackColour(TABCONTROL2,#FFFFFF). The > background > always turns white and text black no matter what color I put in there. That would be because you have rudely deleted the CreateBrush part. Here is a mod whereby setBackColour() accepts a colourref, which is more natural and correct than passing a brush anyway, and drawTabItems manages any brushes needed internally: Insert before drawTabItems:
sequence drawTabColours, drawTabBrushes drawTabColours={} drawTabBrushes={} integer k atom colour,brush
and find the first/last lines of this block in routine drawTabItems() and replace everything between with:
if colour=UNDEFINED then colour=COLOR_MENU+1 brush=colour else k = find(colour,drawTabColours) if k then brush=drawTabBrushes[k] else drawTabColours=append(drawTabColours,colour) brush=c_func(xCreateSolidBrush, {colour}) drawTabBrushes=append(drawTabBrushes,brush) end if end if void = c_func(xSetBkColor, {hDC, colour} ) void = c_func(xSetBkMode, {hDC, TRANSPARENT} ) -- void = c_func(xFillRect, {hDC, lpRect, colour}) void = c_func(xFillRect, {hDC, lpRect, brush}) if and_bits(state, ODS_SELECTED) then }}} <eucode>
Regards, Pete }}}