Pos es esto, tengo la seguinte rutina:
Code: Select all
TWBrowse():lHScroll := .F.
@ 1,2 LISTBOX oBrw;
FIELDS Str(a_temp[n][01],05,0 ),;
a_temp[n][02],;
Dtoc( a_temp[n][03] ),;
a_temp[n][04], a_temp[n][05];
HEADERS "No. Ped",;
"Cliente",;
"DtaPed",;
"Situação",;
"Tipo" FONT oFont OF oDlg SIZE 300, 130
oBrw:bGotop := { || n := 1 }
oBrw:bGoBottom := { || n := Eval( oBrw:bLogicLen ) }
oBrw:bSkip := { | nwant, nold | nold := n , n += nwant, n := Max( 1, Min( n, Eval( oBrw:bLogicLen ) ) ), n - nOld }
oBrw:bLogicLen := { || len( a_temp ) }
oBrw:bLDblClick := { | nRow, nCol | ctick := a_temp[n][1], npedido := ctick, Scv20201A( oWnd, ctick ),;
IF( lRet,( lAcao := .t., oDlg:End() ),) }
oBrw:nDlgCode := DLGC_WANTALLKEYS
oBrw:CreateFromCode()
// Força o browse trabalhar com celulas
oBrw:lCellStyle := .t.
oBrw:nLineStyle := 4
oBrw:nClrForeHead := CLR_BLUE
// Lets use different row colors
oBrw:nClrText := { || Scv20222( a_temp[n][04] ) }
//----------------------------------------------------------------------------//
FUNCTION Scv20222( cCampo ) // Cores no Browse
local nColor
IF cCampo = "FECHADO" .or. cCampo = "CANCELADO"
nColor := nRGB( 0, 0, 0 ) // Preto
ElseIF cCampo = "ABERTO"
nColor := nRGB( 0, 0, 183 ) // Azul
ElseIF cCampo = "PENDENTE"
nColor := nRGB( 255, 0, 0 ) // Vermelho
ElseIF cCampo = "NOVO"
nColor := nRGB( 0, 128, 0 ) // Verde
EndIF
Return nColor
Code: Select all
oBrw:bGotop := { || n := 1 }
oBrw:bGoBottom := { || n := Eval( oBrw:bLogicLen ) }
oBrw:bSkip := { | nwant, nold | nold := n , n += nwant, n := Max( 1, Min( n, Eval( oBrw:bLogicLen ) ) ), n - nOld }
oBrw:bLogicLen := { || len( a_temp ) }
Code: Select all
// Lets use different row colors
oBrw:nClrText := { || Scv20222( a_temp[n][04] ) }
Saludos desde Brasil