Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-08

Disable scrolling to clicked cell in TCustomGrid.

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

cobines

Hello.

Currently the default behaviour of TCustomGrid is that when you click or drag mouse cursor then the selected cell will become entirely visible by scrolling the control. Sometimes even when the target cell is already fully visible, the grid is scrolled in such a way that it "begins" with a full column, i.e., not in the middle of the column. This is not desired behaviour for me and I wanted to make an option to disable it.

Is it possible to do it without breaking compatibility with existing code? I've attached the changes that I have made so far. I've added a 'goDisableScrollWithMouse' option that is disabled by default (as opposed to 'goScrollWithMouse' that would be enabled by default), so that current code that didn't know about this option will continue to work correctly. I hope this is enough.

What should I do with GRIDFILEVERSION? Do I have to increase to 4? It is used in TCustomGrid.LoadContent to determine if the option value has to be read (for example for goSmoothScroll). In the attached diff those are the lines that are commented out.

Is it better to do it with a property/variable than a grid option?

cobines -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090807/f78677ad/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: goDisableScrollWithMouse.diff Type: text/x-patch Size: 4561 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090807/f78677ad/attachment.bin>

Reply by email