Hello,
I'm writing an article about docking in Lazarus.
The first - and most simple - example I tried, failed:
- Drop a panel on a form
- Set dragkind to dkDock
- Set dragmode to dkAutomatic.
- Run application
- Drag panel outside form, and let go.
expected behaviour: a small form should appear, and the panel should be on it.
Actual behaviour: 4 Access violations (fix one to get to the next ;) ).
Attached small patch fixes the 4 access violations, after which the expected behaviour occurs. They are all checks to see if a object pointer is not-nil.
Better would be to fix the root of the problem:
I think the automatic creation of a dockhost form probably uses createnew(), which maybe doesn't correctly allocate all structures (scrollbars/icons). But that is just a wild guess, which I currently don't have time to investigate.
Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lcl-docking.diff
Type: text/x-diff
Size: 1461 bytes
Desc:
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100404/8438638b/attachment.bin>
