FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse => oBrw:SelectCol(nPos) doesn't work ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
xBrowse => oBrw:SelectCol(nPos) doesn't work ?
Posted: Mon Jul 30, 2012 01:09 PM
Hello,

I added Buttons, to jump to a defined Position ( in % ) Row and Col of a Grid.
Useful, to jump to a Position working with big Tables.
Because each Project can have different Sizes, I used Percent of max Rows and Cols.
For my Test, I created a Browser with 20 Rows and 50 Cols

Jump to Row 50% :
( nSGet[2] = defined max Rows )

@ 53, 455 BTNBMP oBtn[5] ;
SIZE 32, 11 OF oDlg1 PIXEL 2007 ROUND ;
PROMPT "R 50%" ;
FONT oTxtfont ;
ACTION ( nRPos := INT(nSGet[2] * 0.5), oBrw2:nArrayAt := nRPos, ;
oSay2:Refresh(), oBrw2:Refresh() )
oBtn[5]:cTooltip := "Jump to Row ( 50% )"
oBtn[5]:SetColor( 128 )

Jump to Col 50% :
( nSGet[3] = defined max Cols )

@ 173, 455 BTNBMP oBtn[15] ;
SIZE 32, 11 OF oDlg1 PIXEL 2007 ROUND ;
PROMPT "C 50%" ;
FONT oTxtfont ;
ACTION ( nCPos := INT(nSGet[3] * 0.5), oBrw2:SelectCol(nCPos), ;
oSay4:Refresh(), oBrw2:Refresh() )
oBtn[15]:cTooltip := "Jump to Col ( 50% )
oBtn[15]:SetColor( 128 )

Jumping to a defined Row works fine
oBrw:nArrayAt := nRPos

But with a defined Col, the table doesn't move only HScroll works. Clicking on the HScroll-thumb, the table moves to the Position.

oBrw:SelectCol(nCPos)



The calculated Col-pos with 50% shows 25 and the HScroll-thumb is centered.
The Table only moves, clicking on the adjusted HScroll-thumb.

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse => oBrw:SelectCol(nPos) doesn't work ?
Posted: Mon Jul 30, 2012 01:42 PM

If you want to go to a particular column number,

oBrw:nColSel := <nColNo>
oBrw:RefreshCurrent()

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: xBrowse =&gt; oBrw:SelectCol(nPos) doesn't work ?
Posted: Mon Jul 30, 2012 03:22 PM
Mr. Rao,

Thank You very much.
I tested, but it seems to work only in one Direction
I still had to add < oBrw:SetPos( nCPos ) >, otherwise the HScroll-thumb stays at the left.

I got it working with :

// nSGet[3] = max Cols
@ 173, 455 BTNBMP oBtn[15] ;
SIZE 32, 11 OF oDlg1 PIXEL 2007 ROUND ;
PROMPT "C 50%" ;
FONT oTxtfont ;
ACTION ( nCPos := INT(nSGet[3] * 0.5), oBrw2:SelectCol( Min( nCPos, Len( oBrw2:aCols ) ), .t. ), ;
oBrw2:Refresh(), oSay4:Refresh(), nObject := 0, oSay6:Refresh() )
oBtn[15]:cTooltip := "Jump to Col ( 50% )"
oBtn[15]:SetColor( 128 )

Forward :



Back to 10% moves the visible Col-Position to 10 on Screen and not the Record :
The Browser-Col-position is stll the same.



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion