FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour xBrowse - Edit
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM
xBrowse - Edit
Posted: Wed Mar 09, 2011 02:25 AM

Buenas noches,

驴C贸mo hacer para pasar de una celda a otra celda y la siguiente en xbrowse ya se ha editado. 驴Es eso posible?

Gracias,

Junior

Posts: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: xBrowse - Edit
Posted: Wed Mar 09, 2011 03:25 AM

Este es un ejemplo con una columna completa

oCol = oBrw:AddCol()
oCol:bStrData = { || Transform((cAlias)->HABER,"9,999,999,999.99") }
oCol:nDataStrAlign := 1
oCol:cHeader = "CREDITOS"
oCol:nEditType = EDIT_GET
oCol:lTotal := .t. //para totalizar cols a report y/o excel
oCol:bFooter = {|| TRANSFORM(nTotal2,"9,999,999,999.99") }
oCol:nFootStrAlign := 1
oCol:bEditWhen := {|| (cAlias)->Debe =0 }
oCol:bOnPostEdit = { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),),;
If( nKey == VK_RETURN,;
if(lCtaOK(oBrw), ( nTotal2+=(Val(xVal)-(cAlias)->HABER), oCol:RefreshFooter(), (cAlias)->HABER := Val(xVal) ), oBrw:GoLeftMost()) ,) }

Dios no est谩 muerto...



Gracias a mi Dios ante todo!
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM
Re: xBrowse - Edit
Posted: Wed Mar 09, 2011 03:43 AM

Hola Jos茅 Luis,

Gracias por la respuesta.

No funcion贸 como se esperaba. Lo que busco es la siguiente: Estoy en una celda publicada y presione "enter " para ir hacia abajo y la l铆nea celular ya est谩 publicada, sin tener que pulsar "enter"de nuevo.

gracias

Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: xBrowse - Edit
Posted: Wed Mar 09, 2011 06:10 AM
While editing,by default xBrowse cursor will jump to the next editable cell in the same row. If you have only one single editable cell in a row, then xBrowse will jump to the next editable cell in the next row.

You can also control the cursor movements by calling the following xbrowse built in methods

Code (fw): Select all Collapse
oBrw:SelectCol( nCol, lOffSet )
oBrw:GoLeft( lOffset, lRefresh )
oBrw:GoRight( lOffset, lRefresh )
oBrw:GoLeftMost()
oBrw:GoRightMost()
oBrw:GoUp( nLines )
oBrw:GoDown( nLines )
oBrw:PageUp( nLines )
oBrw:PageDown( nLines )
oBrw:GoTop()
oBrw:GoBottom()


You may also try the FastEdit feature of xBrowse
Code (fw): Select all Collapse
oBrw:lFastEdit:=.T.


Regards
Anser
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM
Re: xBrowse - Edit
Posted: Wed Mar 09, 2011 12:33 PM

thanks for the reply anserkk,

the leap to another cell occurs, but not the next cell gets edited, it is necessary to give another "ENTER" to stay.

After obrw: godown (), have experienced __KeyBoard (Chr (13)) and neither worked. lFastEdit cell changes but do not start editing.

thanks,
junior

Posts: 537
Joined: Mon Jan 16, 2006 03:42 PM
Re: xBrowse - Edit
Posted: Wed Mar 09, 2011 01:54 PM

Amigo Prueba asi;

oBrw:aCols[1]:cHeader := 'Codigo'
oBrw:aCols[1]:cEditPicture := '!!!!!!!!!!!!!'
oBrw:aCols[1]:bClrEdit := oBrw:bClrStd
oBrw:aCols[1]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN,"",),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nEditType := EDIT_GET_BUTTON
oBrw:aCols[1]:bEditValid := { | oGet, oCol | BuscarProd( oGet,oCol,oBrw,aDatos,oDlg1 ) }
oBrw:aCols[1]:bEditBlock := {|| LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nDataStrAlign:= AL_LEFT
oBrw:aCols[1]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[1]:bF2 := {|| LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nWidth := 100
oBrw:aCols[1]:bLClickHeader:= {|r,c,f,o|LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:oHeaderFont := oFnt
*oBrw:aCols[1]:bEditWhen := { || IF(Len(aGuias)=0,.T.,.F.) }

oBrw:aCols[2]:cHeader := 'Description'
oBrw:aCols[2]:bClrEdit := oBrw:bClrStd
oBrw:aCols[2]:nWidth := 295
oBrw:aCols[2]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[2]:oHeaderFont := oFnt

oBrw:aCols[3]:cHeader := 'Cantidad'
oBrw:aCols[3]:cEditPicture := '@k 9999.99'
oBrw:aCols[3]:bClrEdit := oBrw:bClrStd
oBrw:aCols[3]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aDatos[ oBrw:nArrayAt,3] := xVal,),oBrw:GoRight() }
oBrw:aCols[3]:nEditType := EDIT_GET
oBrw:aCols[3]:bEditValid := { | oGet, oCol | Valida( oGet, oCol ) }
oBrw:aCols[3]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[3]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[3]:nWidth := 70
* oBrw:aCols[3]:bEditWhen := { || IF(Len(aGuias)=0,.T.,.F.) }
oBrw:aCols[3]:oHeaderFont := oFnt

Saludos

Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM
Re: xBrowse - Edit
Posted: Wed Mar 09, 2011 06:53 PM

gracias por contestar JBrita,

Creo que el problema se produce cuando ejecuto el comando oBrw:GoDown() porque se corre el CancelEdit () no permite la edici贸n de la celda de abajo sin una nueva "ENTER".

Voy a hacer algunas pruebas. Pero gracias por la informaci贸n.

Junior

Continue the discussion