Page 1 of 1

xBrowse => oBrw:SelectCol(nPos) doesn't work ?

PostPosted: Mon Jul 30, 2012 1:09 pm
by ukoenig
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)

Image

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

Image

Re: xBrowse => oBrw:SelectCol(nPos) doesn't work ?

PostPosted: Mon Jul 30, 2012 1:42 pm
by nageswaragunupudi
If you want to go to a particular column number,

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

Re: xBrowse => oBrw:SelectCol(nPos) doesn't work ?

PostPosted: Mon Jul 30, 2012 3:22 pm
by ukoenig
Mr. Rao,

Thank You very much.
I tested, but it seems to work only in one Direction
I still had to add < oBrw:oHScroll: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 :

Image

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

Image

Best Regards
Uwe :?: