Sign in Join
Wiki copytemporary

TSubForm: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: TSubForm

OldNewLine
1+> **Warning:** TSubform and its documentation seem to be unmaintained...
2+
3+**TSubForm** is a Data-Aware SubForm
4+
5+This component is exactly what it sounds like - a subform component. Use it as you would a TPanel - drop components on it, assign a DataSource and at runtime the magic begins.
6+
7+At runtime, all the original components are hidden - Don't Panic! They are duplicated using streams for every record in the DataSource's dataset. If you have added any data-aware components to the component, and their Datasources are set to the same as the component, the duplicates are assigned a new DataSource which maps onto a TMemDataSet. Okay, that sounds nice and complex, but the end result is that the component replicates your controls for every row in the table it's assigned to.
8+
9+This means with NO CODE, you can create a customised row (or Column - see the Direction property) layout for any dataset. Assign a very small amount of code to TDBEdit's KeyUp event to check for VK_RETURN and you can even edit it. This is achieved by a BeforePost event on the underlying TMemDataSet.
10+
11+#### Bugs/Enhancements
12+
13+Well, it's probably pretty easy to make this fall over I would imagine, but it is only 0.1 :-) I really want to make a .Post procedure so you can fire a post to the active memds (and therefore the real DS) but I've run out of debugging time for now. The code is mostly written, just something causes a sigsegv I haven't had time to chase down.
14+
15+Thanks : giantm and all the folks on \#lazarus-ide for helping me figure some of the more complex stuff especially RTTI
16+
17+Its main caracteristics are :
18+
19+- Row or Column per row in the dataset
20+- Seamless Memory Dataset per row
21+- Data-Aware components are set to Memory Dataset if set to the same as the component.
22+- Posts to the Memory Dataset will post back to the DataSource's dataset.
23+
24+The download contains the component, an installation package and a demo application, that illustrates the features of the component.
25+
26+If you add components to the form that are not in the Standard, Additional or Data Controls pallettes, you will need to write your own OnFindClass procedure as at [[Streaming components|Reading a component from a stream]]. I elected to create a property you can use called CascadeFindClass, so you can decide if to use mine, your own or mine then your own.
27+
28+### Screenshot
29+
30+To follow soon.
31+
32+### Author
33+
34+### License
35+
36+Your choice of :
37+
38+- [GPL](http://www.opensource.org/licenses/gpl-license.php)
39+- [LGPL](http://www.opensource.org/licenses/lgpl-license.php)
40+- The modified LGPL that Lazarus is distributed under - see [Lazarus' COPYING.modifiedLGPL](http://svn.freepascal.org/svn/lazarus/trunk/COPYING.modifiedLGPL)
41+
42+(please contact the author if the License options above don't work with your project licensing)
43+
44+### Download
45+
46+The latest stable release can be found on [Lazarus-ccr's SF.net download page](http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=230010).
47+
48+### Change Log
49+
50+- Version 0.1 *Apr 26 2007*
51+
52+### Dependencies / System Requirements
53+
54+Requirements : A Bookmarkable DataSet and a DataSource. Note: at least TDBF and TMemDS in current FPC ARE bookmarkable, but appear not to be (.BookMarkValid always returns false even for valid bookmarks).
55+
56+Built in Lazarus svn 10988 on Linux, doesn't seem to work on win32 svn10809.
57+
58+Status: *Alpha* First Release, works here.
59+
60+Issues: Might have issues with AutoInc Fields, as MemDS doesn't implement them
61+
62+### Installation
63+
64+- Open the .lpk file in lazarus
65+- Press the Install button on the Package manager
66+
67+### The *TSubForm* Example Application
68+
69+**Installation**
70+
71+- Open example/testproject.lpi
72+- compile
73+- run
74+
75+---
76+*From the Free Pascal wiki, page "TSubForm", as it stood on 2023-02-15 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
77+Category: Components
78+Category: Databases
79+Category: Lazarus
80+Category: Lazarus-CCR
81+Category: Outdated information

Back to history