FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Scroll Dialog and Mousewheel
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Scroll Dialog and Mousewheel
Posted: Tue May 12, 2009 12:02 PM
A while ago I found a class to croll a dialog

Code (fw): Select all Collapse
CLASS TScrDlg

   DATA oDlg
   DATA nVPos,nHPos

   METHOD New( oDlg,nV1,nV2,nH1,nH2 ) CONSTRUCTOR
   METHOD SetScroll( nV1,nV2,nH1,nH2 )
   //-*------------------------------------------------------------
   METHOD VScroll()
   METHOD VScrollThumb()
   METHOD VScrollTrack()
   METHOD VScrollPgDown()
   METHOD VScrollPgUp()
   //-*-----------------------------
   METHOD HScroll()
   METHOD HScrollThumb()
   METHOD HScrollTrack()
   METHOD HScrollPgDown()
   METHOD HScrollPgUp()

ENDCLASS

....

Can anyone give me a hint how to implement the mousewheel for scrolling the dialog in this class?
This would be a big help,
Dietmar
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Scroll Dialog and Mousewheel
Posted: Tue May 12, 2009 04:07 PM
Dietmar,

This is basically what it is needed (code from TWBrowse):
Code (fw): Select all Collapse
   METHOD MouseWheel( nKeys, nDelta, nXPos, nYPos )

Code (fw): Select all Collapse
METHOD MouseWheel( nKeys, nDelta, nXPos, nYPos ) CLASS TWBrowse

   local aPos := { nYPos, nXPos }

   aPos = ScreenToClient( ::hWnd, aPos )

   if aPos[ 1 ] > ::nHeight * 0.80
      if nDelta > 0
         ::GoLeft()
      else
         ::GoRight()
      endif
   else
      if lAnd( nKeys, MK_MBUTTON )
         if nDelta > 0
            ::PageUp()
         else
            ::PageDown()
         endif
      else
         if nDelta > 0
            ::GoUp()
         else
            ::GoDown()
         endif
      endif
   endif

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Re: Scroll Dialog and Mousewheel
Posted: Fri May 15, 2009 06:25 PM

Many thanks,
Got this one to work! :D
Dietmar

Continue the discussion