WPCubed Product Support

Scrollbar

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.

#1 ♥ 0
7.1k Views 2 users read 3 min
support

Hi,

Do the two application use the same LayoutMode?

You can also copy the TWPRichText which does not work into a new appl and send it to me.

Julian

#2 ♥ 0

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.

#3 ♥ 0

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.

#4 ♥ 0
support

Hello,

I see what You mean. It appears the DoMouseWheelUp is called 3 times instead of once, this is not caused by wptools but I can put in a work around for this.

Julian

#5 ♥ 0

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

#6 ♥ 0
support

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

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

#7 ♥ 0

Hello,

Sorry it took so long to get back here, but I dropped the code in to the pas file and it worked like a charm.

Thank you

#8 ♥ 0
This category is archived. No new posts are possible.