Ayuda con xbrowse

Post Reply
User avatar
laugusto
Posts: 62
Joined: Fri Apr 28, 2006 4:06 pm

Ayuda con xbrowse

Post by laugusto »

Buenas,

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

necesito una ayuda para utilizar el codigo con xbrowse, as linhas abajo no funcionam co xbrowse

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 ) }
e esta chamada a function tambien no

Code: Select all

   // Lets use different row colors
   oBrw:nClrText     := { || Scv20222( a_temp[n][04] ) }
gracias en adelantado,
Saludos desde Brasil
User avatar
jrestojeda
Posts: 543
Joined: Wed Jul 04, 2007 3:51 pm
Location: Buenos Aires - Argentina

Re: Ayuda con xbrowse

Post by jrestojeda »

Hola amigo...
Prueba de la siguiente manera:

Code: Select all

   oLbx1:bGoTop   :={||n:=1 }
   oLbx1:bGoBottom:={||n:=Len(a_temp)}
   oLbx1:bBookMark:={|nBkm| If( nBkm == nil, n, n:= nBkm ) }
   oLbx1:bSkip    :={|nSkip| Skipper2(a_temp,@n,@nSkip ) }
Función Skipper2:

Code: Select all

Function Skipper2(Vector,nCur,nSkip)
Local nOld:=nCur

Default nSkip:= 1
nCur :=nCur + nSkip
IF nCur > LEN(Vector)
   nCur:= LEN(Vector)
ENDIF
IF nCur < 1
   nCur:= 1
ENDIF

Return nCur - nOld
Espero te funcione...
Saludos desde Argentina, Esteban.
Ojeda Esteban Eduardo.
Buenos Aires - Argentina.
FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport
Skype: jreduojeda
User avatar
laugusto
Posts: 62
Joined: Fri Apr 28, 2006 4:06 pm

Re: Ayuda con xbrowse( Resolvido )

Post by laugusto »

Buenos Dias,

Gracias Esteban por contestar, funciono de pronto su rotina.

Saludos desde Brasil,
Luiz Augusto
Luiz Augusto
São José dos Pinhais - PR
BRASIL
fwh + harbour + workshop + velhos bat´s
User avatar
jrestojeda
Posts: 543
Joined: Wed Jul 04, 2007 3:51 pm
Location: Buenos Aires - Argentina

Re: Ayuda con xbrowse

Post by jrestojeda »

Augusto...
Me alegro saber que funcionó.

Saludos desde Argentina, Esteban.
Ojeda Esteban Eduardo.
Buenos Aires - Argentina.
FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport
Skype: jreduojeda
Post Reply