FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour xBrowse, editar columna con boton
Posts: 92
Joined: Fri Nov 18, 2005 11:15 PM
xBrowse, editar columna con boton
Posted: Thu Nov 01, 2012 10:19 PM
Amigos del foro:

Estoy pasando algunos programas de Tsbrowse a xBrowse y encuentro una dificultad.
Necesito crear una columna que sea editable y que pueda (opcionalmente si el usuario presiona el boton) seleccionar datos de una tabla.
En mi caso, en esta columna escribo el codigo del producto, si el usuario no se acuerda o quiere consultar la lista, presiona el boton para mostrar la lista de productos.

Antes con Tsbrowse, mi codigo era:
Code (fw): Select all Collapse
    ADD COLUMN TO BROWSE oBrwDeta DATA FieldWBlock("CODPRD",Select("TMPD")) ;
       HEAD "Codigo" 

    oBrwDeta:SetBtnGet( 1, "Pick", { | oGet, cVar | ;
          aRect := GetCoors( oGet:hWnd ), cVar := oGet:Value(), ;
          cVar := PickPrd( cVar ), ;
          oGet:cText( cVar ), oGet:Refresh() }, 16 )

Mi codigo usando xBrowse es este:

Code (fw): Select all Collapse
    ADD COLUMN TO oBrwDeta DATA TMPD->CODPRD HEAD "Codigo" 

    nx := len(oBrwDeta:aCols)
    oBrwDeta:aCols[ nx ]:nEditType   := EDIT_BUTTON
    oBrwDeta:aCols[ nx ]:bEditBlock   := { | r, c, o | o:Value := PickPrd( o:Value ) }


Pero, cuando uso el modo de edicion EDIT_BUTTON no me permite escribir el codigo de producto, apenas entro a editar la columna se ejecuta :bEditBlock y me muestra la lista de productos.
Alguna idea de solucion? Uso FW1202

Gracias por su ayuda
Ralph del Castillo

Lima PERU

Fwh 24.07, xHb123_10193, MySQL 8.x, BCC 7.3
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse, editar columna con boton
Posted: Tue Nov 06, 2012 01:52 AM
Please try this:

Code (fw): Select all Collapse
ADD COLUMN TO oBrwDeta DATA TMPD->CODPRD HEAD "Codigo" 

    nx := len(oBrwDeta:aCols)
    oBrwDeta:aCols[ nx ]:nEditType   := EDIT_BUTTON
    oBrwDeta:aCols[ nx ]:bEditBlock   := { || PickPrd( o:Value ) }
Regards



G. N. Rao.

Hyderabad, India
Posts: 92
Joined: Fri Nov 18, 2005 11:15 PM
Re: xBrowse, editar columna con boton
Posted: Tue Nov 13, 2012 03:20 PM

Dear Mr. Rao.
I see the behavior much more alike to what i need is using the mode: EDIT_GET_BUTTON that has little documentation.
- I can call my function PickPrd(...) clicking in the small button of the cell, but how can capture the value returned by my function to the field bein edited?
- Is there a way to call this function using also a key?: by example F2

I would apreciate much if you send a small sample

Thanks for your reply

Ralph

Ralph del Castillo

Lima PERU

Fwh 24.07, xHb123_10193, MySQL 8.x, BCC 7.3

Continue the discussion