Recent

Author Topic: THTMLPort OnMouseWheel scrolling not working  (Read 7398 times)

preahkumpii

  • New member
  • *
  • Posts: 7
THTMLPort OnMouseWheel scrolling not working
« on: August 23, 2012, 08:48:45 am »
After going back and forth between THTMLPort and THTMLViewer, I have settled on THTMLPort to render some html code I have, because THTMLViewer was not even compiling because of (apparently) a data type problem of some sort. Since I could get THTMLPort to at least compile my program and render the html properly, I went with it. However, the THTMLPort window will not scroll with the mouse wheel. The scroll bar works, and the middle-click drag scrolling works.

Though the two are not the same THTMLViewer (which I am not using now) does address an issue with the OnMouseWheel event not firing here. I have tried to implement the update mentioned in Comment 4 of the above link into THTMLPort but with no success. The program will then not compile. I assume this is simply because the two are just too different to make a few line changes and expect it to work.

So, can anyone assist in getting the mousewheel scrolling working in THTMLPort on Lazarus? I am running Lazarus 0.9.30.4 on Windows. Thanks much.
« Last Edit: August 24, 2012, 08:34:56 am by preahkumpii »

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: THTMLPort OnMouseWheel scrolling not working
« Reply #1 on: August 23, 2012, 08:08:12 pm »
I would guess that those are two completely different codebases by now, so taking changes from one can't be used in the other.

Check to see if DoMouseWheel and HTMLMouseWheel are being call (htmlview.pas) and, if so, what values they're seeing, etc.

Thanks.

-Phil

preahkumpii

  • New member
  • *
  • Posts: 7
Re: THTMLPort OnMouseWheel scrolling not working
« Reply #2 on: August 24, 2012, 03:47:31 am »
This is the only mention of OnMouseWheel in the entire unit:

Code: [Select]
{$ifdef ver120_plus}
property OnMouseWheel;
{$endif}

I am not sure of the significance of the {$ifdef ver120_plus}...{$endif}. This is wrapped around all instances of the HTMLMouseWheel method in the unit. I am (obviously) not an expert, but it seems that there should be something more than just this one mention of OnMouseWheel in the unit if it is going to fire.

Adam

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: THTMLPort OnMouseWheel scrolling not working
« Reply #3 on: August 24, 2012, 03:55:54 am »
This is the only mention of OnMouseWheel in the entire unit:

Code: [Select]
{$ifdef ver120_plus}
property OnMouseWheel;
{$endif}

I am not sure of the significance of the {$ifdef ver120_plus}...{$endif}. This is wrapped around all instances of the HTMLMouseWheel method in the unit. I am (obviously) not an expert, but it seems that there should be something more than just this one mention of OnMouseWheel in the unit if it is going to fire.

That should be defined. Look in htmlcons.inc.

Everything related to mouse wheel is standard LCL stuff - see LCL docs and source. That's where the basic functionality is - just being inherited here.

Check to see if it's being called with debugger or WriteLn or something.

Thanks.

-Phil

preahkumpii

  • New member
  • *
  • Posts: 7
Re: THTMLPort OnMouseWheel scrolling not working
« Reply #4 on: August 24, 2012, 04:01:34 am »
Thanks for the info. I think I got the {$ifdef ver120_plus}, so that's not the issue.
Because of my "novice-ness" can you direct me a little more as to what exactly I need to check? I am basically totally unfamiliar with the inner workings of LCL.

EDIT: If you are referring to checking to see if OnMouseWheel is being fired, I have checked that. It is not.

EDIT2: Previously, I had tested the OnMouseWheel event to see if it fired and it didn't. I just rechecked it and it threw up an error: "The method "HTMLViewer1MouseWheel" is incompatible to this event (OnMouseWheel).".
« Last Edit: August 24, 2012, 04:06:29 am by preahkumpii »

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: THTMLPort OnMouseWheel scrolling not working
« Reply #5 on: August 25, 2012, 03:50:15 am »
Thanks for the info. I think I got the {$ifdef ver120_plus}, so that's not the issue.
Because of my "novice-ness" can you direct me a little more as to what exactly I need to check? I am basically totally unfamiliar with the inner workings of LCL.

EDIT: If you are referring to checking to see if OnMouseWheel is being fired, I have checked that. It is not.

EDIT2: Previously, I had tested the OnMouseWheel event to see if it fired and it didn't. I just rechecked it and it threw up an error: "The method "HTMLViewer1MouseWheel" is incompatible to this event (OnMouseWheel).".

OnMouseWheel is a property that you assign an event handler to if you want code in your form to be able to respond to the wheel scrolling. If you're just trying to activate scrolling support, this property is irrelevant, although you can use it to test whether the event handler gets called - I just did and it does not appear to get called. Perhaps an LCL bug?

Thanks.

-Phil



preahkumpii

  • New member
  • *
  • Posts: 7
Re: THTMLPort OnMouseWheel scrolling not working
« Reply #6 on: August 25, 2012, 05:22:50 am »
I cannot comment on whether or not it is an LCL bug. I can confirm that OnMouseWheel doesn't fire.

preahkumpii

  • New member
  • *
  • Posts: 7
Re: THTMLPort OnMouseWheel scrolling not working
« Reply #7 on: August 25, 2012, 09:31:04 am »
Just in blind testing, I went ahead and put breakpoints all on a the lines of the htmlviewer.pas file to see if it is doing anything on the OnMouseOver event, and the debugger didn't stop for any of them.

 

TinyPortal © 2005-2018