• Hello,
    I have been working with a WPrichText for a little over a week now. And in the last two days I have found that when I use the mousewheel down, it scrolls at a very nice pace. However when I scroll up it goes all the way to the top, in only once click of the mousewheel.

    Now I have tested it in a fresh program with only the WPRichText on the form and it works there as it should.

    However does anyone have any idea what could be happening in my program? No where in code am i setting the CPPosition to the top. Nowhere am I calling any scrollbar functions.

    Thank you for your help.

  • Hello,
    Well I tested that idea out, and was going to send it to you, but when I copied it into a new app the problem went away. So my thought is that it must be in my code somewhere. However, I just noticed that in the original program it has the same problem in the IDE, before the program is even running.

    I'm still working on it and ill get back here to post when i find something new. Thank you for any more help you can provide.

  • Update:

    On the popup menu of the scroll bar when you right click on it, clicking the "scroll up" option works! It scrolls up an equal amount that it scrolls down. But still if you turn the mousewheel up one notch it jumps all the way up to the top.

  • Hello,

    I appreciate you putting in a workaround. I, however, have still not found the cause of this issue. What outside of wptools is causing the mousewheelup to be called so many times?

    Thank you

    • Offizieller Beitrag

    Hi,

    I have no idea. What I put in was a check for tickcount to ignore subsequent calles to the event within 10mms.

    in WPCtrMemo.pas

    Code
    function TWPCustomRtfEdit.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean;
    var
      tim : Cardinal;
    {$IFNDEF DONT_USE_MOUSEWHEEL}Last: Integer; {$ENDIF}
    begin
      Result := inherited DoMouseWheelUp(Shift, MousePos);
      // Workaround Bug - Wheel Up comes too often
      tim := GetTickCount;
      if tim<FLastMouseWheel+10 then exit;
      FLastMouseWheel := tim;

    Anybody knows why DoMouseWheelUp comes so often?

    Julian