<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>As noted by a user in the forum
(<a class="moz-txt-link-freetext" href="http://forum.lazarus.freepascal.org/index.php/topic,32754.msg211392.html#msg211392">http://forum.lazarus.freepascal.org/index.php/topic,32754.msg211392.html#msg211392</a>),
TsWorksheetGrid (the grid of the fpspreadsheet package) fails if
used within frames. I am aware that normally I myself take care of
fpspreadsheet, but in this case I am lost because I am not so
familiar with the TFrame architecture.</p>
<p>Whoever wants to look into this issue please note that the
package laz_fpspreadsheet_visual (from ccr) must be installed. <br>
</p>
<p>Run the attached demo to reproduce the bug.</p>
<p>- Click on buttonĀ "ShowWorksheetGridFrame". This should open a
form with an inserted TsWorksheetGrid. Hower, there is an error
message <b>"Control 'WorksheetGrid_Frame ' has not parent window"</b>.
The fact that you can open the project at all is because I removed
the form with the TsWorksheetGrid from the project. With this form
included I crashed Lazarus.</p>
<p>- The bug occurs only if the WorksheetGrid is added to the form
at designtime. Open unit "main". In "BtnWorksheetGridFrameClick",
comment the line "frame := TWorksheetGrid_Frame.Create(self)" and
uncomment the line "frame :=
TWorksheetGrid_Frame_Runtime.Create(self)". This activates code
creating the worksheetgrid at runtime. If you run the demo and
click the button, everything is ok.</p>
<p>- TsWorksheetGrid inherits from TsCustomDrawGrid, just like
TsDrawGrid. Button "ShowDrawGridFrame" inserts a frame containing
a design-time-created TDrawGrid. Everything is ok.</p>
<p>The crash happens in "InitInheritedComponent" of classes. Is
there anything which has to be initialized in TsWorksheetGrid to
pass this test? But then, why is TDrawGrid ok which just publishes
inherited properties; all the code is in its ancestor which is
shared with the failing TsWorksheetGrid.</p>
<p>Any help would be appreciated.<br>
</p>
</body>
</html>