Despues de darle muchas vueltas al tema del efecto pijama que relentizaba los xbrowse con ads , he llegado a una implementacion facil con pocos cambios en el xbrowse ...
Nuevas datas
Asignamos asi al crear el xbrowse:
o se puede crear un metodo SetZebra si se quiere ...
solo dos cambios en el codigo xbrowse ....
y listo ....
Nuevas datas
DATA nRowZebra 聽AS NUMERIC INIT 0
DATA aClrZebra
DATA lZebra 聽 AS LOGICAL INIT .f.Asignamos asi al crear el xbrowse:
聽 ::lZebra := .t.
聽 ::aClrZebra 聽:= { { 0, 聽RGB(255,255,255) }, { 0, rgb(237,243,254) } }
聽 ::bClrStd := { || ::aClrZebra[ ::nRowZebra %2 + 1 ] }o se puede crear un metodo SetZebra si se quiere ...
METHOD SetZebra( lZebra, aClrZebra ) CLASS TXBrowse
DEFAULT lZebra := .t.
DEFAULT aClrZebra := 聽{ { 0, 聽RGB(255,255,255) }, { 0, rgb(237,243,254) } }
::lZebra := lZebra
if ::lZebra
聽 聽 ::aClrZebra 聽:= aClrZebra 聽
聽 聽 ::bClrStd := { || ::aClrZebra[ ::nRowZebra %2 + 1 ] }
else
聽 聽::bClrStd := 聽{|| { CLR_BLACK, GetSysColor( COLOR_WINDOW )} }
endif
Return nilsolo dos cambios en el codigo xbrowse ....
METHOD Paint() CLASS TXBrowse
......
聽 聽do while nRowPos <= nMaxRows
聽 聽 聽 // We must also paint some times after the last visible column
聽 聽 聽 IF ::lZebra 聽 聽 // nuevo
聽 聽 聽 聽 聽::nRowZebra := nRowPos 聽 // nuevo
聽 聽 聽 endif 聽// nuevo
聽 聽 聽 if hSelBrush != nil
聽 聽 聽 .....
聽 METHOD FullPaint() INLINE ( ::lTransparent .or. ::lMergeVert .or. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽::nMarqueeStyle == MARQSTYLE_HIGHLWIN7 .OR. ::lZebra )y listo ....