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

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

Postby ukoenig » Mon Jul 30, 2012 1: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)

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
Last edited by ukoenig on Mon Jul 30, 2012 3:17 pm, edited 1 time in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby nageswaragunupudi » Mon Jul 30, 2012 1:42 pm

If you want to go to a particular column number,

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10251
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby ukoenig » Mon Jul 30, 2012 3: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: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 :?:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 17 guests