Xbrowse "SOLVED"

Xbrowse "SOLVED"

Postby lailton.webmaster » Sat Mar 07, 2009 3:44 am

Hola antonio.

Yo estoy tentando retornar ao numero del col in xbrowse pero cuando tien colunas que necessita usar
la barra de rolagem horizontal yo voy a editar la ultima coluna y me retornar a numero incorreto.
Code: Select all  Expand view
#include "fivewin.ch"
#include "xbrowse.ch"

function main()

  public oBrw, oCol, n, xwnd
  cCampos:={'Nome','Telefone','CEP','sobrenome','cidade'}
  cValores:={{'Nome','Telefone','CEP','sobrenome','cidade'},;
{'Nome','Telefone','CEP','sobrenome','cidade'},;
{'Nome','Telefone','CEP','sobrenome','cidade'},;
{'Nome','Telefone','CEP','sobrenome','cidade'},;
{'Nome','Telefone','CEP','sobrenome','cidade'},;
{'Nome','Telefone','CEP','sobrenome','cidade'},;
{'Nome','Telefone','CEP','sobrenome','cidade'}}


  DEFINE WINDOW xwnd TITLE "Browse xPHP SQL"

   oBrw := TXBrowse():New( xWnd )
   oBrw:SetArray( cValores )

   for n = 1 to len(cCampos)
   
       oBrw:aCols[n]:cHeader:= cCampos[n]
       oCol:=oBrw:aCols[ n ]
       oCol:nEditType := 1
       oCol:nHeadStrAlign:= AL_LEFT

//       oCol:bOnPostEdit := {|o, v, n| msginfo(oBrw:ColAtPos()) }


       oCol:bOnPostEdit := {|o, v, n| msginfo(obrw:ColPos(obrw:selectedcol()))}


       oCol:nwidth:=250
     

   next


   oBrw:nMarqueeStyle   := MARQSTYLE_HIGHLCELL
   oBrw:nColDividerStyle := LINESTYLE_BLACK
   oBrw:nRowDividerStyle := LINESTYLE_BLACK

   oBrw:bClrSel             := {|| { CLR_BLACK, RGB( 104,253,150 ) } }
   oBrw:bClrSelFocus        := {|| { CLR_BLACK, RGB( 104,253,150 ) } }
   oBrw:lHScroll := .T.
   oBrw:lVScroll := .T.
   oBrw:lFastEdit:= .T.

 
   oBrw:CreateFromCode()
   xwnd:oClient := oBrw

   ACTIVATE window xwnd maximized ON INIT (oBrw:SetFocus(), obrw:refresh())

return

 



oCol:bOnPostEdit := {|o, v, n| msginfo(obrw:ColPos(obrw:selectedcol()))}
estoy tentando esto, funciona quando no voy las colunas que necessita dela barra de rolagem horizontal.

tiene alguna solucion ?

gracias
Last edited by lailton.webmaster on Sat Mar 07, 2009 5:41 am, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Xbrowse to Antonio

Postby Daniel Garcia-Gil » Sat Mar 07, 2009 4:16 am

Hello Lailton

if you want the real column position dont use obrw:selectedcol(), this return column number from visual column

try with
oBrw:SelectedCol():nArrayCol
or
oBrw:SelectedCol():nCreationOrder

test
oCol:bOnPostEdit := {|o, v, n| msginfo(oBrw:SelectedCol():nArrayCol)}
or
oCol:bOnPostEdit := {|o, v, n| msginfo(Brw:SelectedCol():nCreationOrder )}
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Xbrowse to Antonio

Postby lailton.webmaster » Sat Mar 07, 2009 5:26 am

Thanks Daniel, i´ll try..
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Xbrowse to Antonio (Solved)

Postby lailton.webmaster » Sat Mar 07, 2009 5:31 am

Perfect Daniel

THanks so much ! :lol:
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests