DCPRINT PREVIEW Scroll wheel sensivety

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

DCPRINT PREVIEW Scroll wheel sensivety

#1 Post 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
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4728
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPRINT PREVIEW Scroll wheel sensivety

#2 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: DCPRINT PREVIEW Scroll wheel sensivety

#3 Post 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 
Regards,
Jack Duijf

Post Reply