<div dir="ltr"><div class="gmail_default" style="font-size:large">why not use the TstringGrid component?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-29 19:02 GMT+01:00 Werner Pamler via Lazarus <span dir="ltr"><<a href="mailto:lazarus@lists.lazarus-ide.org" target="_blank">lazarus@lists.lazarus-ide.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Am 29.12.2016 um 16:59 schrieb Bart via Lazarus:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I am in need of a component/clas that can hold a 2 dimensional "table"<br>
of strings.<br>
The dimensions are unknown at designtime: I read the data from a HTML table.<br>
The HTML reader provides events that give me the data of each cell,<br>
and that tell me whenever a row is started or closed.<br>
<br>
The class should be able to:<br>
- access individual "cellls" (read/write)<br>
- add or insert a row (with an without data (TStrings and Array of<br>
String must be supprted as the datatype)). Note: adding a row must be<br>
possible when the dimensions of the table are yet unknown.<br>
- upon adding a row, it should be able to extend the dimensions of the table<br>
- the strings itself may contain LineEndings<br>
<br>
Not needed right now, but nice to have:<br>
- add or insert a column (with an without data)<br>
- upon adding a column, it should be able to extend the dimensions of the table<br>
- delete a row or column<br>
<br>
<br>
I have no need for saving the table to disk in any way.<br>
The program that uses this class should not need external libraries,<br>
since I cannot install those on the target computer I need my program<br>
on.<br>
<br>
I botched up some class that can do this (good enough for my purposes,<br>
but it's not nice code), but I was wondering if there already is some<br>
component that is more suitable (and well tested) for this.<br>
Using some sort of in memory dataset comes to mind, but I never use<br>
databases in my programs at all, so I'm a complete novice on that<br>
topic.<br>
</blockquote>
<br></div></div>
fpspreadsheet? It even has a html reader, but might be an overkill though. Internally it uses a TAVLTree for storing the cells. This tree is extremely fast. Maybe you can build your class around it.<br>
<br>
Or the TVirtualGrid from grids.pas which is used internally by TCustomGrid and its descendants?<div class="HOEnZb"><div class="h5"><br>
-- <br>
______________________________<wbr>_________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus-ide.org" target="_blank">Lazarus@lists.lazarus-ide.org</a><br>
<a href="http://lists.lazarus-ide.org/listinfo/lazarus" rel="noreferrer" target="_blank">http://lists.lazarus-ide.org/l<wbr>istinfo/lazarus</a><br>
</div></div></blockquote></div><br></div>