Page 1 of 1

Xbase 2.0/Express 264/265 Browse roller button moves 3 lines

Posted: Fri Aug 11, 2017 2:20 pm
by Cliff Wiernik
I know this has occurred before but don't know if its recurrence is due to Xbase2.0. With a DCBROWSE, if you use the up/down arrow, it moves one row. But with the mouse wheel, it moves 3 lines at a time.

How can this be corrected?

Re: Xbase 2.0/Express 264/265 Browse roller button moves 3 l

Posted: Fri Aug 11, 2017 2:50 pm
by Cliff Wiernik
I currently have this code:

in my main application program prior to the initial DCREAD GUI

IF version(3) > '349'
DC_ReadGuiHandler({|a,b,c,d,e,f| LB_DefaultHandler(a,b,c,d,e,f)})
ENDIF

*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
*+ Function LB_defaultHandler(nEvent, mp1, mp2, oXbp, oDlg)
*+
*+ Default Handler to change the browse scrolling from the wheel to 1 row instead of 3 rows at a time
*+
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
FUNCTION LB_DefaultHandler(nEvent, mp1, mp2, oXbp, oDlg)
IF nEvent == xbeM_Wheel .AND. oXbp:IsDerivedFrom('XbpBrowse')
mp2[2] := mp2[2]/3
oXbp:handleEvent(nEvent, mp1, mp2)
RETURN DCGUI_IGNORE
ENDIF

RETURN DCGUI_NONE

To the best of my knowledge, this used to work but does not appear to work now.

Cliff

Re: Xbase 2.0/Express 264/265 Browse roller button moves 3 l

Posted: Fri Aug 11, 2017 3:33 pm
by Cliff Wiernik
It appears the object send is not the browse object any more but the XbpCellGroup object.

Replacing XbpBrowse with XbpCellGroup fixed the problem.

Re: Xbase 2.0/Express 264/265 Browse roller button moves 3 l

Posted: Fri Aug 11, 2017 3:47 pm
by rdonnay
You can override the event in the handler:
I found this code in the old XBP_BRW.PRG source code from Alaska. They divided by 120. I changed it to 360.

This is working for me:

Code: Select all

#define SPI_GETWHEELSCROLLLINES  104

STATIC FUNCTION MyHandler( nEvent, mp1, mp2, oXbp, oDlg, GetList )

LOCAL i := 0, j

IF nEvent == xbeM_Wheel .AND. oXbp:isDerivedFrom('XbpColumn')

  SystemParametersInfoA( SPI_GETWHEELSCROLLLINES, 0, @i, 0 )
  IF i < 0
    i := oXbp:RowCount
  ENDIF
  i := Int( (Mp2[2] / 360) * i )

  i *= (-1)

  DC_ClearEvents()

  PostAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, i, oXbp:parent )

  RETURN DCGUI_IGNORE

ENDIF

RETURN DCGUI_NONE


Re: Xbase 2.0/Express 264/265 Browse roller button moves 3 l

Posted: Tue Aug 15, 2017 8:15 am
by Cliff Wiernik
This also appears to be a mouse properties setting. Under wheel, Vertical Scrolling, Roll the wheel one notch to scroll; the following number of lines at a time. 3 appears to be the default.

Re: Xbase 2.0/Express 264/265 Browse roller button moves 3 l

Posted: Tue Aug 15, 2017 8:46 am
by Auge_Ohr
Cliff Wiernik wrote:3 appears to be the default.
this is what Constante SPI_GETWHEELSCROLLLINES will read from Registry

https://msdn.microsoft.com/en-us/librar ... s.85).aspx
SystemParametersInfo function

SPI_GETWHEELSCROLLLINES
0x0068
Retrieves the number of lines to scroll when the vertical mouse wheel is moved.
The pvParam parameter must point to a UINT variable that receives the number of lines.
The default value is 3.
you can goto System -> Mouse and change it if you like.