[Lazarus] Mousewheel events on TCustomControl

Vojtěch Čihák vojtech.cihak at atlas.cz
Tue Oct 3 19:32:28 CEST 2017


Hi,
 
your scrollbars are part of control? I mean, are they created via
  ShowScrollBar(Handle, SB_HORZ, True);
  ShowScrollBar(Handle, SB_VERT, True);  ?
 
You wrote component ECScheme, it is part of ECControls and I didn't use DoMouseWheelxxx methods at all. I use
  procedure WMHScroll(var Msg: TWMScroll); message WM_HSCROLL;
  procedure WMVScroll(var Msg: TWMScroll); message WM_VSCROLL;  
instead to update area and it works well.
 
V.
______________________________________________________________
> Od: Martok via Lazarus <lazarus at lists.lazarus-ide.org>
> Komu: lazarus at lists.lazarus.freepascal.org
> Datum: 03.10.2017 18:32
> Předmět: [Lazarus] Mousewheel events on TCustomControl
>
Hi all,
 
 I'm having some strange trouble with mouse interaction with a
 TCustomControl-derived component. I have only been able to test with the win32
 widgetset, and it works on some machines and doesn't work on others.
 
 The component draws its content to its TCanvas, and additionally places some
 controls in its client space. Specifically, TScrollBars which the user can use
 to scroll segments of the content.
 
 I want to add mouse wheel scrolling in the client area, so I overwrite
 DoMouseWheel and put my handling there. This works well on some systems, but for
 others (including my main development system), the MouseWheel message is not
 delivered to the CustomControl, but instead to what appears to be the first
 TScrollbar (not necessarily the focused control). The component never receives it.
 
 Do you have an idea what could be happening here, and how I could fix that?
 MouseCapture might be an idea, but all examples I've seen don't seem very
 reliable at un-capturing. I also want the solution to be stable across other
 widgetsets...
 -- 
 Martok
 
 
 -- 
 _______________________________________________
 Lazarus mailing list
 Lazarus at lists.lazarus-ide.org
 https://lists.lazarus-ide.org/listinfo/lazarus <https://lists.lazarus-ide.org/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171003/555a6486/attachment.html>


More information about the Lazarus mailing list