tcbrowse horizontal scroll

tcbrowse horizontal scroll

Postby MarcoBoschi » Mon Jun 25, 2012 4:26 pm

Hi,
there is a problem in this little sample.

If I click in scrollbar in this point (plase see figure)

Image

First two columns disappear and remains only the third one
How can I disable horizontal scroll bar?

Bye and many thanks


Code: Select all  Expand view

#include "Fivewin.ch"
#include "Tcbrowse.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrw
    LOCAL oCol

    USE Customer ALIAS Test

    DEFINE DIALOG oDlg SIZE 200 , 400

    @ 0, 0 BROWSE oBrw

    oCol := TcColumn():New( "First" , { || TEST->first } , ,  , , 0 ,  60 , , , , , , , )
    oBrw:addcolumn( oCol )

    oCol := TcColumn():New( "Last" , { || TEST->last }  , ,  , , 0 ,  60 , , , , , , , )
    oBrw:addcolumn( oCol )

    oCol := TcColumn():New( "Age" , { || TEST->age } , ,  , , 2 ,  60 , , , , , , , )
    oBrw:addcolumn( oCol )

//     oCol := TcColumn():New( "" ,  , ,  , , 0 , 10 , , , , , , , )
//     oBrw:addcolumn( oCol )

    oBrw:lCellStyle = .T.

    ACTIVATE DIALOG oDlg;
             ON INIT oDlg:SetControl( oBrw );
             CENTER ;
             VALID MsgYesNo( "Want to exit ?" )

    CLOSE

    RETURN NIL

 
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: tcbrowse horizontal scroll

Postby StefanHaupt » Tue Jun 26, 2012 7:28 am

Marco,

you can try to freeze the most left colums

Code: Select all  Expand view
oBrw:nFreeze := 2


or disable the the scrollbar

Code: Select all  Expand view
oBrw:lNoHScroll := .t.
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: tcbrowse horizontal scroll

Postby MarcoBoschi » Tue Jun 26, 2012 7:54 am

Ok,
oBrw:nFreeze := 2
this line it's ok

Other solution
oBrw:lNoHScroll := .t.
creates this problem

Application
===========
Path and name: C:\Fwh\samples\test.exe (32 bits)
Size: 1,997,312 bytes
Time from start: 0 hours 0 mins 5 secs
Error occurred at: 06/26/12, 09:51:05
Error description: Error BASE/1004 Class: 'NIL' has no exported method: SETPOS
Args:
[ 1] = U
[ 2] = N 3

Stack Calls
===========
Called from: => SETPOS(0)
Called from: wbrowse.prg => TCBROWSE:HSCROLL(1696)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: control.prg => TCONTROL:HANDLEEVENT(1469)
Called from: wbrowse.prg => TCBROWSE:HANDLEEVENT(1651)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: test.prg => MAIN(34)



but no matter I will use the other
Many thanks

marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: tcbrowse horizontal scroll

Postby MarcoBoschi » Tue Jun 26, 2012 2:01 pm

errata:
In the real sotuation this
oBrw:nFreeze := 2
or other differen value
does not work

Is it possible to hide Horiz scroll bar?
Other error persists
bye marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: tcbrowse horizontal scroll

Postby MarcoBoschi » Tue Jun 26, 2012 2:22 pm

I hope I don't create other problems in this way

wbrowse.prg

case nScrollCode == SB_PAGEDOWN
while nCol < Len( ::GetColSizes() ) .and. ;
(::IsColVisible( nCol ) .or. ::nColPos == nCol)
nCol++
end
IF ::lNoHScroll <> .T.
::nColPos := nCol
::nColAct := nCol
::oHScroll:SetPos( nCol )
::Refresh( .f. )
ENDIF
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: tcbrowse horizontal scroll

Postby StefanHaupt » Wed Jun 27, 2012 7:49 am

::lNoHScroll is an enhancement of tcbrowse, it does not exist in wbrowse. The problem is the HScroll() method of wbrowse, which is not overwritten in tcbrowse. As a workaround you can try to define your own method hscroll() in tcbrowse.

maybe like this (not tested)
Code: Select all  Expand view
METHOD HScroll (nWParam, nLParam) INLINE IIF (!::lNoScroll, super:HScroll(nWParam, nLParam), nil)
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 97 guests