Examples, dblookup example from Leslie Kaye

git-svn-id: trunk@19140 -
This commit is contained in:
jesus 2009-03-28 16:22:11 +00:00
parent d72c8f6da9
commit 7f68d3bce3
15 changed files with 6278 additions and 0 deletions

14
.gitattributes vendored
View File

@ -2086,6 +2086,20 @@ examples/cursors/project1.lpr svneol=native#text/pascal
examples/cursors/unit1.lfm svneol=native#text/plain
examples/cursors/unit1.lrs svneol=native#text/pascal
examples/cursors/unit1.pas svneol=native#text/pascal
examples/database/dblookup/data/lookerup.dbf -text
examples/database/dblookup/data/lookerup.mbf -text
examples/database/dblookup/data/months.dbf -text
examples/database/dblookup/data/months.mbf -text
examples/database/dblookup/project1.ico -text svneol=unset#image/ico
examples/database/dblookup/project1.lpi svneol=native#text/plain
examples/database/dblookup/project1.lpr svneol=native#text/plain
examples/database/dblookup/project1.lrs svneol=native#text/plain
examples/database/dblookup/project1.manifest svneol=native#text/plain
examples/database/dblookup/project1.rc svneol=native#text/plain
examples/database/dblookup/readme.txt svneol=native#text/plain
examples/database/dblookup/unit1.lfm svneol=native#text/plain
examples/database/dblookup/unit1.lrs svneol=native#text/plain
examples/database/dblookup/unit1.pas svneol=native#text/plain
examples/designerbaseclass/README.txt svneol=native#text/plain
examples/designerbaseclass/customcomponentclass.pas svneol=native#text/plain
examples/designerbaseclass/designbaseclassdemopkg.lpk svneol=native#text/plain

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -0,0 +1,599 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="7"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=".exe"/>
<Icon Value="0"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="5">
<Item1>
<PackageName Value="DBFLaz"/>
<MinVersion Minor="1" Release="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="SDFLaz"/>
<MinVersion Minor="1" Release="1" Valid="True"/>
</Item2>
<Item3>
<PackageName Value="FCL"/>
<MinVersion Major="1" Valid="True"/>
</Item3>
<Item4>
<PackageName Value="MemDSLaz"/>
<MinVersion Major="1" Minor="2" Release="1" Valid="True"/>
</Item4>
<Item5>
<PackageName Value="LCL"/>
</Item5>
</RequiredPackages>
<Units Count="76">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<CursorPos X="25" Y="13"/>
<TopLine Value="1"/>
<UsageCount Value="259"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<CursorPos X="40" Y="54"/>
<TopLine Value="44"/>
<EditorIndex Value="0"/>
<UsageCount Value="259"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\lazarus\lcl\dbctrls.pp"/>
<UnitName Value="DbCtrls"/>
<CursorPos X="28" Y="42"/>
<TopLine Value="1"/>
<UsageCount Value="129"/>
<Bookmarks Count="1">
<Item0 X="1" Y="148" ID="0"/>
</Bookmarks>
</Unit2>
<Unit3>
<Filename Value="..\lazarus\lcl\include\customdbcombobox.inc"/>
<CursorPos X="41" Y="155"/>
<TopLine Value="118"/>
<UsageCount Value="129"/>
</Unit3>
<Unit4>
<Filename Value="..\lazarus\lcl\include\dblookup.inc"/>
<IsPartOfProject Value="True"/>
<CursorPos X="63" Y="195"/>
<TopLine Value="1"/>
<UsageCount Value="259"/>
</Unit4>
<Unit5>
<Filename Value="..\lazarus\lcl\include\dblookupcombobox.inc"/>
<IsPartOfProject Value="True"/>
<CursorPos X="8" Y="38"/>
<TopLine Value="27"/>
<UsageCount Value="259"/>
</Unit5>
<Unit6>
<Filename Value="..\lazarus\lcl\include\dblistbox.inc"/>
<CursorPos X="38" Y="41"/>
<TopLine Value="1"/>
<UsageCount Value="129"/>
</Unit6>
<Unit7>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\base\db.pas"/>
<UnitName Value="db"/>
<CursorPos X="26" Y="1476"/>
<TopLine Value="1454"/>
<UsageCount Value="104"/>
</Unit7>
<Unit8>
<Filename Value="..\lazarus\fpc\2.2.3\source\rtl\inc\variants.pp"/>
<UnitName Value="variants"/>
<CursorPos X="46" Y="2804"/>
<TopLine Value="2782"/>
<UsageCount Value="103"/>
</Unit8>
<Unit9>
<Filename Value="..\lazarus\lcl\include\customform.inc"/>
<CursorPos X="54" Y="437"/>
<TopLine Value="403"/>
<UsageCount Value="7"/>
</Unit9>
<Unit10>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\memds\memds.pp"/>
<UnitName Value="memds"/>
<CursorPos X="20" Y="168"/>
<TopLine Value="164"/>
<UsageCount Value="7"/>
</Unit10>
<Unit11>
<Filename Value="..\lazarus\ideintf\dbpropedits.pas"/>
<UnitName Value="DBPropEdits"/>
<CursorPos X="85" Y="133"/>
<TopLine Value="105"/>
<UsageCount Value="10"/>
</Unit11>
<Unit12>
<Filename Value="..\lazarus\components\memds\frmselectdataset.pp"/>
<ComponentName Value="SelectSrcDatasetForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="frmSelectDataset"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="7"/>
</Unit12>
<Unit13>
<Filename Value="..\lazarus\components\memds\memdslaz.pas"/>
<UnitName Value="MemDSLaz"/>
<CursorPos X="42" Y="6"/>
<TopLine Value="1"/>
<UsageCount Value="7"/>
</Unit13>
<Unit14>
<Filename Value="..\lazarus\components\memds\memdslaz.lpk"/>
<CursorPos X="41" Y="14"/>
<TopLine Value="1"/>
<UsageCount Value="7"/>
<SyntaxHighlighter Value="XML"/>
</Unit14>
<Unit15>
<Filename Value="..\lazarus\ideintf\checkgroupeditordlg.lfm"/>
<CursorPos X="22" Y="5"/>
<TopLine Value="1"/>
<UsageCount Value="7"/>
<SyntaxHighlighter Value="LFM"/>
</Unit15>
<Unit16>
<Filename Value="..\lazarus\ideintf\lazideintf.pas"/>
<UnitName Value="LazIDEIntf"/>
<CursorPos X="73" Y="374"/>
<TopLine Value="366"/>
<UsageCount Value="7"/>
</Unit16>
<Unit17>
<Filename Value="..\lazarus\ideintf\allideintf.pas"/>
<UnitName Value="AllIDEIntf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="29"/>
<UsageCount Value="7"/>
</Unit17>
<Unit18>
<Filename Value="unit1.lfm"/>
<CursorPos X="34" Y="251"/>
<TopLine Value="225"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="LFM"/>
</Unit18>
<Unit19>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\sdf\sdfdata.pp"/>
<UnitName Value="SdfData"/>
<CursorPos X="14" Y="133"/>
<TopLine Value="132"/>
<UsageCount Value="8"/>
</Unit19>
<Unit20>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\base\datasource.inc"/>
<CursorPos X="3" Y="559"/>
<TopLine Value="614"/>
<UsageCount Value="11"/>
</Unit20>
<Unit21>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\base\dataset.inc"/>
<CursorPos X="26" Y="1678"/>
<TopLine Value="1663"/>
<UsageCount Value="9"/>
</Unit21>
<Unit22>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\dbase\dbf.pas"/>
<UnitName Value="dbf"/>
<CursorPos X="30" Y="1675"/>
<TopLine Value="1651"/>
<UsageCount Value="8"/>
</Unit22>
<Unit23>
<Filename Value="..\lazarus\lcl\include\control.inc"/>
<CursorPos X="7" Y="2006"/>
<TopLine Value="1987"/>
<UsageCount Value="8"/>
</Unit23>
<Unit24>
<Filename Value="..\lazarus\lcl\include\buttoncontrol.inc"/>
<CursorPos X="1" Y="53"/>
<TopLine Value="34"/>
<UsageCount Value="8"/>
</Unit24>
<Unit25>
<Filename Value="..\lazarus\lcl\include\buttons.inc"/>
<CursorPos X="14" Y="309"/>
<TopLine Value="296"/>
<UsageCount Value="8"/>
</Unit25>
<Unit26>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\dbase\dbf_idxcur.pas"/>
<UnitName Value="dbf_idxcur"/>
<CursorPos X="3" Y="95"/>
<TopLine Value="93"/>
<UsageCount Value="8"/>
</Unit26>
<Unit27>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\dbase\dbf_dbffile.pas"/>
<UnitName Value="dbf_dbffile"/>
<CursorPos X="3" Y="43"/>
<TopLine Value="111"/>
<UsageCount Value="8"/>
</Unit27>
<Unit28>
<Filename Value="..\lazarus\components\tdbf\registerdbf.pas"/>
<UnitName Value="RegisterDBF"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="8"/>
</Unit28>
<Unit29>
<Filename Value="..\lazarus\lcl\include\dbradiogroup.inc"/>
<CursorPos X="3" Y="107"/>
<TopLine Value="105"/>
<UsageCount Value="9"/>
</Unit29>
<Unit30>
<Filename Value="..\lazarus\lcl\stdctrls.pp"/>
<UnitName Value="StdCtrls"/>
<CursorPos X="14" Y="614"/>
<TopLine Value="595"/>
<UsageCount Value="8"/>
</Unit30>
<Unit31>
<Filename Value="..\lazarus\lcl\include\customlistbox.inc"/>
<CursorPos X="31" Y="467"/>
<TopLine Value="448"/>
<UsageCount Value="8"/>
</Unit31>
<Unit32>
<Filename Value="..\lazarus\lcl\controls.pp"/>
<UnitName Value="Controls"/>
<CursorPos X="25" Y="999"/>
<TopLine Value="998"/>
<UsageCount Value="8"/>
</Unit32>
<Unit33>
<Filename Value="..\lazarus\components\synedit\synedit.pp"/>
<UnitName Value="SynEdit"/>
<CursorPos X="25" Y="10014"/>
<TopLine Value="9986"/>
<UsageCount Value="8"/>
</Unit33>
<Unit34>
<Filename Value="..\lazarus\fpc\2.2.3\source\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="55" Y="1529"/>
<TopLine Value="1502"/>
<UsageCount Value="8"/>
</Unit34>
<Unit35>
<Filename Value="..\lazarus\fpc\2.2.3\source\packages\fcl-db\src\base\fields.inc"/>
<CursorPos X="3" Y="293"/>
<TopLine Value="271"/>
<UsageCount Value="9"/>
</Unit35>
<Unit36>
<Filename Value="..\lazarus\lcl\include\dbcombobox.inc"/>
<CursorPos X="17" Y="37"/>
<TopLine Value="1"/>
<UsageCount Value="13"/>
</Unit36>
<Unit37>
<Filename Value="..\lazarus\lcl\include\dblookuplistbox.inc"/>
<CursorPos X="10" Y="31"/>
<TopLine Value="15"/>
<UsageCount Value="12"/>
</Unit37>
<Unit38>
<Filename Value="..\lazarus\lcl\include\dbedit.inc"/>
<CursorPos X="3" Y="69"/>
<TopLine Value="67"/>
<UsageCount Value="11"/>
</Unit38>
<Unit39>
<Filename Value="..\lazarus\ideintf\propedits.pp"/>
<UnitName Value="PropEdits"/>
<CursorPos X="11" Y="1023"/>
<TopLine Value="1001"/>
<UsageCount Value="9"/>
</Unit39>
<Unit40>
<Filename Value="..\lazarus\components\images\lazpng.pas"/>
<UnitName Value="LazPNG"/>
<CursorPos X="32" Y="31"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
</Unit40>
<Unit41>
<Filename Value="..\lazarus\components\README.txt"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
<SyntaxHighlighter Value="None"/>
</Unit41>
<Unit42>
<Filename Value="..\lazarus\images\components_images.lrs"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
</Unit42>
<Unit43>
<Filename Value="..\lazarus\images\components_images.bat"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
<SyntaxHighlighter Value="None"/>
</Unit43>
<Unit44>
<Filename Value="..\lazarus\images\components_images_list.txt"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
<SyntaxHighlighter Value="None"/>
</Unit44>
<Unit45>
<Filename Value="..\..\usr\local\share\fpcsrc\packages\fcl-base\src\custapp.pp"/>
<UnitName Value="CustApp"/>
<CursorPos X="73" Y="12"/>
<TopLine Value="9"/>
<UsageCount Value="9"/>
</Unit45>
<Unit46>
<Filename Value="..\components\tdbf\registerdbf.pas"/>
<UnitName Value="RegisterDBF"/>
<CursorPos X="100" Y="7"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
</Unit46>
<Unit47>
<Filename Value="..\..\fpc\packages\fcl-base\src\custapp.pp"/>
<UnitName Value="CustApp"/>
<CursorPos X="98" Y="4"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
</Unit47>
<Unit48>
<Filename Value="..\..\fpc\rtl\objpas\sysutils\finah.inc"/>
<CursorPos X="96" Y="6"/>
<TopLine Value="3"/>
<UsageCount Value="9"/>
</Unit48>
<Unit49>
<Filename Value="..\..\fpc\rtl\objpas\sysutils\fina.inc"/>
<CursorPos X="91" Y="38"/>
<TopLine Value="37"/>
<UsageCount Value="9"/>
</Unit49>
<Unit50>
<Filename Value="..\..\fpc\rtl\unix\sysunixh.inc"/>
<CursorPos X="2" Y="34"/>
<TopLine Value="14"/>
<UsageCount Value="9"/>
</Unit50>
<Unit51>
<Filename Value="..\lcl\dbctrls.pp"/>
<UnitName Value="DbCtrls"/>
<CursorPos X="17" Y="159"/>
<TopLine Value="132"/>
<UsageCount Value="18"/>
</Unit51>
<Unit52>
<Filename Value="..\lcl\include\dblookup.inc"/>
<CursorPos X="1" Y="64"/>
<TopLine Value="43"/>
<UsageCount Value="18"/>
</Unit52>
<Unit53>
<Filename Value="..\lcl\include\dblookuplistbox.inc"/>
<CursorPos X="27" Y="109"/>
<TopLine Value="71"/>
<UsageCount Value="18"/>
</Unit53>
<Unit54>
<Filename Value="..\..\fpc\packages\fcl-db\src\base\db.pas"/>
<UnitName Value="db"/>
<CursorPos X="16" Y="286"/>
<TopLine Value="286"/>
<UsageCount Value="13"/>
</Unit54>
<Unit55>
<Filename Value="..\lcl\include\dblookupcombobox.inc"/>
<CursorPos X="15" Y="100"/>
<TopLine Value="67"/>
<UsageCount Value="14"/>
</Unit55>
<Unit56>
<Filename Value="..\..\fpc\packages\fcl-db\src\base\dataset.inc"/>
<CursorPos X="3" Y="2252"/>
<TopLine Value="2247"/>
<UsageCount Value="13"/>
</Unit56>
<Unit57>
<Filename Value="..\..\fpc\packages\fcl-db\src\base\fields.inc"/>
<CursorPos X="38" Y="718"/>
<TopLine Value="696"/>
<UsageCount Value="12"/>
</Unit57>
<Unit58>
<Filename Value="..\..\lazarus\lcl\dbctrls.pp"/>
<UnitName Value="DbCtrls"/>
<CursorPos X="45" Y="1338"/>
<TopLine Value="1330"/>
<UsageCount Value="14"/>
</Unit58>
<Unit59>
<Filename Value="..\..\lazarus\fpc\2.2.5\source\packages\fcl-db\src\dbase\dbf.pas"/>
<UnitName Value="dbf"/>
<CursorPos X="25" Y="1184"/>
<TopLine Value="1180"/>
<UsageCount Value="10"/>
</Unit59>
<Unit60>
<Filename Value="..\DBLookupTestOld\unit1.lfm"/>
<CursorPos X="60" Y="102"/>
<TopLine Value="83"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="LFM"/>
</Unit60>
<Unit61>
<Filename Value="..\..\lazarus\fpc\2.2.5\source\packages\fcl-db\src\base\db.pas"/>
<UnitName Value="db"/>
<CursorPos X="15" Y="1280"/>
<TopLine Value="1260"/>
<UsageCount Value="11"/>
</Unit61>
<Unit62>
<Filename Value="..\..\lazarus\fpc\2.2.5\source\rtl\inc\variants.pp"/>
<UnitName Value="variants"/>
<CursorPos X="5" Y="4014"/>
<TopLine Value="4010"/>
<UsageCount Value="10"/>
</Unit62>
<Unit63>
<Filename Value="..\..\lazarus\fpc\2.2.5\source\packages\fcl-db\src\base\fields.inc"/>
<CursorPos X="46" Y="697"/>
<TopLine Value="677"/>
<UsageCount Value="10"/>
</Unit63>
<Unit64>
<Filename Value="..\..\lazarus\lcl\include\customdblistbox.inc"/>
<CursorPos X="3" Y="34"/>
<TopLine Value="32"/>
<UsageCount Value="10"/>
</Unit64>
<Unit65>
<Filename Value="..\..\lazarus\lcl\stdctrls.pp"/>
<UnitName Value="StdCtrls"/>
<CursorPos X="53" Y="475"/>
<TopLine Value="474"/>
<UsageCount Value="10"/>
</Unit65>
<Unit66>
<Filename Value="..\..\lazarus\lcl\include\customlistbox.inc"/>
<CursorPos X="51" Y="287"/>
<TopLine Value="287"/>
<UsageCount Value="10"/>
</Unit66>
<Unit67>
<Filename Value="..\..\lazarus\lcl\controls.pp"/>
<UnitName Value="Controls"/>
<CursorPos X="59" Y="1201"/>
<TopLine Value="1198"/>
<UsageCount Value="10"/>
</Unit67>
<Unit68>
<Filename Value="..\..\lazarus\lcl\include\control.inc"/>
<CursorPos X="61" Y="256"/>
<TopLine Value="255"/>
<UsageCount Value="10"/>
</Unit68>
<Unit69>
<Filename Value="..\..\lazarus\lcl\include\customdbcombobox.inc"/>
<CursorPos X="18" Y="46"/>
<TopLine Value="34"/>
<UsageCount Value="10"/>
</Unit69>
<Unit70>
<Filename Value="..\..\lazarus\fpc\2.2.5\source\packages\fcl-db\src\base\datasource.inc"/>
<CursorPos X="52" Y="293"/>
<TopLine Value="292"/>
<UsageCount Value="10"/>
</Unit70>
<Unit71>
<Filename Value="..\..\lazarus\lcl\include\dblookuplistbox.inc"/>
<CursorPos X="41" Y="44"/>
<TopLine Value="27"/>
<UsageCount Value="11"/>
</Unit71>
<Unit72>
<Filename Value="..\..\lazarus\lcl\include\dblookup.inc"/>
<CursorPos X="71" Y="299"/>
<TopLine Value="281"/>
<UsageCount Value="11"/>
</Unit72>
<Unit73>
<Filename Value="..\..\lazarus\fpc\2.2.5\source\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="16" Y="1531"/>
<TopLine Value="1511"/>
<UsageCount Value="10"/>
</Unit73>
<Unit74>
<Filename Value="..\..\lazarus\fpc\2.2.5\source\packages\fcl-db\src\base\dataset.inc"/>
<CursorPos X="3" Y="1443"/>
<TopLine Value="1439"/>
<UsageCount Value="10"/>
</Unit74>
<Unit75>
<Filename Value="..\..\lazarus\lcl\include\dblookupcombobox.inc"/>
<CursorPos X="28" Y="42"/>
<TopLine Value="40"/>
<UsageCount Value="10"/>
</Unit75>
</Units>
<JumpHistory Count="1" HistoryIndex="0">
<Position1>
<Filename Value="unit1.pas"/>
<Caret Line="31" Column="38" TopLine="1"/>
</Position1>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,21 @@
program project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ you can add units after this }, Unit1, LResources, MemDSLaz, SDFLaz, DBFLaz;
//{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}
begin
{$I project1.lrs}
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="CompanyName.ProductName.YourApp" type="win32"/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -0,0 +1,7 @@
#define RT_MANIFEST 24
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "project1.manifest"
MAINICON ICON "project1.ico"

View File

@ -0,0 +1,4 @@
This example contains a data table of month numbers and the corresponding month names.
There is a second data table which has a month number data field and a second month number data field which is used as the KeyField for a month name lookup field
TDBLookupComboBox and listbox controls are linked to the first month number field and to the lookup field. They lookup into the first dataset for their display values.
As expected, changing the value of the controls on the data field changes the value of the field however changing the value of the controls on the lookup field does not change the value of its key field as would be expected (this is the behaviour in Delphi)

View File

@ -0,0 +1,251 @@
object Form1: TForm1
Left = 384
Height = 439
Top = 109
Width = 554
Align = alTop
Caption = 'Form1'
ClientHeight = 439
ClientWidth = 554
OnShow = FormShow
LCLVersion = '0.9.27'
object DBGrid1: TDBGrid
Left = 0
Height = 171
Top = 0
Width = 554
Align = alTop
DataSource = Datasource1
TabOrder = 0
end
object DBGrid2: TDBGrid
Left = 0
Height = 150
Top = 176
Width = 554
Align = alClient
DataSource = Datasource2
TabOrder = 1
end
object Splitter1: TSplitter
Cursor = crVSplit
Left = 0
Height = 5
Top = 171
Width = 554
Align = alTop
ResizeAnchor = akTop
end
object Panel1: TPanel
Left = 0
Height = 108
Top = 331
Width = 554
Align = alBottom
Caption = 'Panel1'
ClientHeight = 108
ClientWidth = 554
TabOrder = 3
object DBLookupComboBox1: TDBLookupComboBox
Left = 120
Height = 21
Top = 66
Width = 100
DataField = 'ID_MONTH'
DataSource = Datasource2
KeyField = 'ID'
ListField = 'MTH_NAME'
ListFieldIndex = 0
ListSource = Datasource1
LookupCache = False
Style = csDropDownList
TabOrder = 0
end
object DBLookupListBox1: TDBLookupListBox
Left = 8
Height = 100
Top = 2
Width = 100
DataField = 'ID_MONTH'
DataSource = Datasource2
KeyField = 'ID'
ListField = 'MTH_NAME'
ListFieldIndex = 0
ListSource = Datasource1
LookupCache = False
TabOrder = 1
end
object DBLookupListBox2: TDBLookupListBox
Left = 248
Height = 100
Top = 2
Width = 100
DataField = 'MONTH_NA'
DataSource = Datasource2
ListField = 'MTH_NAME'
ListFieldIndex = 0
LookupCache = False
TabOrder = 2
end
object DBLookupComboBox2: TDBLookupComboBox
Left = 360
Height = 21
Top = 66
Width = 100
DataField = 'MONTH_NA'
DataSource = Datasource2
ListField = 'MTH_NAME'
ListFieldIndex = 0
LookupCache = False
TabOrder = 3
end
end
object Splitter2: TSplitter
Cursor = crVSplit
Left = 0
Height = 5
Top = 326
Width = 554
Align = alBottom
ResizeAnchor = akBottom
end
object Datasource1: TDatasource
DataSet = Dbf1
left = 184
top = 40
end
object Datasource2: TDatasource
DataSet = Dbf2
left = 184
top = 176
end
object Dbf1: TDbf
FilePath = 'C:\LazarusProjects\DBLookupTest\data\'
IndexDefs = <
item
IndexFile = 'months.mbf'
SortField = 'ID'
Options = [ixPrimary]
end>
OpenMode = omAutoCreate
TableName = 'months.dbf'
TableLevel = 3
FilterOptions = []
left = 144
top = 40
object Dbf1ID: TLongintField
DisplayWidth = 10
FieldKind = fkData
FieldName = 'ID'
Index = 0
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
end
object Dbf1LANG: TStringField
DisplayWidth = 4
FieldKind = fkData
FieldName = 'LANG'
Index = 1
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
Size = 2
end
object Dbf1MTH_NO: TLongintField
DisplayWidth = 10
FieldKind = fkData
FieldName = 'MTH_NO'
Index = 2
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
end
object Dbf1MTH_NAME: TStringField
DisplayWidth = 18
FieldKind = fkData
FieldName = 'MTH_NAME'
Index = 3
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
Size = 18
end
end
object Dbf2: TDbf
FilePath = 'C:\LazarusProjects\DBLookupTest\data\'
IndexDefs = <
item
IndexFile = 'lookerup.mbf'
SortField = 'ID'
Options = [ixPrimary]
end>
OpenMode = omAutoCreate
TableName = 'lookerup.dbf'
TableLevel = 3
FilterOptions = []
left = 144
top = 176
object Dbf2ID: TLongintField
DisplayWidth = 6
FieldKind = fkData
FieldName = 'ID'
Index = 0
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
end
object Dbf2ID_MONTH: TLongintField
DisplayWidth = 8
FieldKind = fkData
FieldName = 'ID_MONTH'
Index = 1
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
end
object Dbf2LANGUAGE: TStringField
DisplayWidth = 4
FieldKind = fkData
FieldName = 'LANGUAGE'
Index = 2
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
Size = 2
end
object Dbf2MONTH_NO: TLongintField
DisplayWidth = 8
FieldKind = fkData
FieldName = 'MONTH_NO'
Index = 3
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
end
object Dbf2MONTH_NA: TStringField
DisplayLabel = 'MONTH'
DisplayWidth = 18
FieldKind = fkLookup
FieldName = 'MONTH_NA'
Index = 4
KeyFields = 'MONTH_NO'
LookupCache = False
LookupDataSet = Dbf1
LookupKeyFields = 'MTH_NO'
LookupResultField = 'MTH_NAME'
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
Size = 18
end
end
end

View File

@ -0,0 +1,70 @@
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#128#1#6'Height'#3#183#1#3'Top'#2'm'#5'Wid'
+'th'#3'*'#2#5'Align'#7#5'alTop'#7'Caption'#6#5'Form1'#12'ClientHeight'#3#183
+#1#11'ClientWidth'#3'*'#2#6'OnShow'#7#8'FormShow'#10'LCLVersion'#6#6'0.9.27'
+#0#7'TDBGrid'#7'DBGrid1'#4'Left'#2#0#6'Height'#3#171#0#3'Top'#2#0#5'Width'#3
+'*'#2#5'Align'#7#5'alTop'#10'DataSource'#7#11'Datasource1'#8'TabOrder'#2#0#0
+#0#7'TDBGrid'#7'DBGrid2'#4'Left'#2#0#6'Height'#3#150#0#3'Top'#3#176#0#5'Widt'
+'h'#3'*'#2#5'Align'#7#8'alClient'#10'DataSource'#7#11'Datasource2'#8'TabOrde'
+'r'#2#1#0#0#9'TSplitter'#9'Splitter1'#6'Cursor'#7#8'crVSplit'#4'Left'#2#0#6
+'Height'#2#5#3'Top'#3#171#0#5'Width'#3'*'#2#5'Align'#7#5'alTop'#12'ResizeAnc'
+'hor'#7#5'akTop'#0#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'l'#3'Top'#3
+'K'#1#5'Width'#3'*'#2#5'Align'#7#8'alBottom'#7'Caption'#6#6'Panel1'#12'Clien'
+'tHeight'#2'l'#11'ClientWidth'#3'*'#2#8'TabOrder'#2#3#0#17'TDBLookupComboBox'
+#17'DBLookupComboBox1'#4'Left'#2'x'#6'Height'#2#21#3'Top'#2'B'#5'Width'#2'd'
+#9'DataField'#6#8'ID_MONTH'#10'DataSource'#7#11'Datasource2'#8'KeyField'#6#2
+'ID'#9'ListField'#6#8'MTH_NAME'#14'ListFieldIndex'#2#0#10'ListSource'#7#11'D'
+'atasource1'#11'LookupCache'#8#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0
+#0#0#16'TDBLookupListBox'#16'DBLookupListBox1'#4'Left'#2#8#6'Height'#2'd'#3
+'Top'#2#2#5'Width'#2'd'#9'DataField'#6#8'ID_MONTH'#10'DataSource'#7#11'Datas'
+'ource2'#8'KeyField'#6#2'ID'#9'ListField'#6#8'MTH_NAME'#14'ListFieldIndex'#2
+#0#10'ListSource'#7#11'Datasource1'#11'LookupCache'#8#8'TabOrder'#2#1#0#0#16
+'TDBLookupListBox'#16'DBLookupListBox2'#4'Left'#3#248#0#6'Height'#2'd'#3'Top'
+#2#2#5'Width'#2'd'#9'DataField'#6#8'MONTH_NA'#10'DataSource'#7#11'Datasource'
+'2'#9'ListField'#6#8'MTH_NAME'#14'ListFieldIndex'#2#0#11'LookupCache'#8#8'Ta'
+'bOrder'#2#2#0#0#17'TDBLookupComboBox'#17'DBLookupComboBox2'#4'Left'#3'h'#1#6
+'Height'#2#21#3'Top'#2'B'#5'Width'#2'd'#9'DataField'#6#8'MONTH_NA'#10'DataSo'
+'urce'#7#11'Datasource2'#9'ListField'#6#8'MTH_NAME'#14'ListFieldIndex'#2#0#11
+'LookupCache'#8#8'TabOrder'#2#3#0#0#0#9'TSplitter'#9'Splitter2'#6'Cursor'#7#8
+'crVSplit'#4'Left'#2#0#6'Height'#2#5#3'Top'#3'F'#1#5'Width'#3'*'#2#5'Align'#7
+#8'alBottom'#12'ResizeAnchor'#7#8'akBottom'#0#0#11'TDatasource'#11'Datasourc'
+'e1'#7'DataSet'#7#4'Dbf1'#4'left'#3#184#0#3'top'#2'('#0#0#11'TDatasource'#11
+'Datasource2'#7'DataSet'#7#4'Dbf2'#4'left'#3#184#0#3'top'#3#176#0#0#0#4'TDbf'
+#4'Dbf1'#8'FilePath'#6'%C:\LazarusProjects\DBLookupTest\data\'#9'IndexDefs'
+#14#1#9'IndexFile'#6#10'months.mbf'#9'SortField'#6#2'ID'#7'Options'#11#9'ixP'
+'rimary'#0#0#0#8'OpenMode'#7#12'omAutoCreate'#9'TableName'#6#10'months.dbf'
+#10'TableLevel'#2#3#13'FilterOptions'#11#0#4'left'#3#144#0#3'top'#2'('#0#13
+'TLongintField'#6'Dbf1ID'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkData'#9'F'
+'ieldName'#6#2'ID'#5'Index'#2#0#11'LookupCache'#8#13'ProviderFlags'#11#10'pf'
+'InUpdate'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#12'TStringField'#8
+'Dbf1LANG'#12'DisplayWidth'#2#4#9'FieldKind'#7#6'fkData'#9'FieldName'#6#4'LA'
+'NG'#5'Index'#2#1#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pf'
+'InWhere'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#2#2#0#0#13'TLongintField'#10
+'Dbf1MTH_NO'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkData'#9'FieldName'#6#6
+'MTH_NO'#5'Index'#2#2#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9
+'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#12'TStringField'#12'Dbf1MTH_NA'
+'ME'#12'DisplayWidth'#2#18#9'FieldKind'#7#6'fkData'#9'FieldName'#6#8'MTH_NAM'
+'E'#5'Index'#2#3#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pfI'
+'nWhere'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#2#18#0#0#0#4'TDbf'#4'Dbf2'#8
+'FilePath'#6'%C:\LazarusProjects\DBLookupTest\data\'#9'IndexDefs'#14#1#9'Ind'
+'exFile'#6#12'lookerup.mbf'#9'SortField'#6#2'ID'#7'Options'#11#9'ixPrimary'#0
+#0#0#8'OpenMode'#7#12'omAutoCreate'#9'TableName'#6#12'lookerup.dbf'#10'Table'
+'Level'#2#3#13'FilterOptions'#11#0#4'left'#3#144#0#3'top'#3#176#0#0#13'TLong'
+'intField'#6'Dbf2ID'#12'DisplayWidth'#2#6#9'FieldKind'#7#6'fkData'#9'FieldNa'
+'me'#6#2'ID'#5'Index'#2#0#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpda'
+'te'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#13'TLongintField'#12'Dbf'
+'2ID_MONTH'#12'DisplayWidth'#2#8#9'FieldKind'#7#6'fkData'#9'FieldName'#6#8'I'
+'D_MONTH'#5'Index'#2#1#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'
+#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#12'TStringField'#12'Dbf2LANG'
+'UAGE'#12'DisplayWidth'#2#4#9'FieldKind'#7#6'fkData'#9'FieldName'#6#8'LANGUA'
+'GE'#5'Index'#2#2#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pf'
+'InWhere'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#2#2#0#0#13'TLongintField'#12
+'Dbf2MONTH_NO'#12'DisplayWidth'#2#8#9'FieldKind'#7#6'fkData'#9'FieldName'#6#8
+'MONTH_NO'#5'Index'#2#3#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'
+#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#12'TStringField'#12'Dbf2MONT'
+'H_NA'#12'DisplayLabel'#6#5'MONTH'#12'DisplayWidth'#2#18#9'FieldKind'#7#8'fk'
,'Lookup'#9'FieldName'#6#8'MONTH_NA'#5'Index'#2#4#9'KeyFields'#6#8'MONTH_NO'
+#11'LookupCache'#8#13'LookupDataSet'#7#4'Dbf1'#15'LookupKeyFields'#6#6'MTH_N'
+'O'#17'LookupResultField'#6#8'MTH_NAME'#13'ProviderFlags'#11#10'pfInUpdate'#9
+'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#2#18#0#0#0#0
]);

View File

@ -0,0 +1,73 @@
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
DbCtrls, db, DBGrids, StdCtrls, dbf, memds, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Datasource1: TDatasource;
Datasource2: TDatasource;
Dbf1: TDbf;
Dbf1ID: TLongintField;
Dbf1LANG: TStringField;
Dbf1MTH_NAME: TStringField;
Dbf1MTH_NO: TLongintField;
Dbf2: TDbf;
Dbf2MONTH_NA: TStringField;
Dbf2ID: TLongintField;
Dbf2ID_MONTH: TLongintField;
Dbf2LANGUAGE: TStringField;
Dbf2MONTH_NO: TLongintField;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
DBLookupComboBox1: TDBLookupComboBox;
DBLookupComboBox2: TDBLookupComboBox;
DBLookupListBox1: TDBLookupListBox;
DBLookupListBox2: TDBLookupListBox;
Panel1: TPanel;
Splitter1: TSplitter;
Splitter2: TSplitter;
procedure FormShow(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.FormShow(Sender: TObject);
var
S: string;
I: Integer;
begin
S := Application.ExeName;
// hack for Mac
I := Pos('.app/Contents/MacOS/', S);
if (I > 0) then
S := Copy(S,1, I+3);
Dbf1.FilePath := ExtractFilePath(S)+'data'+PathDelim;
Dbf1.Open;
// Dbf1.InsertRecord([0,'GB',1,'January']);
Dbf2.FilePath := Dbf1.FilePath;
Dbf2.Open;
end;
initialization
{$I unit1.lrs}
end.