Scroll Dialog and Mousewheel

Scroll Dialog and Mousewheel

Postby Dietmar Jahnel » Tue May 12, 2009 12:02 pm

A while ago I found a class to croll a dialog

Code: Select all  Expand view
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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Scroll Dialog and Mousewheel

Postby Antonio Linares » Tue May 12, 2009 4:07 pm

Dietmar,

This is basically what it is needed (code from TWBrowse):
Code: Select all  Expand view

   METHOD MouseWheel( nKeys, nDelta, nXPos, nYPos )
 

Code: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Scroll Dialog and Mousewheel

Postby Dietmar Jahnel » Fri May 15, 2009 6:25 pm

Many thanks,
Got this one to work! :D
Dietmar
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests