Page 1 of 1

CONSULTA XBROWSE

Posted: Sun Nov 19, 2023 7:37 pm
by Pg_cts
Buenas compañeros,

Cuando se pulsa doble click en alguna columna en la cabecera del Browse.

Hay alguna variable o metodo que devuelva sobre que columna se ha dado doble click?

Gracias

Re: CONSULTA XBROWSE

Posted: Mon Nov 20, 2023 2:06 pm
by nageswaragunupudi
Right now, this is not possible.
For this we need to make some change in the xbrowse.prg:

Change:
Please locate these lines of code at the end of METHOD LDblClick( nRow, nCol, nKeyFlags )

Code: Select all | Expand

    if nColPos != 0 .and. nRowPos != 0
      return ::Super:LDblClick( nRow, nCol, nKeyFlags )
   Endif
return 0
 
Please make the following change:

Code: Select all | Expand

return ::Super:LDblClick( nRow, nCol, nKeyFlags )
After this change we can do this:

Code: Select all | Expand

   XBROWSER "CUSTOMER.DBF" SETUP ( ;
      oBrw:bLDblClick := { |r,c,f,o| DblClick( r,c,f,o ) } )

//-----------------

function DblClick( r, c, f, oBrw )

   local oCol, nCol

   if oBrw:MouseAtHeader( r, c )
      if ( nCol := oBrw:MouseColPos( c ) ) > 0
         oCol  := oBrw:ColAtPos( nCol )
         // now do anything with oCol
         // example:
         ? oCol:cHeader
         return 0
      endif
   endif

return nil

Re: CONSULTA XBROWSE

Posted: Mon Nov 20, 2023 11:03 pm
by Pg_cts
Muchas gracias, voy a probar.