FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Move the pointer at respective cell of column clicked
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Move the pointer at respective cell of column clicked
Posted: Thu May 16, 2013 01:21 AM
Hi,
How to put the pointer in the respective cell of the column clicked on his head?

I have a xbrowse with 20 columns, 8 visible, and two frozen.

If the pointer is in column 10 and I click on the header of the 12, how do I move the pointer to the respective cell in column 12?

I have this code, but it only works on the first 8 columns visible. If I move the cursor manually to the 15, and then I click on 13, the pointer goes haywire.
Code (fw): Select all Collapse
      :nMarqueeStyle  := MARQSTYLE_HIGHLCELL 
For n := 1 to Len(oBrw:aCols)
      if oBrw:aCols[n]:nCreationOrder >= 3
         oBrw:aCols[n]:bLClickHeader := {|r,c,f,o| ;
                       oBrw:nColSel := o:nCreationOrder, oBrw:Refresh(),;  //mover el cursor a esa col
                       oBrw2:Refresh(.t.) }
      endif
   Next

Thanks.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Move the pointer at respective cell of column clicked
Posted: Thu May 16, 2013 03:31 AM

Please try oBrw:SelectCol( <nCol> )

Regards



G. N. Rao.

Hyderabad, India
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Move the pointer at respective cell of column clicked
Posted: Thu May 16, 2013 03:04 PM
Mr. Nages, thanks for response.
Still the same.

Code (fw): Select all Collapse
     :nMarqueeStyle  := MARQSTYLE_HIGHLCELL 
For n := 1 to Len(oBrw:aCols)
      if oBrw:aCols[n]:nCreationOrder >= 3
         oBrw:aCols[n]:bLClickHeader := {|r,c,f,o| ;
                      oBrw:SelectCol(o:nCreationOrder), oBrw:Refresh() } ,;    // oBrw:SelectCol(n)  // oBrw:nColSel := o:nCreationOrder,                        oBrw2:Refresh(.t.) }
      endif
   Next

Regards.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Move the pointer at respective cell of column clicked
Posted: Thu May 16, 2013 05:07 PM
Hi,
I've solved so: (there is probably a better method, but this works)
The only drawback is that the columns changes position on display.
Code (fw): Select all Collapse
AEval( oBrw:aCols, { |o| o:bLClickHeader := {|r,c,f,o| SelectCell(o,oBrw) } } )
//-------------------------
Function SelectCell(o,oBrw)
local n, nPos:= o:nCreationOrder
oBrw:GoLeftMost()
For n:=2 to nPos
   oBrw:GoRight()
Next
oBrw:Refresh()
Return nil

Regards.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql

Continue the discussion