TTrackbar issues too many OnChanges
Original Reporter info from Mantis: mike.cornflake
-
Reporter name: Mike Thompson
Original Reporter info from Mantis: mike.cornflake
- Reporter name: Mike Thompson
Description:
Win32 TTrackbar issues extra OnChange events.
When a MouseUp occurs, two additional OnChange are sent.
When the user uses a keyboard, one additional OnChange is set per keypress.
Confirmed with both Lazarus 1.2.4 and Lazarus trunk.
Steps to reproduce:
Run the attached Demo.
Modifying the Trackbar in code (top button) results in the expected number of OnChange
Use Mouse or keyboard and additional OnChanges are tracked and reported.
Additional information:
(No Trunk option available under Product Version)
I'm not all that familiar with the LCL messaging, but from what I can make out, this is a Win32 issue, not an LCL. The OnChange is only issued in response to the TrackBar receiving a LM_CHANGE message.
At this time I cannot find where the WM_ messages are converted to LM_ messages. I will keep looking.
I've attached a patch that I admit workarounds the issue, not solves it. The OnChange is only fired when Position is actually changed. With the supplied patch, the control itself will still receive too many LM_CHANGE messages.
Mantis conversion info:
- Mantis ID: 26358
- OS: Windows
- OS Build: 8
- Build: Lazarus Trunk
- Platform: win32
- Fixed in version: 1.3 (SVN)
- Fixed in revision: 46326 (#4c44bbae)
- Monitored by: » mike.cornflake (Mike Thompson)
- Target version: 1.2.6