Page 1 of 1

DCPRINT PREVIEW Scroll wheel sensivety

Posted: Thu Oct 06, 2022 1:06 pm
by jdsoft
Hello,
How can i control the number of scroll lines using the scroll-wheel in a DCPRINT PREVIEW
I tried SCROLLFACTOR 2, but that does not seem to work.
Suggestions are welcome

Re: DCPRINT PREVIEW Scroll wheel sensivety

Posted: Fri Oct 07, 2022 6:57 am
by rdonnay
Jack -

I may have to put a special handler in that code.
I haven't touched the dcprint system in years.
I'll see what I can do.

Re: DCPRINT PREVIEW Scroll wheel sensivety

Posted: Sat Oct 08, 2022 11:53 am
by jdsoft
Hello Roger,

I already found where to handle this in _dcprc.prg, XbpPreview:vScroll()
Quite simple to fix.
I am also looking for suppressing every second event of the scroll that Windows seems to fire if the mousewheel is changed just one notch.

Can you please add this to the next version?

For simplicity i set the scroll range to 50, but this ofcourse should be a parameter in DCPRINT ON and DCPRINT OPTIONS.

Code: Select all

   LOCAL nScrollDepth := 50
   CASE nCommand == XBPSB_PREVPOS
      //
      // 08-10-2022  J. Duijf 
      // Smooth scrolling 
      //
      nScroll = ::vScroll:getData()
      If nScroll > 0
         If nScrollDepth > 0
            nScroll  -= nScrollDepth 
         Else 
            nScroll  -= ::vScroll:setScrollBoxSize()
         Endif 
         ::vScroll:setData( Max(nScroll, 0) )
         ::setOrigin( ::hScroll:getData(), ::vScroll:getData() )
      Else 
         //
         // Already on top,
         // Prevent flickering of the preview 
         //
      Endif 
   CASE nCommand == XBPSB_NEXTPOS
      //
      // 08-10-2022  J. Duijf 
      // Smooth scrolling 
      //
      If nScrollDepth > 0
         nScroll  := ::vScroll:getData() + nScrolDepth     
      Else 
         nScroll  := ::vScroll:GetData() + ::vScroll:setScrollBoxSize()
      Endif  
      If nScroll < ::vScroll:setRange()[2]
         //
         // Only if there is something to Scroll
         // 
         ::vScroll:setData( Min(nScroll, ::vScroll:setRange()[2]) )
         ::setOrigin( ::hScroll:getData(), ::vScroll:getData() )
      Else  
         //
         // No scroll possible 
         // Prevent flickering of the preview 
         //
      Endif