├── help ├── 1.PNG ├── 2.PNG ├── 3.PNG ├── 4.PNG ├── 5.PNG ├── 6.PNG └── 7.PNG ├── ArOrm.Consts.pas ├── Example ├── MainApp.res ├── People │ ├── Ppl.Consts.pas │ ├── Cards │ │ ├── Ppl.Ca.Company.dfm │ │ ├── Ppl.Ca.Company.pas │ │ ├── Ppl.Ca.Contact.pas │ │ ├── Ppl.Ca.City.pas │ │ ├── Ppl.Ca.Province.pas │ │ ├── Ppl.Ca.Person.pas │ │ ├── Ppl.Ca.Contact.dfm │ │ ├── Ppl.Ca.Country.pas │ │ ├── Ppl.Ca.City.dfm │ │ ├── Ppl.Ca.Province.dfm │ │ ├── Ppl.Ca.Country.dfm │ │ └── Ppl.Ca.Person.dfm │ └── DataAccess │ │ ├── Ppl.Da.PhoneNumber.pas │ │ ├── Ppl.Da.Contact.pas │ │ └── Ppl.Da.Region.pas ├── MainApp.dpr ├── MainUnit.dfm ├── MainUnit.pas ├── caMain.pas ├── caMain.dfm └── MainApp.dproj ├── ArOrm.Obj.Info.pas ├── Design ├── ArOrm.dpk ├── ArSearchDlg.dfm ├── ArSearchDlg.pas ├── ArColumnGrid.pas ├── ArGrid.pas ├── ArEdit.pas └── ArOrm.dproj ├── README.md └── .gitignore /help/1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/help/1.PNG -------------------------------------------------------------------------------- /help/2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/help/2.PNG -------------------------------------------------------------------------------- /help/3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/help/3.PNG -------------------------------------------------------------------------------- /help/4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/help/4.PNG -------------------------------------------------------------------------------- /help/5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/help/5.PNG -------------------------------------------------------------------------------- /help/6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/help/6.PNG -------------------------------------------------------------------------------- /help/7.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/help/7.PNG -------------------------------------------------------------------------------- /ArOrm.Consts.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/ArOrm.Consts.pas -------------------------------------------------------------------------------- /Example/MainApp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/Example/MainApp.res -------------------------------------------------------------------------------- /Example/People/Ppl.Consts.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammarsalah524/ArORM/HEAD/Example/People/Ppl.Consts.pas -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Company.dfm: -------------------------------------------------------------------------------- 1 | inherited PplCaCompany: TPplCaCompany 2 | Caption = 'PplCaCompany' 3 | PixelsPerInch = 96 4 | TextHeight = 25 5 | end 6 | -------------------------------------------------------------------------------- /Example/People/DataAccess/Ppl.Da.PhoneNumber.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Da.PhoneNumber; 2 | 3 | interface 4 | 5 | uses ArOrm.Da.Base, ArOrm.Obj.Info, ArOrm.Consts, Ppl.Consts; 6 | 7 | implementation 8 | 9 | end. 10 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Company.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Ca.Company; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ppl.Ca.Contact, ArEdit, Vcl.StdCtrls, 8 | Vcl.WinXCtrls, Vcl.ExtCtrls; 9 | 10 | type 11 | TPplCaCompany = class(TPplCaContact) 12 | private 13 | { Private declarations } 14 | public 15 | { Public declarations } 16 | end; 17 | 18 | implementation 19 | 20 | {$R *.dfm} 21 | 22 | end. 23 | -------------------------------------------------------------------------------- /ArOrm.Obj.Info.pas: -------------------------------------------------------------------------------- 1 | unit ArOrm.Obj.Info; 2 | 3 | interface 4 | 5 | type 6 | TArTable = record 7 | ID: Integer; 8 | Name: string; 9 | end; 10 | 11 | TArForm = record 12 | Name: string; 13 | Caption_AR: string; 14 | Caption_EN: string; 15 | end; 16 | 17 | TArColumn = record 18 | ID: Integer; 19 | Name: string; 20 | Caption_AR: string; 21 | Caption_EN: string; 22 | end; 23 | 24 | TArTableColumn = record 25 | Table: TArTable; 26 | Column: TArColumn; 27 | end; 28 | 29 | TArTableColumns = record 30 | Table: TArTable; 31 | Columns: array of TArColumn; 32 | end; 33 | 34 | TArTablesColumns = array of TArTableColumns; 35 | 36 | implementation 37 | 38 | end. 39 | -------------------------------------------------------------------------------- /Example/MainApp.dpr: -------------------------------------------------------------------------------- 1 | program MainApp; 2 | 3 | uses 4 | Vcl.Forms, 5 | Vcl.Themes, 6 | Vcl.Styles, 7 | MainUnit in 'MainUnit.pas' {MainForm}, 8 | Ppl.Da.Region in 'People\DataAccess\Ppl.Da.Region.pas', 9 | Ppl.Consts in 'People\Ppl.Consts.pas', 10 | caMain in 'caMain.pas' {MainCard}, 11 | Ppl.Ca.Country in 'People\Cards\Ppl.Ca.Country.pas' {PplCaCountry}, 12 | Ppl.Ca.Province in 'People\Cards\Ppl.Ca.Province.pas' {PplCaProvince}, 13 | Ppl.Ca.City in 'People\Cards\Ppl.Ca.City.pas' {PplCaCity}, 14 | Ppl.Da.Contact in 'People\DataAccess\Ppl.Da.Contact.pas', 15 | Ppl.Ca.Contact in 'People\Cards\Ppl.Ca.Contact.pas' {PplCaContact}, 16 | Ppl.Ca.Person in 'People\Cards\Ppl.Ca.Person.pas' {PplCaPerson}, 17 | Ppl.Ca.Company in 'People\Cards\Ppl.Ca.Company.pas' {PplCaCompany}, 18 | Ppl.Da.PhoneNumber in 'People\DataAccess\Ppl.Da.PhoneNumber.pas'; 19 | 20 | {$R *.res} 21 | 22 | begin 23 | Application.Initialize; 24 | Application.MainFormOnTaskbar := True; 25 | TStyleManager.TrySetStyle('Windows10 SlateGray'); 26 | Application.CreateForm(TMainForm, MainForm); 27 | Application.Run; 28 | end. 29 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Contact.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Ca.Contact; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, caMain, Vcl.StdCtrls, Vcl.WinXCtrls, 8 | ArEdit, Vcl.ExtCtrls; 9 | 10 | type 11 | TPplCaContact = class(TMainCard) 12 | EdtSNationality: TArSearchEdit; 13 | EdtNameEN: TArStrEdit; 14 | EdtNameAR: TArStrEdit; 15 | procedure FormCreate(Sender: TObject); 16 | private 17 | { Private declarations } 18 | public 19 | { Public declarations } 20 | end; 21 | 22 | implementation 23 | 24 | {$R *.dfm} 25 | 26 | uses Ppl.Da.Contact; 27 | 28 | procedure TPplCaContact.FormCreate(Sender: TObject); 29 | var 30 | LContact: TPplDaContact; 31 | begin 32 | inherited; 33 | LContact := TPplDaContact(Self.DaEntity.DataAccess); 34 | Self.EdtNNumber.EnumField(LContact.FldNumber); 35 | Self.EdtNameAR.EnumField(LContact.FldNameAR); 36 | Self.EdtNameEN.EnumField(LContact.FldNameEN); 37 | Self.EdtSNationality.EnumField(LContact.FldNationality); 38 | Self.FocusComponent := Self.EdtSNationality; 39 | end; 40 | 41 | end. 42 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.City.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Ca.City; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, caMain, ArEdit, Vcl.StdCtrls, Vcl.ExtCtrls, 8 | Vcl.WinXCtrls; 9 | 10 | type 11 | TPplCaCity = class(TMainCard) 12 | EdtCode: TArStrEdit; 13 | EdtNameAR: TArStrEdit; 14 | EdtNameEN: TArStrEdit; 15 | EdtSProvince: TArSearchEdit; 16 | procedure FormCreate(Sender: TObject); 17 | private 18 | { Private declarations } 19 | public 20 | { Public declarations } 21 | end; 22 | 23 | implementation 24 | 25 | {$R *.dfm} 26 | 27 | uses Ppl.Da.Region; 28 | 29 | procedure TPplCaCity.FormCreate(Sender: TObject); 30 | var 31 | LCity: TPplDaCity; 32 | begin 33 | inherited; 34 | LCity := TPplDaCity(Self.DaEntity.DataAccess); 35 | Self.EdtSProvince.EnumField(LCity.FldProvince); 36 | Self.EdtNNumber.EnumField(LCity.FldNumber); 37 | Self.EdtCode.EnumField(LCity.FldCode); 38 | Self.EdtNameAR.EnumField(LCity.FldNameAR); 39 | Self.EdtNameEN.EnumField(LCity.FldNameEN); 40 | Self.FocusComponent := Self.EdtSProvince; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Design/ArOrm.dpk: -------------------------------------------------------------------------------- 1 | package ArOrm; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$IMPLICITBUILD ON} 29 | 30 | requires 31 | rtl, 32 | vcl, 33 | dbrtl, 34 | adortl, 35 | designide, 36 | vclwinx, 37 | vclx, 38 | xmlrtl, 39 | vclactnband, 40 | vclimg, 41 | vcldb, 42 | VclSmp; 43 | 44 | contains 45 | ArEdit in 'ArEdit.pas', 46 | ArOrm.Obj.Info in '..\ArOrm.Obj.Info.pas', 47 | ArOrm.Consts in '..\ArOrm.Consts.pas', 48 | ArOrm.Da.Base in '..\ArOrm.Da.Base.pas', 49 | ArSearchDlg in 'ArSearchDlg.pas' {ArSearchDialog}, 50 | ArGrid in 'ArGrid.pas', 51 | ArColumnGrid in 'ArColumnGrid.pas'; 52 | 53 | end. 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Province.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Ca.Province; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, caMain, ArEdit, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.WinXCtrls; 8 | 9 | type 10 | TPplCaProvince = class(TMainCard) 11 | EdtCode: TArStrEdit; 12 | EdtNameAR: TArStrEdit; 13 | EdtNameEN: TArStrEdit; 14 | EdtCallingCode: TArStrEdit; 15 | EdtSCountry: TArSearchEdit; 16 | procedure FormCreate(Sender: TObject); 17 | procedure BtnInsertClick(Sender: TObject); 18 | private 19 | { Private declarations } 20 | public 21 | { Public declarations } 22 | end; 23 | 24 | implementation 25 | 26 | {$R *.dfm} 27 | 28 | uses Ppl.Da.Region; 29 | 30 | procedure TPplCaProvince.BtnInsertClick(Sender: TObject); 31 | begin 32 | inherited; 33 | exit; 34 | end; 35 | 36 | procedure TPplCaProvince.FormCreate(Sender: TObject); 37 | var 38 | LProvince: TPplDaProvince; 39 | begin 40 | inherited; 41 | LProvince := TPplDaProvince(Self.DaEntity.DataAccess); 42 | Self.EdtNNumber.EnumField(LProvince.FldNumber); 43 | Self.EdtCode.EnumField(LProvince.FldCode); 44 | Self.EdtNameAR.EnumField(LProvince.FldNameAR); 45 | Self.EdtNameEN.EnumField(LProvince.FldNameEN); 46 | Self.EdtCallingCode.EnumField(LProvince.FldCallingCode); 47 | Self.EdtSCountry.EnumField(LProvince.FldCountry); 48 | Self.FocusComponent := Self.EdtSCountry; 49 | end; 50 | 51 | end. 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ArORM 2 | ORM framework for Delphi XE+ 3 | 4 | ## Prerequisites 5 | Embarcadero Rad Studio XE+. 6 | 7 | Microsoft SQL Server 2012+. 8 | 9 | ## Installing 10 | 11 | 1- Open ArORM.dproj file.. 12 | 13 | ![Image description](https://github.com/ammarsalah524/ArORM/blob/master/help/1.PNG) 14 | 15 | 2- Build up ArORM Package.. 16 | 17 | ![Image description](https://github.com/ammarsalah524/ArORM/blob/master/help/2.PNG) 18 | 19 | 3- Install ArORM Package.. 20 | 21 | ![Image description](https://github.com/ammarsalah524/ArORM/blob/master/help/3.PNG) 22 | 23 | 4- You must see a successfuly installation message.. 24 | 25 | ![Image description](https://github.com/ammarsalah524/ArORM/blob/master/help/4.PNG) 26 | 27 | 5- Open Rad Studio Options window.. 28 | 29 | ![Image description](https://github.com/ammarsalah524/ArORM/blob/master/help/5.PNG) 30 | 31 | 6- Go to Language -> Delphi Options -> Library.. 32 | 33 | ![Image description](https://github.com/ammarsalah524/ArORM/blob/master/help/6.PNG) 34 | 35 | 7- Add the path of ArOrm directory and the path of ArORM Design directory to the Library Path List.. 36 | 37 | ![Image description](https://github.com/ammarsalah524/ArORM/blob/master/help/7.PNG) 38 | 39 | 40 | ## Example 41 | 42 | [People](https://github.com/ammarsalah524/ArORM/tree/master/Example) 43 | 44 | ## Built With 45 | [Delphi 10.3.0](https://www.embarcadero.com/products/delphi/starter/free-download) 46 | 47 | ## Authors 48 | Ammar Salah - Developer. 49 | 50 | ## License 51 | Open Source. 52 | -------------------------------------------------------------------------------- /Design/ArSearchDlg.dfm: -------------------------------------------------------------------------------- 1 | object ArSearchDialog: TArSearchDialog 2 | Left = 0 3 | Top = 0 4 | ActiveControl = EdtSearch 5 | BiDiMode = bdRightToLeft 6 | Caption = 'SearchDialog' 7 | ClientHeight = 458 8 | ClientWidth = 455 9 | Color = clBtnFace 10 | Font.Charset = ANSI_CHARSET 11 | Font.Color = clWindowText 12 | Font.Height = -19 13 | Font.Name = 'Sakkal Majalla' 14 | Font.Style = [fsBold] 15 | OldCreateOrder = False 16 | ParentBiDiMode = False 17 | Position = poScreenCenter 18 | PixelsPerInch = 96 19 | TextHeight = 25 20 | object PnlController: TPanel 21 | Left = 0 22 | Top = 0 23 | Width = 455 24 | Height = 41 25 | Align = alTop 26 | TabOrder = 0 27 | DesignSize = ( 28 | 455 29 | 41) 30 | object EdtSearch: TEdit 31 | Left = 8 32 | Top = 4 33 | Width = 439 34 | Height = 33 35 | Anchors = [akLeft, akTop, akRight] 36 | TabOrder = 0 37 | OnChange = EdtSearchChange 38 | OnKeyPress = EdtSearchKeyPress 39 | end 40 | end 41 | object GrdSearchResult: TStringGrid 42 | Left = 0 43 | Top = 41 44 | Width = 455 45 | Height = 417 46 | Align = alClient 47 | ColCount = 1 48 | DefaultColWidth = 150 49 | DrawingStyle = gdsClassic 50 | FixedCols = 0 51 | RowCount = 2 52 | Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSizing, goColSizing, goRowMoving, goColMoving, goRowSelect] 53 | TabOrder = 1 54 | OnDblClick = GrdSearchResultDblClick 55 | OnKeyPress = GrdSearchResultKeyPress 56 | ColWidths = ( 57 | 150) 58 | RowHeights = ( 59 | 24 60 | 24) 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | __recovery/ 63 | *.~* 64 | 65 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 66 | *.stat 67 | 68 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss 69 | modules/ 70 | -------------------------------------------------------------------------------- /Example/MainUnit.dfm: -------------------------------------------------------------------------------- 1 | object MainForm: TMainForm 2 | Left = 0 3 | Top = 0 4 | BiDiMode = bdRightToLeft 5 | Caption = 'MainForm' 6 | ClientHeight = 477 7 | ClientWidth = 591 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | Menu = MmMain 15 | OldCreateOrder = True 16 | ParentBiDiMode = False 17 | Position = poScreenCenter 18 | Visible = True 19 | WindowState = wsMaximized 20 | PixelsPerInch = 96 21 | TextHeight = 13 22 | object ADOConnection: TADOConnection 23 | ConnectionString = 24 | 'Provider=SQLNCLI11.1;Integrated Security=SSPI;Persist Security I' + 25 | 'nfo=False;User ID="";Initial Catalog="";Data Source=DESKTOP-10VS' + 26 | '322;Initial File Name="";Server SPN=""' 27 | LoginPrompt = False 28 | Provider = 'SQLNCLI11.1' 29 | Left = 24 30 | Top = 8 31 | end 32 | object MmMain: TMainMenu 33 | AutoHotkeys = maManual 34 | AutoLineReduction = maManual 35 | Left = 24 36 | Top = 64 37 | object MMContact: TMenuItem 38 | Caption = #1580#1607#1575#1578' '#1575#1604#1575#1578#1589#1575#1604 39 | object MiPplDeclerations: TMenuItem 40 | Caption = #1578#1593#1575#1585#1610#1601 41 | object MiCountry: TMenuItem 42 | Caption = #1575#1604#1576#1604#1583 43 | OnClick = MiCountryClick 44 | end 45 | object MiProvince: TMenuItem 46 | Caption = #1575#1604#1605#1606#1591#1602#1577 47 | OnClick = MiProvinceClick 48 | end 49 | object MiCity: TMenuItem 50 | Caption = #1575#1604#1605#1583#1610#1606#1577 51 | OnClick = MiCityClick 52 | end 53 | end 54 | object MiPplCards: TMenuItem 55 | Caption = #1576#1591#1575#1602#1575#1578 56 | object MiPerson: TMenuItem 57 | Caption = #1588#1582#1589 58 | OnClick = MiPersonClick 59 | end 60 | object MiCompany: TMenuItem 61 | Caption = #1588#1585#1603#1577 62 | OnClick = MiCompanyClick 63 | end 64 | end 65 | end 66 | end 67 | end 68 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Person.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Ca.Person; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ppl.Ca.Contact, ArEdit, Vcl.StdCtrls, 8 | Vcl.WinXCtrls, Vcl.ExtCtrls, Vcl.Grids, Vcl.Imaging.pngimage; 9 | 10 | type 11 | TPplCaPerson = class(TPplCaContact) 12 | PnlNames: TPanel; 13 | PnlENNames: TPanel; 14 | PnlARNames: TPanel; 15 | EdtFirstNameEN: TArStrEdit; 16 | EdtLastNameEN: TArStrEdit; 17 | EdtFatherNameEN: TArStrEdit; 18 | EdtMotherNameEN: TArStrEdit; 19 | EdtFirstNameAR: TArStrEdit; 20 | EdtLastNameAR: TArStrEdit; 21 | EdtFatherNameAR: TArStrEdit; 22 | EdtMotherNameAR: TArStrEdit; 23 | GroupBox1: TGroupBox; 24 | procedure FormResize(Sender: TObject); 25 | procedure FormCreate(Sender: TObject); 26 | protected 27 | procedure DoCreate; override; 28 | end; 29 | 30 | implementation 31 | 32 | {$R *.dfm} 33 | 34 | uses Ppl.Da.Contact; 35 | 36 | procedure TPplCaPerson.DoCreate; 37 | var 38 | LPerson: TPplDaPerson; 39 | begin 40 | inherited; 41 | LPerson := TPplDaPerson(Self.DaEntity.DataAccess); 42 | Self.EdtNNumber.EnumField(LPerson.FldNumber); 43 | Self.EdtFirstNameAR.EnumField(LPerson.FldFirstNameAR); 44 | Self.EdtFirstNameEN.EnumField(LPerson.FldFirstNameEN); 45 | Self.EdtLastNameAR.EnumField(LPerson.FldLastNameAR); 46 | Self.EdtLastNameEN.EnumField(LPerson.FldLastNameEN); 47 | Self.EdtFatherNameAR.EnumField(LPerson.FldFatherNameAR); 48 | Self.EdtFatherNameEN.EnumField(LPerson.FldFatherNameEN); 49 | Self.EdtMotherNameAR.EnumField(LPerson.FldMotherNameAR); 50 | Self.EdtMotherNameEN.EnumField(LPerson.FldMotherNameEN); 51 | Self.FocusComponent := Self.EdtSNationality; 52 | end; 53 | 54 | procedure TPplCaPerson.FormCreate(Sender: TObject); 55 | begin 56 | inherited; 57 | // Self.LMDGrid1.DataRowCount := 7; 58 | end; 59 | 60 | procedure TPplCaPerson.FormResize(Sender: TObject); 61 | begin 62 | inherited; 63 | Self.PnlENNames.Width := Self.PnlNames.Width div 2; 64 | Self.PnlARNames.Width := Self.PnlNames.Width div 2; 65 | end; 66 | 67 | end. 68 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Contact.dfm: -------------------------------------------------------------------------------- 1 | inherited PplCaContact: TPplCaContact 2 | ActiveControl = EdtSNationality 3 | Caption = 'PplCaC' 4 | OnCreate = FormCreate 5 | PixelsPerInch = 96 6 | TextHeight = 25 7 | inherited PnlMain: TPanel 8 | inherited PnlEditor: TPanel 9 | DesignSize = ( 10 | 381 11 | 327) 12 | object EdtSNationality: TArSearchEdit 13 | Left = 8 14 | Top = 6 15 | Width = 281 16 | Height = 33 17 | Anchors = [akLeft, akTop, akRight] 18 | TabOrder = 0 19 | EditLabel.Width = 46 20 | EditLabel.Height = 25 21 | EditLabel.BiDiMode = bdRightToLeft 22 | EditLabel.Caption = #1575#1604#1580#1606#1587#1610#1577 23 | EditLabel.ParentBiDiMode = False 24 | LabelPosition = lpRight 25 | LoadCaption = True 26 | Caption = #1575#1604#1580#1606#1587#1610#1577 27 | end 28 | object EdtNameEN: TArStrEdit 29 | Left = 8 30 | Top = 84 31 | Width = 281 32 | Height = 33 33 | Anchors = [akLeft, akTop, akRight] 34 | EditLabel.Width = 61 35 | EditLabel.Height = 25 36 | EditLabel.BiDiMode = bdRightToLeft 37 | EditLabel.Caption = #1575#1604#1575#1587#1605' (EN)' 38 | EditLabel.ParentBiDiMode = False 39 | LabelPosition = lpRight 40 | TabOrder = 2 41 | LabelVisible = True 42 | LabelCaption = #1575#1604#1575#1587#1605' (EN)' 43 | LoadCaption = True 44 | Caption = #1575#1604#1575#1587#1605' (EN)' 45 | end 46 | object EdtNameAR: TArStrEdit 47 | Left = 8 48 | Top = 45 49 | Width = 281 50 | Height = 33 51 | Anchors = [akLeft, akTop, akRight] 52 | EditLabel.Width = 52 53 | EditLabel.Height = 25 54 | EditLabel.BiDiMode = bdRightToLeft 55 | EditLabel.Caption = #1575#1604#1575#1587#1605' ('#1593')' 56 | EditLabel.ParentBiDiMode = False 57 | LabelPosition = lpRight 58 | TabOrder = 1 59 | LabelVisible = True 60 | LabelCaption = #1575#1604#1575#1587#1605' ('#1593')' 61 | LoadCaption = True 62 | Caption = #1575#1604#1575#1587#1605' ('#1593')' 63 | end 64 | end 65 | end 66 | end 67 | -------------------------------------------------------------------------------- /Example/MainUnit.pas: -------------------------------------------------------------------------------- 1 | unit MainUnit; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, ArOrm.Da.Base, Data.DB, Data.Win.ADODB, Vcl.ExtCtrls, 8 | Vcl.Menus, System.Actions, Vcl.ActnList, Vcl.WinXCtrls, Vcl.Grids; 9 | 10 | type 11 | TMainForm = class(TForm) 12 | ADOConnection: TADOConnection; 13 | MmMain: TMainMenu; 14 | MMContact: TMenuItem; 15 | MiPplDeclerations: TMenuItem; 16 | MiCountry: TMenuItem; 17 | MiProvince: TMenuItem; 18 | MiCity: TMenuItem; 19 | MiPplCards: TMenuItem; 20 | MiPerson: TMenuItem; 21 | MiCompany: TMenuItem; 22 | procedure MiCountryClick(Sender: TObject); 23 | procedure MiProvinceClick(Sender: TObject); 24 | procedure MiCityClick(Sender: TObject); 25 | procedure N1Click(Sender: TObject); 26 | procedure MiPersonClick(Sender: TObject); 27 | procedure MiCompanyClick(Sender: TObject); 28 | protected 29 | procedure DoCreate; override; 30 | end; 31 | 32 | var 33 | MainForm: TMainForm; 34 | 35 | implementation 36 | 37 | {$R *.dfm} 38 | 39 | uses ArOrm.Consts, caMain, 40 | Ppl.Da.Region, Ppl.Da.Contact, 41 | 42 | Ppl.Ca.Country, Ppl.Ca.Province, Ppl.Ca.City, Ppl.Ca.Contact, Ppl.Ca.Person, 43 | Ppl.Ca.Company; 44 | 45 | procedure TMainForm.DoCreate; 46 | var 47 | LDBCreator: TArDatabaseCreator; 48 | begin 49 | inherited; 50 | LDBCreator := TArDatabaseCreator.Create(SelF.ADOConnection, False); 51 | with LDBCreator do 52 | begin 53 | Tables := [TPplDaRegion, TPplDaCountry, TPplDaProvince, TPplDaCity, TPplDaContact, 54 | TPplDaPerson, TPplDaCompany]; 55 | CreateDataBase('Testing'); 56 | end; 57 | end; 58 | 59 | procedure TMainForm.MiCityClick(Sender: TObject); 60 | begin 61 | TPplCaCity.Create(Self, TPplDaCity).Show; 62 | end; 63 | 64 | procedure TMainForm.MiCountryClick(Sender: TObject); 65 | begin 66 | TPplCaCountry.Create(Self, TPplDaCountry).Show; 67 | end; 68 | 69 | procedure TMainForm.MiProvinceClick(Sender: TObject); 70 | begin 71 | TPplCaProvince.Create(Self, TPplDaProvince).Show; 72 | Self.Color := clBlack; 73 | end; 74 | 75 | procedure TMainForm.N1Click(Sender: TObject); 76 | begin 77 | TPplCaContact.Create(Self, TPplDaContact).Show; 78 | end; 79 | 80 | procedure TMainForm.MiPersonClick(Sender: TObject); 81 | begin 82 | TPplCaPerson.Create(Self, TPplDaPerson).Show; 83 | end; 84 | 85 | procedure TMainForm.MiCompanyClick(Sender: TObject); 86 | begin 87 | TPplCaCompany.Create(Self, TPplDaCompany).Show; 88 | end; 89 | 90 | end. 91 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Country.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Ca.Country; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, caMain, ArEdit, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.WinXCtrls, 8 | Vcl.Grids, ArGrid; 9 | 10 | type 11 | TPplCaCountry = class(TMainCard) 12 | EdtCode: TArStrEdit; 13 | EdtNameAR: TArStrEdit; 14 | EdtNameEN: TArStrEdit; 15 | EdtNationalityAR: TArStrEdit; 16 | EdtNationalityEN: TArStrEdit; 17 | EdtCallingCode: TArStrEdit; 18 | GroupBox1: TGroupBox; 19 | procedure FormCreate(Sender: TObject); 20 | procedure BtnNextClick(Sender: TObject); 21 | 22 | private 23 | { Private declarations } 24 | public 25 | { Public declarations } 26 | end; 27 | 28 | implementation 29 | 30 | {$R *.dfm} 31 | 32 | uses ArOrm.Da.Base, Ppl.Da.Region, Ppl.Consts, ArOrm.Consts, ArOrm.Obj.Info; 33 | 34 | procedure TPplCaCountry.BtnNextClick(Sender: TObject); 35 | //var 36 | // LProvince: TPplDaProvince; 37 | begin 38 | inherited; 39 | // LProvince := TPplDaProvince(TPplDaCountry(Self.DaEntity.DataAccess).FldProvinces.Item(2)); 40 | end; 41 | 42 | procedure TPplCaCountry.FormCreate(Sender: TObject); 43 | var 44 | LCountry: TPplDaCountry; 45 | LColumns: TArTablesColumns; 46 | LProvince: TPplDaProvince; 47 | begin 48 | inherited; 49 | LCountry := TPplDaCountry(Self.DaEntity.DataAccess); 50 | Self.EdtNNumber.EnumField(LCountry.FldNumber); 51 | Self.EdtCode.EnumField(LCountry.FldCode); 52 | Self.EdtNameAR.EnumField(LCountry.FldNameAR); 53 | Self.EdtNameEN.EnumField(LCountry.FldNameEN); 54 | Self.EdtNationalityAR.EnumField(LCountry.FldNationalityAR); 55 | Self.EdtNationalityEN.EnumField(LCountry.FldNationalityEN); 56 | Self.EdtCallingCode.EnumField(LCountry.FldCallingCode); 57 | System.SetLength(LColumns, 2); 58 | LColumns[0].Table := CTbl_PplRegion; 59 | LColumns[1].Table := CTbl_PplProvince; 60 | LColumns[0].Columns := LColumns[0].Columns + [CCol_Code, CCol_NameAR]; 61 | LColumns[1].Columns := LColumns[1].Columns + [CCol_CallingCode]; 62 | { with Self.GrdProvinces do 63 | begin 64 | EnumListField(TArDaList(LCountry.FldProvinces)); 65 | AddRowNumberColumn; 66 | AddColumn(ctText, CTbl_PplProvince, CCol_Code, [coCenter]); 67 | AddColumn(ctText, CTbl_PplProvince, CCol_NameAR, [coCenter]); 68 | AddColumn(ctText, CTbl_PplProvince, CCol_NameEN, [coCenter]); 69 | AddColumn(ctText, CTbl_PplProvince, CCol_CallingCode, [coCenter]); 70 | Initialize; 71 | end; 72 | } 73 | // Self.GbxProvinces.EnumList(TArDaList(LCountry.FldProvinces), LColumns); 74 | // Self.FocusComponent := Self.EdtNameAR; 75 | end; 76 | 77 | end. 78 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.City.dfm: -------------------------------------------------------------------------------- 1 | inherited PplCaCity: TPplCaCity 2 | ActiveControl = EdtSProvince 3 | Caption = 'PplCaCity' 4 | OnCreate = FormCreate 5 | PixelsPerInch = 96 6 | TextHeight = 25 7 | inherited PnlMain: TPanel 8 | inherited PnlEditor: TPanel 9 | object EdtCode: TArStrEdit 10 | Left = 8 11 | Top = 51 12 | Width = 273 13 | Height = 33 14 | Anchors = [akLeft, akTop, akRight] 15 | EditLabel.Width = 29 16 | EditLabel.Height = 25 17 | EditLabel.BiDiMode = bdRightToLeft 18 | EditLabel.Caption = #1575#1604#1585#1605#1586 19 | EditLabel.ParentBiDiMode = False 20 | LabelPosition = lpRight 21 | TabOrder = 1 22 | LabelVisible = True 23 | LabelCaption = #1575#1604#1585#1605#1586 24 | LoadCaption = True 25 | Caption = #1575#1604#1585#1605#1586 26 | end 27 | object EdtNameAR: TArStrEdit 28 | Left = 8 29 | Top = 90 30 | Width = 273 31 | Height = 33 32 | Anchors = [akLeft, akTop, akRight] 33 | EditLabel.Width = 53 34 | EditLabel.Height = 25 35 | EditLabel.BiDiMode = bdRightToLeft 36 | EditLabel.Caption = #1575#1604#1575#1587#1605' ('#1593')' 37 | EditLabel.ParentBiDiMode = False 38 | LabelPosition = lpRight 39 | TabOrder = 2 40 | LabelVisible = True 41 | LabelCaption = #1575#1604#1575#1587#1605' ('#1593')' 42 | LoadCaption = True 43 | Caption = #1575#1604#1575#1587#1605' ('#1593')' 44 | end 45 | object EdtNameEN: TArStrEdit 46 | Left = 8 47 | Top = 129 48 | Width = 273 49 | Height = 33 50 | Anchors = [akLeft, akTop, akRight] 51 | EditLabel.Width = 60 52 | EditLabel.Height = 25 53 | EditLabel.BiDiMode = bdRightToLeft 54 | EditLabel.Caption = #1575#1604#1575#1587#1605' (en)' 55 | EditLabel.ParentBiDiMode = False 56 | LabelPosition = lpRight 57 | TabOrder = 3 58 | LabelVisible = True 59 | LabelCaption = #1575#1604#1575#1587#1605' (en)' 60 | LoadCaption = True 61 | Caption = #1575#1604#1575#1587#1605' (en)' 62 | end 63 | object EdtSProvince: TArSearchEdit 64 | Left = 8 65 | Top = 12 66 | Width = 273 67 | Height = 33 68 | Anchors = [akLeft, akTop, akRight] 69 | TabOrder = 0 70 | EditLabel.Width = 39 71 | EditLabel.Height = 25 72 | EditLabel.BiDiMode = bdRightToLeft 73 | EditLabel.Caption = #1575#1604#1605#1606#1591#1602#1577 74 | EditLabel.ParentBiDiMode = False 75 | LabelPosition = lpRight 76 | LoadCaption = False 77 | Caption = #1575#1604#1605#1606#1591#1602#1577 78 | end 79 | end 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /Example/caMain.pas: -------------------------------------------------------------------------------- 1 | unit caMain; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, ArEdit, ArOrm.Da.Base; 8 | 9 | type 10 | TMainCard = class(TForm) 11 | PnlMain: TPanel; 12 | PnlNavigator: TPanel; 13 | PnlController: TPanel; 14 | PnlEditor: TPanel; 15 | BtnNew: TButton; 16 | BtnUpdate: TButton; 17 | BtnInsert: TButton; 18 | BtnDelete: TButton; 19 | BtnExit: TButton; 20 | BtnFirst: TButton; 21 | BtnBack: TButton; 22 | BtnLast: TButton; 23 | BtnNext: TButton; 24 | DaEntity: TArDaEntity; 25 | EdtNNumber: TArIntEdit; 26 | procedure FormClose(Sender: TObject; var Action: TCloseAction); 27 | procedure BtnExitClick(Sender: TObject); 28 | procedure BtnNewClick(Sender: TObject); 29 | procedure BtnUpdateClick(Sender: TObject); 30 | procedure BtnInsertClick(Sender: TObject); 31 | procedure BtnFirstClick(Sender: TObject); 32 | procedure BtnBackClick(Sender: TObject); 33 | procedure BtnNextClick(Sender: TObject); 34 | procedure BtnLastClick(Sender: TObject); 35 | strict private 36 | FFocusComponent: TWinControl; 37 | protected 38 | procedure DoShow; override; 39 | property FocusComponent: TWinControl read FFocusComponent write FFocusComponent; 40 | public 41 | constructor Create(AOwner:TComponent; const ADaClass: TArObjClass); reintroduce; 42 | end; 43 | 44 | implementation 45 | 46 | {$R *.dfm} 47 | 48 | uses MainUnit, Ppl.Da.Region; 49 | 50 | { TFrmMain } 51 | 52 | procedure TMainCard.BtnBackClick(Sender: TObject); 53 | begin 54 | Self.DaEntity.DataAccess.Back; 55 | end; 56 | 57 | procedure TMainCard.BtnExitClick(Sender: TObject); 58 | begin 59 | Close; 60 | end; 61 | 62 | procedure TMainCard.BtnFirstClick(Sender: TObject); 63 | begin 64 | Self.DaEntity.DataAccess.First; 65 | end; 66 | 67 | procedure TMainCard.BtnInsertClick(Sender: TObject); 68 | begin 69 | Self.DaEntity.DataAccess.Insert; 70 | end; 71 | 72 | procedure TMainCard.BtnLastClick(Sender: TObject); 73 | begin 74 | Self.DaEntity.DataAccess.Last; 75 | end; 76 | 77 | procedure TMainCard.BtnNewClick(Sender: TObject); 78 | begin 79 | Self.DaEntity.DataAccess.New; 80 | end; 81 | 82 | procedure TMainCard.BtnNextClick(Sender: TObject); 83 | begin 84 | Self.DaEntity.DataAccess.Next; 85 | end; 86 | 87 | procedure TMainCard.BtnUpdateClick(Sender: TObject); 88 | begin 89 | TIDContainer(Self.DaEntity.DataAccess).Update; 90 | end; 91 | 92 | constructor TMainCard.Create(AOwner: TComponent; const ADaClass: TArObjClass); 93 | begin 94 | inherited Create(AOwner); 95 | Self.DaEntity.EnumDataAccess(ADaClass); 96 | Self.DaEntity.DataAccess.Connection := TMainForm(AOwner).ADOConnection; 97 | end; 98 | 99 | procedure TMainCard.DoShow; 100 | begin 101 | inherited; 102 | Self.DaEntity.DataAccess.New; 103 | if Self.FFocusComponent <> nil then Self.FFocusComponent.SetFocus; 104 | end; 105 | 106 | procedure TMainCard.FormClose(Sender: TObject; var Action: TCloseAction); 107 | begin 108 | Self.DaEntity.DataAccess.Free; 109 | Self.DaEntity.Free; 110 | Action := caFree; 111 | end; 112 | 113 | end. 114 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Province.dfm: -------------------------------------------------------------------------------- 1 | inherited PplCaProvince: TPplCaProvince 2 | Caption = 'PplCaProvince' 3 | ClientWidth = 499 4 | OnCreate = FormCreate 5 | ExplicitWidth = 515 6 | PixelsPerInch = 96 7 | TextHeight = 25 8 | inherited PnlMain: TPanel 9 | Width = 396 10 | ExplicitWidth = 396 11 | inherited PnlNavigator: TPanel 12 | Width = 396 13 | ExplicitWidth = 396 14 | end 15 | inherited PnlEditor: TPanel 16 | Width = 396 17 | ExplicitWidth = 396 18 | object EdtCode: TArStrEdit 19 | Left = 8 20 | Top = 45 21 | Width = 288 22 | Height = 33 23 | Anchors = [akLeft, akTop, akRight] 24 | EditLabel.Width = 29 25 | EditLabel.Height = 25 26 | EditLabel.BiDiMode = bdRightToLeft 27 | EditLabel.Caption = #1575#1604#1585#1605#1586 28 | EditLabel.ParentBiDiMode = False 29 | LabelPosition = lpRight 30 | TabOrder = 1 31 | LabelVisible = True 32 | LabelCaption = #1575#1604#1585#1605#1586 33 | LoadCaption = True 34 | Caption = #1575#1604#1585#1605#1586 35 | end 36 | object EdtNameAR: TArStrEdit 37 | Left = 8 38 | Top = 84 39 | Width = 288 40 | Height = 33 41 | Anchors = [akLeft, akTop, akRight] 42 | EditLabel.Width = 53 43 | EditLabel.Height = 25 44 | EditLabel.BiDiMode = bdRightToLeft 45 | EditLabel.Caption = #1575#1604#1575#1587#1605' ('#1593')' 46 | EditLabel.ParentBiDiMode = False 47 | LabelPosition = lpRight 48 | TabOrder = 2 49 | LabelVisible = True 50 | LabelCaption = #1575#1604#1575#1587#1605' ('#1593')' 51 | LoadCaption = True 52 | Caption = #1575#1604#1575#1587#1605' ('#1593')' 53 | end 54 | object EdtNameEN: TArStrEdit 55 | Left = 8 56 | Top = 123 57 | Width = 288 58 | Height = 33 59 | Anchors = [akLeft, akTop, akRight] 60 | EditLabel.Width = 60 61 | EditLabel.Height = 25 62 | EditLabel.BiDiMode = bdRightToLeft 63 | EditLabel.Caption = #1575#1604#1575#1587#1605' (en)' 64 | EditLabel.ParentBiDiMode = False 65 | LabelPosition = lpRight 66 | TabOrder = 3 67 | LabelVisible = True 68 | LabelCaption = #1575#1604#1575#1587#1605' (en)' 69 | LoadCaption = True 70 | Caption = #1575#1604#1575#1587#1605' (en)' 71 | end 72 | object EdtCallingCode: TArStrEdit 73 | Left = 8 74 | Top = 162 75 | Width = 288 76 | Height = 33 77 | Anchors = [akLeft, akTop, akRight] 78 | EditLabel.Width = 81 79 | EditLabel.Height = 25 80 | EditLabel.BiDiMode = bdRightToLeft 81 | EditLabel.Caption = #1605#1601#1578#1575#1581' '#1575#1604#1575#1578#1589#1575#1604 82 | EditLabel.ParentBiDiMode = False 83 | LabelPosition = lpRight 84 | TabOrder = 4 85 | LabelVisible = True 86 | LabelCaption = #1605#1601#1578#1575#1581' '#1575#1604#1575#1578#1589#1575#1604 87 | LoadCaption = True 88 | Caption = #1605#1601#1578#1575#1581' '#1575#1604#1575#1578#1589#1575#1604 89 | end 90 | object EdtSCountry: TArSearchEdit 91 | Left = 8 92 | Top = 6 93 | Width = 288 94 | Height = 33 95 | Anchors = [akLeft, akTop, akRight] 96 | TabOrder = 0 97 | EditLabel.Width = 25 98 | EditLabel.Height = 25 99 | EditLabel.BiDiMode = bdRightToLeft 100 | EditLabel.Caption = #1575#1604#1576#1604#1583 101 | EditLabel.ParentBiDiMode = False 102 | LabelPosition = lpRight 103 | LoadCaption = False 104 | Caption = #1575#1604#1576#1604#1583 105 | end 106 | end 107 | end 108 | inherited PnlController: TPanel 109 | Left = 396 110 | ExplicitLeft = 396 111 | end 112 | inherited DaEntity: TArDaEntity 113 | Top = 115 114 | end 115 | end 116 | -------------------------------------------------------------------------------- /Example/caMain.dfm: -------------------------------------------------------------------------------- 1 | object MainCard: TMainCard 2 | Left = 0 3 | Top = 0 4 | BiDiMode = bdRightToLeft 5 | ClientHeight = 362 6 | ClientWidth = 484 7 | Color = clBtnFace 8 | Constraints.MinHeight = 400 9 | Constraints.MinWidth = 500 10 | Font.Charset = ANSI_CHARSET 11 | Font.Color = clWindowText 12 | Font.Height = -19 13 | Font.Name = 'Sakkal Majalla' 14 | Font.Style = [fsBold] 15 | OldCreateOrder = False 16 | ParentBiDiMode = False 17 | Position = poScreenCenter 18 | Visible = True 19 | OnClose = FormClose 20 | PixelsPerInch = 96 21 | TextHeight = 25 22 | object PnlMain: TPanel 23 | Left = 0 24 | Top = 0 25 | Width = 381 26 | Height = 362 27 | Align = alClient 28 | BevelOuter = bvNone 29 | TabOrder = 0 30 | object PnlNavigator: TPanel 31 | Left = 0 32 | Top = 0 33 | Width = 381 34 | Height = 35 35 | Align = alTop 36 | TabOrder = 0 37 | object BtnFirst: TButton 38 | Left = 8 39 | Top = 3 40 | Width = 33 41 | Height = 29 42 | Caption = '>>' 43 | TabOrder = 0 44 | OnClick = BtnFirstClick 45 | end 46 | object BtnBack: TButton 47 | Left = 41 48 | Top = 3 49 | Width = 33 50 | Height = 29 51 | Caption = '>' 52 | TabOrder = 1 53 | OnClick = BtnBackClick 54 | end 55 | object BtnLast: TButton 56 | Left = 231 57 | Top = 3 58 | Width = 33 59 | Height = 29 60 | Caption = '<<' 61 | TabOrder = 2 62 | OnClick = BtnLastClick 63 | end 64 | object BtnNext: TButton 65 | Left = 198 66 | Top = 3 67 | Width = 33 68 | Height = 29 69 | Caption = '<' 70 | TabOrder = 3 71 | OnClick = BtnNextClick 72 | end 73 | object EdtNNumber: TArIntEdit 74 | Left = 76 75 | Top = 1 76 | Width = 121 77 | Height = 33 78 | EditLabel.Width = 82 79 | EditLabel.Height = 25 80 | EditLabel.BiDiMode = bdRightToLeft 81 | EditLabel.Caption = 'EdtNNumber' 82 | EditLabel.ParentBiDiMode = False 83 | LabelPosition = lpLeft 84 | TabOrder = 4 85 | LabelVisible = False 86 | LabelCaption = 'EdtNNumber' 87 | LoadCaption = False 88 | Caption = 'EdtNNumber' 89 | end 90 | end 91 | object PnlEditor: TPanel 92 | Left = 0 93 | Top = 35 94 | Width = 381 95 | Height = 327 96 | Align = alClient 97 | Font.Charset = ANSI_CHARSET 98 | Font.Color = clWindowText 99 | Font.Height = -19 100 | Font.Name = 'Sakkal Majalla' 101 | Font.Style = [] 102 | ParentFont = False 103 | TabOrder = 1 104 | end 105 | end 106 | object PnlController: TPanel 107 | Left = 381 108 | Top = 0 109 | Width = 103 110 | Height = 362 111 | Align = alRight 112 | TabOrder = 1 113 | DesignSize = ( 114 | 103 115 | 362) 116 | object BtnNew: TButton 117 | Left = 4 118 | Top = 8 119 | Width = 95 120 | Height = 30 121 | Caption = #1580#1583#1610#1583 122 | TabOrder = 0 123 | OnClick = BtnNewClick 124 | end 125 | object BtnUpdate: TButton 126 | Left = 4 127 | Top = 44 128 | Width = 95 129 | Height = 30 130 | Caption = #1578#1593#1583#1610#1604 131 | TabOrder = 1 132 | OnClick = BtnUpdateClick 133 | end 134 | object BtnInsert: TButton 135 | Left = 4 136 | Top = 80 137 | Width = 95 138 | Height = 30 139 | Caption = #1573#1606#1588#1575#1569 140 | TabOrder = 2 141 | OnClick = BtnInsertClick 142 | end 143 | object BtnDelete: TButton 144 | Left = 4 145 | Top = 116 146 | Width = 95 147 | Height = 30 148 | Caption = #1581#1584#1601 149 | TabOrder = 3 150 | end 151 | object BtnExit: TButton 152 | Left = 4 153 | Top = 324 154 | Width = 95 155 | Height = 30 156 | Anchors = [akLeft, akBottom] 157 | Caption = #1573#1594#1604#1575#1602 158 | TabOrder = 4 159 | OnClick = BtnExitClick 160 | end 161 | end 162 | object DaEntity: TArDaEntity 163 | Left = 40 164 | Top = 67 165 | end 166 | end 167 | -------------------------------------------------------------------------------- /Design/ArSearchDlg.pas: -------------------------------------------------------------------------------- 1 | unit ArSearchDlg; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Menus, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.ExtCtrls, Vcl.StdCtrls, ArOrm.Da.Base, ArEdit, 8 | ArOrm.Consts, ArOrm.Obj.Info; 9 | 10 | type 11 | TArSearchDialog = class(TForm) 12 | PnlController: TPanel; 13 | GrdSearchResult: TStringGrid; 14 | EdtSearch: TEdit; 15 | procedure EdtSearchChange(Sender: TObject); 16 | procedure GrdSearchResultKeyPress(Sender: TObject; var Key: Char); 17 | procedure EdtSearchKeyPress(Sender: TObject; var Key: Char); 18 | procedure GrdSearchResultDblClick(Sender: TObject); 19 | function GetSelected: Integer; 20 | private 21 | FDaEntity: TArDaEntity; 22 | FDaField: TArBasicField; 23 | FList: TArDaList; 24 | FCaptionAddresss: array of integer; 25 | FSelected: Integer; 26 | protected 27 | public 28 | constructor Create(Owner:TComponent;const ADaEntity:TArDaEntity;const ADaField:TArBasicField; 29 | const AValue:string=''); reintroduce; overload; 30 | function SearchResult: TArContainerBase; 31 | end; 32 | 33 | var 34 | SearchDialog: TArSearchDialog; 35 | 36 | implementation 37 | 38 | {$R *.dfm} 39 | 40 | uses Data.Win.ADODB, Data.Db, System.Rtti; 41 | 42 | { TSearchDialog } 43 | 44 | constructor TArSearchDialog.Create(Owner: TComponent; const ADaEntity: TArDaEntity; const ADaField: TArBasicField; 45 | const AValue: string); 46 | var 47 | I, J: Integer; 48 | LField: TArBasicField; 49 | LContainer: TArObj; 50 | LCol: TArColumn; 51 | LColCount: Integer; 52 | begin 53 | inherited Create(Owner); 54 | Self.FDaEntity := ADaEntity; 55 | Self.FDaField := ADaField; 56 | LField := Self.FDaField; 57 | Self.FList := TArDaList.Create(LField.Owner, LField.GetActualType, LField.ColInfo, LField.ColSettings, LField.ColCondetions); 58 | LContainer := LField.GetActualType.Create; 59 | LColCount := System.Length(Self.FDaField.Captions); 60 | Self.GrdSearchResult.ColCount := LColCount; 61 | Self.Width := (LColCount) * 150 + 20; 62 | for I := 0 to LColCount - 1 do 63 | begin 64 | LCol := Self.FDaField.Captions[I]; 65 | Self.GrdSearchResult.Cells[I, 0] := LCol.Caption_AR; 66 | for J := 0 to TArContainerBase(LContainer).Fields.Count -1 do 67 | begin 68 | if TArContainerBase(LContainer).Fields.Item(j).ColInfo.ID = LCol.ID then 69 | Self.FCaptionAddresss := Self.FCaptionAddresss + [J]; 70 | end; 71 | end; 72 | Self.FSelected := -1; 73 | Self.EdtSearch.Text := AValue; 74 | end; 75 | 76 | procedure TArSearchDialog.EdtSearchChange(Sender: TObject); 77 | var 78 | I, J: Integer; 79 | LContainer: TArContainerBase; 80 | begin 81 | if Self.EdtSearch.Text = '' then Exit; 82 | Self.GrdSearchResult.RowCount := 2; 83 | Self.GrdSearchResult.Rows[1].Clear; 84 | Self.FList.Search(Self.EdtSearch.Text); 85 | if Self.FList.Count <> 0 then 86 | begin 87 | Self.GrdSearchResult.RowCount := Self.FList.Count + 1; 88 | for I := 0 to Self.FList.Count - 1 do 89 | begin 90 | LContainer := Self.FList.Item(I); 91 | for J := 0 to System.Length(Self.FCaptionAddresss) - 1 do 92 | begin 93 | Self.GrdSearchResult.Cells[J, I + 1] := 94 | LContainer.Fields.Item(Self.FCaptionAddresss[J]).DaToString; 95 | end; 96 | end; 97 | end; 98 | Self.GrdSearchResult.Row := 1; 99 | end; 100 | 101 | procedure TArSearchDialog.EdtSearchKeyPress(Sender: TObject; var Key: Char); 102 | begin 103 | if Key = #13 then 104 | begin 105 | if Self.GetSelected <> -1 then 106 | begin 107 | Self.ModalResult := mrOk; 108 | key := #0; 109 | end; 110 | end; 111 | end; 112 | 113 | function TArSearchDialog.GetSelected: Integer; 114 | begin 115 | if Self.FList.Count = 0 then Result := -1 116 | else Result := Self.GrdSearchResult.Row - 1; 117 | end; 118 | 119 | procedure TArSearchDialog.GrdSearchResultDblClick(Sender: TObject); 120 | begin 121 | if Self.GetSelected <> -1 then 122 | begin 123 | Self.ModalResult := mrOk; 124 | end; 125 | end; 126 | 127 | procedure TArSearchDialog.GrdSearchResultKeyPress(Sender: TObject; var Key: Char); 128 | begin 129 | if key = #13 then 130 | begin 131 | if Self.GetSelected <> -1 then 132 | begin 133 | Self.ModalResult := mrOk; 134 | key := #0; 135 | end; 136 | end; 137 | end; 138 | 139 | function TArSearchDialog.SearchResult: TArContainerBase; 140 | begin 141 | if Self.GetSelected <> -1 then Result := Self.FList.Item(Self.GetSelected) 142 | else Result := nil; 143 | end; 144 | 145 | end. 146 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Country.dfm: -------------------------------------------------------------------------------- 1 | inherited PplCaCountry: TPplCaCountry 2 | Caption = 'PplCaCountry' 3 | ClientHeight = 612 4 | ClientWidth = 810 5 | OnCreate = FormCreate 6 | ExplicitWidth = 826 7 | ExplicitHeight = 650 8 | PixelsPerInch = 96 9 | TextHeight = 25 10 | inherited PnlMain: TPanel 11 | Width = 707 12 | Height = 612 13 | ExplicitWidth = 707 14 | ExplicitHeight = 612 15 | inherited PnlNavigator: TPanel 16 | Width = 707 17 | ExplicitWidth = 707 18 | end 19 | inherited PnlEditor: TPanel 20 | Width = 707 21 | Height = 577 22 | ExplicitWidth = 707 23 | ExplicitHeight = 577 24 | object EdtCode: TArStrEdit 25 | Left = 8 26 | Top = 6 27 | Width = 599 28 | Height = 33 29 | Anchors = [akLeft, akTop, akRight] 30 | EditLabel.Width = 29 31 | EditLabel.Height = 25 32 | EditLabel.BiDiMode = bdRightToLeft 33 | EditLabel.Caption = #1575#1604#1585#1605#1586 34 | EditLabel.ParentBiDiMode = False 35 | LabelPosition = lpRight 36 | TabOrder = 0 37 | LabelVisible = True 38 | LabelCaption = #1575#1604#1585#1605#1586 39 | LoadCaption = True 40 | Caption = #1575#1604#1585#1605#1586 41 | end 42 | object EdtNameAR: TArStrEdit 43 | Left = 8 44 | Top = 45 45 | Width = 599 46 | Height = 33 47 | Anchors = [akLeft, akTop, akRight] 48 | EditLabel.Width = 53 49 | EditLabel.Height = 25 50 | EditLabel.BiDiMode = bdRightToLeft 51 | EditLabel.Caption = #1575#1604#1575#1587#1605' ('#1593')' 52 | EditLabel.ParentBiDiMode = False 53 | LabelPosition = lpRight 54 | TabOrder = 1 55 | LabelVisible = True 56 | LabelCaption = #1575#1604#1575#1587#1605' ('#1593')' 57 | LoadCaption = True 58 | Caption = #1575#1604#1575#1587#1605' ('#1593')' 59 | end 60 | object EdtNameEN: TArStrEdit 61 | Left = 8 62 | Top = 84 63 | Width = 599 64 | Height = 33 65 | Anchors = [akLeft, akTop, akRight] 66 | EditLabel.Width = 60 67 | EditLabel.Height = 25 68 | EditLabel.BiDiMode = bdRightToLeft 69 | EditLabel.Caption = #1575#1604#1575#1587#1605' (en)' 70 | EditLabel.ParentBiDiMode = False 71 | LabelPosition = lpRight 72 | TabOrder = 2 73 | LabelVisible = True 74 | LabelCaption = #1575#1604#1575#1587#1605' (en)' 75 | LoadCaption = True 76 | Caption = #1575#1604#1575#1587#1605' (en)' 77 | end 78 | object EdtNationalityAR: TArStrEdit 79 | Left = 8 80 | Top = 123 81 | Width = 599 82 | Height = 33 83 | Anchors = [akLeft, akTop, akRight] 84 | EditLabel.Width = 68 85 | EditLabel.Height = 25 86 | EditLabel.BiDiMode = bdRightToLeft 87 | EditLabel.Caption = #1575#1604#1580#1606#1587#1610#1577' ('#1593')' 88 | EditLabel.ParentBiDiMode = False 89 | LabelPosition = lpRight 90 | TabOrder = 3 91 | LabelVisible = True 92 | LabelCaption = #1575#1604#1580#1606#1587#1610#1577' ('#1593')' 93 | LoadCaption = True 94 | Caption = #1575#1604#1580#1606#1587#1610#1577' ('#1593')' 95 | end 96 | object EdtNationalityEN: TArStrEdit 97 | Left = 8 98 | Top = 162 99 | Width = 599 100 | Height = 33 101 | Anchors = [akLeft, akTop, akRight] 102 | EditLabel.Width = 75 103 | EditLabel.Height = 25 104 | EditLabel.BiDiMode = bdRightToLeft 105 | EditLabel.Caption = #1575#1604#1580#1606#1587#1610#1577' (en)' 106 | EditLabel.ParentBiDiMode = False 107 | LabelPosition = lpRight 108 | TabOrder = 4 109 | LabelVisible = True 110 | LabelCaption = #1575#1604#1580#1606#1587#1610#1577' (en)' 111 | LoadCaption = True 112 | Caption = #1575#1604#1580#1606#1587#1610#1577' (en)' 113 | end 114 | object EdtCallingCode: TArStrEdit 115 | Left = 8 116 | Top = 201 117 | Width = 599 118 | Height = 33 119 | Anchors = [akLeft, akTop, akRight] 120 | EditLabel.Width = 81 121 | EditLabel.Height = 25 122 | EditLabel.BiDiMode = bdRightToLeft 123 | EditLabel.Caption = #1605#1601#1578#1575#1581' '#1575#1604#1575#1578#1589#1575#1604 124 | EditLabel.ParentBiDiMode = False 125 | LabelPosition = lpRight 126 | TabOrder = 5 127 | LabelVisible = True 128 | LabelCaption = #1605#1601#1578#1575#1581' '#1575#1604#1575#1578#1589#1575#1604 129 | LoadCaption = True 130 | Caption = #1605#1601#1578#1575#1581' '#1575#1604#1575#1578#1589#1575#1604 131 | end 132 | object GroupBox1: TGroupBox 133 | AlignWithMargins = True 134 | Left = 4 135 | Top = 243 136 | Width = 699 137 | Height = 330 138 | Align = alBottom 139 | Anchors = [akLeft, akTop, akRight, akBottom] 140 | Caption = 'GroupBox1' 141 | TabOrder = 6 142 | end 143 | end 144 | end 145 | inherited PnlController: TPanel 146 | Left = 707 147 | Height = 612 148 | ExplicitLeft = 707 149 | ExplicitHeight = 612 150 | inherited BtnExit: TButton 151 | Top = 574 152 | ExplicitTop = 574 153 | end 154 | end 155 | end 156 | -------------------------------------------------------------------------------- /Design/ArColumnGrid.pas: -------------------------------------------------------------------------------- 1 | unit ArColumnGrid; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Classes, Vcl.Controls, Vcl.Grids, ArOrm.Da.Base, ArOrm.Obj.Info, Winapi.Windows; 7 | 8 | type 9 | TArColumnType = (ctCheckBox, ctText, ctInteger, ctFloat, ctTime, ctDate, ctDateTime); 10 | 11 | TArColumnOption = (coCenter, coLeft, coRight); 12 | 13 | TArColumnOptions = set of TArColumnOption; 14 | 15 | { TArColumnGrid = class(TAdvColumnGrid) 16 | private 17 | FList: TArDaList; 18 | protected 19 | procedure KeyDown(var Key: Word; Shift: TShiftState); override; 20 | 21 | public 22 | constructor Create(AOwner: TComponent); override; 23 | procedure EnumListField(const AListField:TArDaList); 24 | // procedure AddColumn(const AColumnType: TArColumnType;const AField:TArBasicField; 25 | // const AColumnOptions:TArColumnOptions=[]); overload; 26 | procedure AddColumn(const AColumnType: TArColumnType;const ATable:TArTable; 27 | const AColumn:TArColumn; const AColumnOptions:TArColumnOptions=[]); overload; 28 | procedure AddRowCheckColumn; 29 | procedure AddRowNumberColumn; 30 | procedure InsertRows(RowIndex: Integer; RCount: Integer; 31 | UpdateCellControls: Boolean = True); override; 32 | procedure Initialize; 33 | 34 | end; 35 | } 36 | procedure Register; 37 | 38 | implementation 39 | 40 | procedure Register; 41 | begin 42 | { RegisterComponents('ArOrm', [TArColumnGrid]);} 43 | end; 44 | 45 | { TArColumnGrid } 46 | 47 | //procedure TArColumnGrid.AddColumn(const AColumnType: TArColumnType; 48 | // const AField: TArBasicField; const AColumnOptions: TArColumnOptions=[]); 49 | //var 50 | // LColumn: TGridColumnItem; 51 | //begin 52 | // LColumn := Self.Columns.Add; 53 | // case AColumnType of 54 | // ctCheckBox: LColumn.Editor := edDataCheckBox; 55 | // ctText: LColumn.Editor := edNormal; 56 | // ctInteger: LColumn.Editor := edNumeric; 57 | // ctFloat: LColumn.Editor := edFloat; 58 | // ctTime: LColumn.Editor := edTimeEdit; 59 | // ctDate: LColumn.Editor := edDateEdit; 60 | // ctDateTime: LColumn.Editor := edDateTimeEdit; 61 | // end; 62 | // LColumn.Rows[0] := AField.ColInfo.Caption_AR; 63 | // if coCenter in AColumnOptions then 64 | // LColumn.HeaderAlignment := taCenter 65 | // else if coLeft in AColumnOptions then 66 | // LColumn.HeaderAlignment := taLeftJustify 67 | // else if coRight in AColumnOptions then 68 | // LColumn.HeaderAlignment := taRightJustify; 69 | // Self.Font.Size := 12; 70 | //end; 71 | { 72 | procedure TArColumnGrid.AddColumn(const AColumnType: TArColumnType; const ATable:TArTable; 73 | const AColumn:TArColumn;const AColumnOptions: TArColumnOptions); 74 | var 75 | LColumn: TGridColumnItem; 76 | begin 77 | LColumn := Self.Columns.Add; 78 | case AColumnType of 79 | ctCheckBox: LColumn.Editor := edDataCheckBox; 80 | ctText: LColumn.Editor := edNormal; 81 | ctInteger: LColumn.Editor := edNumeric; 82 | ctFloat: LColumn.Editor := edFloat; 83 | ctTime: LColumn.Editor := edTimeEdit; 84 | ctDate: LColumn.Editor := edDateEdit; 85 | ctDateTime: LColumn.Editor := edDateTimeEdit; 86 | end; 87 | LColumn.Rows[0] := AColumn.Caption_AR; 88 | if coCenter in AColumnOptions then 89 | LColumn.HeaderAlignment := taCenter 90 | else if coLeft in AColumnOptions then 91 | LColumn.HeaderAlignment := taLeftJustify 92 | else if coRight in AColumnOptions then 93 | LColumn.HeaderAlignment := taRightJustify; 94 | Self.Font.Size := 12; 95 | end; 96 | 97 | procedure TArColumnGrid.AddRowCheckColumn; 98 | var 99 | LColumn: TGridColumnItem; 100 | begin 101 | LColumn := Self.Columns.Add; 102 | LColumn.Editor := edDataCheckBox; 103 | LColumn.Rows[0] := '*'; 104 | end; 105 | 106 | procedure TArColumnGrid.AddRowNumberColumn; 107 | var 108 | LColumn: TGridColumnItem; 109 | begin 110 | LColumn := Self.Columns.Add; 111 | LColumn.Editor := edNumeric; 112 | LColumn.Rows[0] := '#'; 113 | LColumn.HeaderAlignment := taCenter; 114 | LColumn.Alignment := taCenter; 115 | LColumn.ColumnKind := ckAutoNumber; 116 | end; 117 | 118 | constructor TArColumnGrid.Create(AOwner: TComponent); 119 | begin 120 | inherited; 121 | Self.Font.Size := 12; 122 | Self.DefaultColWidth := 120; 123 | Self.DefaultRowHeight := 28; 124 | end; 125 | 126 | procedure TArColumnGrid.EnumListField(const AListField: TArDaList); 127 | var 128 | I: Integer; 129 | begin 130 | for I := 0 to Self.Columns.Count - 1 do 131 | Self.Columns.Delete(0); 132 | Self.RowCount := 0; 133 | Self.FList := AListField; 134 | end; 135 | 136 | procedure TArColumnGrid.Initialize; 137 | var 138 | I: Integer; 139 | begin 140 | Self.RowCount := 0; 141 | for I := 0 to 0 do 142 | begin 143 | InsertRows(RowCount, 1); 144 | end; 145 | end; 146 | 147 | procedure TArColumnGrid.InsertRows(RowIndex, RCount: Integer; 148 | UpdateCellControls: Boolean); 149 | var 150 | I: Integer; 151 | LColumn: TGridColumnItem; 152 | begin 153 | inherited; 154 | if Self.Columns.Items[0].ColumnKind = ckAutoNumber then 155 | begin 156 | Self.Cells[0, Self.RowCount -1] := IntToStr(RowIndex); 157 | end; 158 | end; 159 | 160 | procedure TArColumnGrid.KeyDown(var Key: Word; Shift: TShiftState); 161 | begin 162 | inherited; 163 | if key = VK_DOWN then 164 | begin 165 | if Self.Row = Self.RowCount - 1 then 166 | Self.InsertRows(RowCount, 1); 167 | Self.Row := Self.LastRow; 168 | end; 169 | end; 170 | } 171 | end. 172 | -------------------------------------------------------------------------------- /Design/ArGrid.pas: -------------------------------------------------------------------------------- 1 | unit ArGrid; 2 | 3 | interface 4 | { 5 | $004F4737 6 | $00625A4B 7 | $007E7461 8 | } 9 | uses 10 | System.SysUtils, System.Types, System.Classes, Vcl.Controls, Vcl.Grids, 11 | ArOrm.Da.Base, ArOrm.Obj.Info, ArEdit; 12 | 13 | type 14 | TArGrid = class(TDrawGrid) 15 | strict private 16 | FCapasity: Integer; 17 | FDaEntity: TArDaEntity; 18 | FList: TArDaList; 19 | FColumns: TArTablesColumns; 20 | FFields: array of TArBasicField; 21 | private 22 | procedure SetCapasity(const AValue: Integer); 23 | // function GetCells(ACol,ARow:Integer): TArField; 24 | // procedure SetCells(ACol,ARow):TArField; 25 | 26 | protected 27 | procedure DrawCell(ACol:Integer;ARow:Integer;ARect:TRect;AState:TGridDrawState); override; 28 | function GetFieldByColRow(const ACol, ARow:Integer): TArBasicField; 29 | function GetTableColumn(const ACol: Integer): TArTableColumn; 30 | 31 | public 32 | constructor Create(AOwner: TComponent); override; 33 | 34 | procedure EnumList(const AList:TArDaList;const AColumns: TArTablesColumns); 35 | 36 | property Capasity: Integer read FCapasity write SetCapasity; 37 | property DaEntity: TArDaEntity read FDaEntity write FDaEntity; 38 | property List: TArDaList read FList write FList; 39 | // property Cells[ACol, ARow: Integer]: string read GetCells write SetCells; 40 | published 41 | 42 | end; 43 | 44 | procedure Register; 45 | 46 | implementation 47 | 48 | uses Vcl.Graphics; 49 | 50 | procedure Register; 51 | begin 52 | RegisterComponents('ArOrm', [TArGrid]); 53 | end; 54 | 55 | { TArGrid } 56 | 57 | constructor TArGrid.Create(AOwner: TComponent); 58 | begin 59 | inherited; 60 | DefaultDrawing := True; 61 | //DefaultColWidth := 150; 62 | FCapasity := 4; 63 | DefaultDrawing := False; 64 | ColCount := 5; 65 | RowCount := Self.FCapasity + 1; 66 | FixedCols := 1; 67 | Repaint; 68 | end; 69 | 70 | procedure TArGrid.DrawCell(ACol, ARow: Integer; ARect: TRect; AState: TGridDrawState); 71 | //var 72 | // I: Integer; 73 | // J: Integer; 74 | // LRect: TRect; 75 | // LColNum: Integer; 76 | // LFields: TArDaList; 77 | begin 78 | inherited; 79 | if (ARow mod 2 = 0) then 80 | begin 81 | if (ARow = 0) or (ACol = 0) then Canvas.Brush.Color := $002B2726 //Fixed row 82 | else Canvas.Brush.Color := $00625844; //Dark row 83 | Canvas.Font.Color := clWhite; 84 | end 85 | else 86 | begin 87 | if (ACol = 0) then Canvas.Brush.Color := $00433D3A //fixed col 88 | else 89 | Canvas.Brush.Color := $00796D55; // Light Row 90 | Canvas.Font.Color := clWhite; 91 | end; 92 | if (gdFocused in AState)or(gdSelected in AState) then 93 | begin 94 | Canvas.Brush.Color := clGreen; // Selected Cell 95 | Canvas.Font.Color := clWhite; 96 | end; 97 | Canvas.FillRect(ARect); 98 | { 99 | Canvas.Brush.Style := bsClear; 100 | LColNum := 0; 101 | if ARow = 0 then 102 | begin 103 | if ACol = 0 then Canvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, '#') 104 | else 105 | for I := 0 to System.Length(Self.FColumns) - 1 do 106 | for J := 0 to System.Length(Self.FColumns[I].Columns) - 1 do 107 | begin 108 | LColNum := LColNum + 1; 109 | LRect := Self.CellRect(LColNum, 0); 110 | Canvas.TextRect(LRect, LRect.Left + 3, LRect.Top + 3, Self.FColumns[I].Columns[J].Caption_AR); 111 | end; 112 | end 113 | else 114 | begin 115 | if ACol = 0 then 116 | begin 117 | Canvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, IntToStr(ARow)); 118 | end 119 | else 120 | if Self.FList.Items.Count > 0 then 121 | begin 122 | Canvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, Self.GetFieldByColRow(ACol, ARow).DaToString); 123 | end; 124 | end; 125 | 126 | { 127 | LColNum := 0; 128 | if Self.FList <> nil then 129 | begin 130 | for I := 0 to System.Length(FColumns) - 1 do 131 | begin 132 | LRect := Self.CellRect(0, 0); 133 | Canvas.TextRect(LRect, LRect.Left + 3, LRect.Top + 3, '#'); 134 | for J := 0 to System.Length(FColumns[I].Columns) - 1 do 135 | begin 136 | LColNum := LColNum + 1; 137 | LRect := Self.CellRect(LColNum, 0); 138 | Canvas.TextRect(LRect, LRect.Left + 3, LRect.Top + 3, Self.FColumns[I].Columns[J].Caption_AR); 139 | end; 140 | end; 141 | end 142 | else 143 | begin 144 | Canvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, ''); 145 | end; 146 | } 147 | end; 148 | 149 | 150 | { 151 | if (ARow > 0) and (ACol > 0) then 152 | begin 153 | if Self.FList.Items.Count > 0 then 154 | begin 155 | LFields := Self.FList.Items[ARow - 1].Fields; 156 | for K := 0 to LFields.Items.Count - 1 do 157 | begin 158 | LField := LFields.Items[K]; 159 | if (LField.DbOwner.ID = Self.FColumns[I].Tables.ID) and (LField.ColInfo.ID = Self.FColumns[I].Columns[J].ID) then 160 | begin 161 | Self.Canvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, LField.DaToString); 162 | Break; 163 | end; 164 | end; 165 | end; 166 | end; 167 | } 168 | 169 | procedure TArGrid.EnumList(const AList: TArDaList;const AColumns: TArTablesColumns); 170 | var 171 | I: Integer; 172 | J: Integer; 173 | K: Integer; 174 | LColNum: Integer; 175 | LContainer: TArObj; 176 | LField: TArBasicField; 177 | begin 178 | Self.FColumns := AColumns; 179 | Self.FList := AList; 180 | Self.DefaultDrawing := True; 181 | Self.ColCount := 0; 182 | Self.FixedCols := 0; 183 | LColNum := 0; 184 | LContainer := AList.ContainerClassType.Create; 185 | try 186 | for I := 0 to System.Length(AColumns) - 1 do 187 | begin 188 | Self.ColCount := Self.ColCount + System.Length(AColumns[I].Columns); 189 | Self.FixedCols := 1; 190 | end; 191 | for I := 0 to Length(AColumns) - 1 do 192 | begin 193 | for J := 0 to Length(AColumns[I].Columns) - 1 do 194 | begin 195 | for K := 0 to TArContainerBase(LContainer).Fields.Count - 1 do 196 | begin 197 | LField := TArContainerBase(LContainer).Fields.Items[K]; 198 | if (LField.DbOwner.ID = AColumns[I].Table.ID) and (LField.ColInfo.ID = AColumns[I].Columns[J].ID) then 199 | Self.FFields := Self.FFields + [LField]; 200 | end; 201 | LColNum := LColNum + 1; 202 | Self.ColWidths[LColNum] := Self.Canvas.TextWidth(AColumns[I].Columns[J].Caption_AR) + 50; 203 | Self.RowHeights[0] := Self.Canvas.TextHeight(AColumns[I].Columns[J].Caption_AR) + 15; 204 | end; 205 | end; 206 | finally 207 | LContainer.Free; 208 | end; 209 | Self.Repaint; 210 | end; 211 | 212 | function TArGrid.GetFieldByColRow(const ACol, ARow: Integer): TArBasicField; 213 | var 214 | I: Integer; 215 | LTableColumn: TArTableColumn; 216 | LField: TArBasicField; 217 | begin 218 | LTableColumn := Self.GetTableColumn(ACol); 219 | for I := 0 to Self.FList.Items[0].Fields.Items.Count - 1 do 220 | begin 221 | if Self.FList.Items.Count > 0 then 222 | begin 223 | if Self.FList.Items[ARow - 1].Fields.Items.Count > 0 then 224 | begin 225 | LField := Self.FList.Items[ARow - 1].Fields.Items[I]; 226 | if (LField.DbOwner.ID = LTableColumn.Table.ID) and (LField.ColInfo.ID = LTableColumn.Column.ID) then 227 | begin 228 | Break; 229 | end; 230 | end; 231 | end; 232 | end; 233 | // if LField <> nil then Result := LField 234 | Result := nil; 235 | end; 236 | 237 | function TArGrid.GetTableColumn(const ACol: Integer): TArTableColumn; 238 | var 239 | I: Integer; 240 | J: Integer; 241 | LColNum: Integer; 242 | begin 243 | LColNum := 0; 244 | for I := 0 to Length(Self.FColumns) - 1 do 245 | for J := 0 to Length(Self.FColumns[I].Columns) - 1 do 246 | begin 247 | LColNum := LColNum + 1; 248 | if LColNum = ACol then 249 | begin 250 | Result.Table := Self.FColumns[I].Table; 251 | Result.Column := Self.FColumns[I].Columns[J]; 252 | Break; 253 | end; 254 | end; 255 | end; 256 | 257 | procedure TArGrid.SetCapasity(const AValue: Integer); 258 | begin 259 | FCapasity := AValue; 260 | end; 261 | 262 | end. 263 | -------------------------------------------------------------------------------- /Example/People/Cards/Ppl.Ca.Person.dfm: -------------------------------------------------------------------------------- 1 | inherited PplCaPerson: TPplCaPerson 2 | Caption = 'PplCaPerson' 3 | ClientHeight = 617 4 | ClientWidth = 721 5 | OnResize = FormResize 6 | ExplicitWidth = 737 7 | ExplicitHeight = 655 8 | PixelsPerInch = 96 9 | TextHeight = 25 10 | inherited PnlMain: TPanel 11 | Width = 618 12 | Height = 617 13 | ExplicitWidth = 618 14 | ExplicitHeight = 617 15 | inherited PnlNavigator: TPanel 16 | Width = 618 17 | ExplicitWidth = 618 18 | inherited EdtNNumber: TArIntEdit 19 | EditLabel.Width = 3 20 | EditLabel.Caption = '' 21 | EditLabel.ExplicitLeft = 70 22 | EditLabel.ExplicitTop = 5 23 | EditLabel.ExplicitWidth = 3 24 | LabelVisible = True 25 | LabelCaption = '' 26 | Caption = '' 27 | end 28 | end 29 | inherited PnlEditor: TPanel 30 | Width = 618 31 | Height = 582 32 | ExplicitWidth = 618 33 | ExplicitHeight = 582 34 | inherited EdtSNationality: TArSearchEdit 35 | Width = 510 36 | EditLabel.ExplicitLeft = 521 37 | ExplicitWidth = 510 38 | end 39 | inherited EdtNameEN: TArStrEdit 40 | Top = 245 41 | Width = 510 42 | EditLabel.ExplicitLeft = 521 43 | EditLabel.ExplicitTop = 249 44 | TabOrder = 3 45 | ExplicitTop = 245 46 | ExplicitWidth = 510 47 | end 48 | inherited EdtNameAR: TArStrEdit 49 | Top = 206 50 | Width = 510 51 | EditLabel.ExplicitLeft = 521 52 | EditLabel.ExplicitTop = 210 53 | TabOrder = 2 54 | ExplicitTop = 206 55 | ExplicitWidth = 510 56 | end 57 | object PnlNames: TPanel 58 | Left = 8 59 | Top = 45 60 | Width = 604 61 | Height = 155 62 | Anchors = [akLeft, akTop, akRight] 63 | BevelOuter = bvNone 64 | TabOrder = 1 65 | object PnlENNames: TPanel 66 | Left = 0 67 | Top = 0 68 | Width = 297 69 | Height = 155 70 | Align = alLeft 71 | BevelOuter = bvNone 72 | TabOrder = 1 73 | DesignSize = ( 74 | 297 75 | 155) 76 | object EdtFirstNameEN: TArStrEdit 77 | Left = 0 78 | Top = 0 79 | Width = 193 80 | Height = 33 81 | Anchors = [akLeft, akTop, akRight] 82 | EditLabel.Width = 93 83 | EditLabel.Height = 25 84 | EditLabel.BiDiMode = bdRightToLeft 85 | EditLabel.Caption = #1575#1604#1575#1587#1605' '#1575#1604#1571#1608#1604' (EN)' 86 | EditLabel.ParentBiDiMode = False 87 | LabelPosition = lpRight 88 | TabOrder = 0 89 | LabelVisible = True 90 | LabelCaption = #1575#1604#1575#1587#1605' '#1575#1604#1571#1608#1604' (EN)' 91 | LoadCaption = True 92 | Caption = #1575#1604#1575#1587#1605' '#1575#1604#1571#1608#1604' (EN)' 93 | end 94 | object EdtLastNameEN: TArStrEdit 95 | Left = 0 96 | Top = 39 97 | Width = 193 98 | Height = 33 99 | Anchors = [akLeft, akTop, akRight] 100 | EditLabel.Width = 93 101 | EditLabel.Height = 25 102 | EditLabel.BiDiMode = bdRightToLeft 103 | EditLabel.Caption = #1575#1587#1605' '#1575#1604#1593#1575#1574#1604#1577' (EN)' 104 | EditLabel.ParentBiDiMode = False 105 | LabelPosition = lpRight 106 | TabOrder = 1 107 | LabelVisible = True 108 | LabelCaption = #1575#1587#1605' '#1575#1604#1593#1575#1574#1604#1577' (EN)' 109 | LoadCaption = True 110 | Caption = #1575#1587#1605' '#1575#1604#1593#1575#1574#1604#1577' (EN)' 111 | end 112 | object EdtFatherNameEN: TArStrEdit 113 | Left = 0 114 | Top = 78 115 | Width = 193 116 | Height = 33 117 | Anchors = [akLeft, akTop, akRight] 118 | EditLabel.Width = 82 119 | EditLabel.Height = 25 120 | EditLabel.BiDiMode = bdRightToLeft 121 | EditLabel.Caption = #1575#1587#1605' '#1575#1604#1571#1576' (EN)' 122 | EditLabel.ParentBiDiMode = False 123 | LabelPosition = lpRight 124 | TabOrder = 2 125 | LabelVisible = True 126 | LabelCaption = #1575#1587#1605' '#1575#1604#1571#1576' (EN)' 127 | LoadCaption = True 128 | Caption = #1575#1587#1605' '#1575#1604#1571#1576' (EN)' 129 | end 130 | object EdtMotherNameEN: TArStrEdit 131 | Left = 0 132 | Top = 117 133 | Width = 193 134 | Height = 33 135 | Anchors = [akLeft, akTop, akRight] 136 | EditLabel.Width = 78 137 | EditLabel.Height = 25 138 | EditLabel.BiDiMode = bdRightToLeft 139 | EditLabel.Caption = #1575#1587#1605' '#1575#1604#1571#1605' (EN)' 140 | EditLabel.ParentBiDiMode = False 141 | LabelPosition = lpRight 142 | TabOrder = 3 143 | LabelVisible = True 144 | LabelCaption = #1575#1587#1605' '#1575#1604#1571#1605' (EN)' 145 | LoadCaption = True 146 | Caption = #1575#1587#1605' '#1575#1604#1571#1605' (EN)' 147 | end 148 | end 149 | object PnlARNames: TPanel 150 | Left = 303 151 | Top = 0 152 | Width = 301 153 | Height = 155 154 | Align = alRight 155 | BevelOuter = bvNone 156 | TabOrder = 0 157 | DesignSize = ( 158 | 301 159 | 155) 160 | object EdtFirstNameAR: TArStrEdit 161 | Left = 0 162 | Top = 0 163 | Width = 207 164 | Height = 33 165 | Anchors = [akLeft, akTop, akRight] 166 | EditLabel.Width = 84 167 | EditLabel.Height = 25 168 | EditLabel.BiDiMode = bdRightToLeft 169 | EditLabel.Caption = #1575#1604#1575#1587#1605' '#1575#1604#1571#1608#1604' ('#1593')' 170 | EditLabel.ParentBiDiMode = False 171 | LabelPosition = lpRight 172 | TabOrder = 0 173 | LabelVisible = True 174 | LabelCaption = #1575#1604#1575#1587#1605' '#1575#1604#1571#1608#1604' ('#1593')' 175 | LoadCaption = True 176 | Caption = #1575#1604#1575#1587#1605' '#1575#1604#1571#1608#1604' ('#1593')' 177 | end 178 | object EdtLastNameAR: TArStrEdit 179 | Left = 0 180 | Top = 39 181 | Width = 207 182 | Height = 33 183 | Anchors = [akLeft, akTop, akRight] 184 | EditLabel.Width = 84 185 | EditLabel.Height = 25 186 | EditLabel.BiDiMode = bdRightToLeft 187 | EditLabel.Caption = #1575#1587#1605' '#1575#1604#1593#1575#1574#1604#1577' ('#1593')' 188 | EditLabel.ParentBiDiMode = False 189 | LabelPosition = lpRight 190 | TabOrder = 1 191 | LabelVisible = True 192 | LabelCaption = #1575#1587#1605' '#1575#1604#1593#1575#1574#1604#1577' ('#1593')' 193 | LoadCaption = True 194 | Caption = #1575#1587#1605' '#1575#1604#1593#1575#1574#1604#1577' ('#1593')' 195 | end 196 | object EdtFatherNameAR: TArStrEdit 197 | Left = 0 198 | Top = 78 199 | Width = 207 200 | Height = 33 201 | Anchors = [akLeft, akTop, akRight] 202 | EditLabel.Width = 73 203 | EditLabel.Height = 25 204 | EditLabel.BiDiMode = bdRightToLeft 205 | EditLabel.Caption = #1575#1587#1605' '#1575#1604#1571#1576' ('#1593')' 206 | EditLabel.ParentBiDiMode = False 207 | LabelPosition = lpRight 208 | TabOrder = 2 209 | LabelVisible = True 210 | LabelCaption = #1575#1587#1605' '#1575#1604#1571#1576' ('#1593')' 211 | LoadCaption = True 212 | Caption = #1575#1587#1605' '#1575#1604#1571#1576' ('#1593')' 213 | end 214 | object EdtMotherNameAR: TArStrEdit 215 | Left = 0 216 | Top = 117 217 | Width = 207 218 | Height = 33 219 | Anchors = [akLeft, akTop, akRight] 220 | EditLabel.Width = 69 221 | EditLabel.Height = 25 222 | EditLabel.BiDiMode = bdRightToLeft 223 | EditLabel.Caption = #1575#1587#1605' '#1575#1604#1571#1605' ('#1593')' 224 | EditLabel.ParentBiDiMode = False 225 | LabelPosition = lpRight 226 | TabOrder = 3 227 | LabelVisible = True 228 | LabelCaption = #1575#1587#1605' '#1575#1604#1571#1605' ('#1593')' 229 | LoadCaption = True 230 | Caption = #1575#1587#1605' '#1575#1604#1571#1605' ('#1593')' 231 | end 232 | end 233 | end 234 | object GroupBox1: TGroupBox 235 | Left = 8 236 | Top = 280 237 | Width = 604 238 | Height = 297 239 | Anchors = [akLeft, akTop, akRight, akBottom] 240 | Caption = #1593#1606#1575#1608#1610#1606' '#1575#1604#1575#1578#1589#1575#1604': ' 241 | TabOrder = 4 242 | end 243 | end 244 | end 245 | inherited PnlController: TPanel 246 | Left = 618 247 | Height = 617 248 | ExplicitLeft = 618 249 | ExplicitHeight = 617 250 | inherited BtnExit: TButton 251 | Top = 579 252 | ExplicitTop = 579 253 | end 254 | end 255 | end 256 | -------------------------------------------------------------------------------- /Example/People/DataAccess/Ppl.Da.Contact.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Da.Contact; 2 | 3 | interface 4 | 5 | uses ArOrm.Consts, ArOrm.Da.Base, ArOrm.Obj.Info, Ppl.Consts, Ppl.Da.Region; 6 | 7 | type 8 | {///////////////////////////////////////////////////////////////////////////} 9 | {**********************}{$REGION '[ TBases ]'}{*****************************} 10 | TArConnectionType = (ctPhone, ctEmail, ctWebSite, ctOther); 11 | TPplDaContact = class; 12 | {**********************}{$ENDREGION}{***************************************} 13 | {///////////////////////////////////////////////////////////////////////////} 14 | 15 | {///////////////////////////////////////////////////////////////////////////} 16 | {**********************}{$REGION '[ TPplDaContact ]'}{**********************} 17 | TPplDaContact = class(TIDContainer) 18 | strict private 19 | // FID: TArDbField; 20 | FNumber: TArDbField; 21 | FNameAR: TArDbStrField; 22 | FNameEN: TArDbStrField; 23 | FNationality: TArDbField; 24 | public 25 | {##################}{$REGION '[ Events ]'}{#############################} 26 | procedure EnumFields(const AEnumorator: TArEnumorator); override; 27 | class function TableInfo_cls: TArTable; override; 28 | {##################}{$ENDREGION}{#######################################} 29 | {##################}{$REGION '[ GFields ]'}{############################} 30 | property FldID: TArDbField read FID; 31 | property FldNumber: TArDbField read FNumber; 32 | property FldNameAR: TArDbStrField read FNameAR; 33 | property FldNameEN: TArDbStrField read FNameEN; 34 | property FldNationality: TArDbField read FNationality; 35 | {##################}{$ENDREGION}{#######################################} 36 | end; 37 | {**********************}{$ENDREGION}{***************************************} 38 | {///////////////////////////////////////////////////////////////////////////} 39 | 40 | {///////////////////////////////////////////////////////////////////////////} 41 | {**********************}{$REGION '[ TPplDaConnection ]'}{*******************} 42 | TPplDaConnection = class(TIDContainer) 43 | strict private 44 | FNumber: TArDbField; 45 | FConnection: TArDbStrField; 46 | FType: TArConnectionType; 47 | public 48 | 49 | end; 50 | {**********************}{$ENDREGION}{***************************************} 51 | {///////////////////////////////////////////////////////////////////////////} 52 | 53 | {///////////////////////////////////////////////////////////////////////////} 54 | {**********************}{$REGION '[ TPplDaPerson ]'}{**********************} 55 | TPplDaPerson = class(TPplDaContact) 56 | strict private 57 | FID: TArDbField; 58 | FNumber: TArDbField; 59 | FFirstNameAR: TArDbStrField; 60 | FFirstNameEN: TArDbStrField; 61 | FLastNameAR: TArDbStrField; 62 | FLastNameEN: TArDbStrField; 63 | FFatherNameAR: TArDbStrField; 64 | FFatherNameEN: TArDbStrField; 65 | FMotherNameAR: TArDbStrField; 66 | FMotherNameEN: TArDbStrField; 67 | 68 | procedure OnNameARChange(const APutInfo:TArPutInfo); 69 | procedure OnNameENChange(const APutInfo:TArPutInfo); 70 | 71 | function GetNameAR: string; 72 | function GetNameEN: string; 73 | 74 | strict protected 75 | procedure DoAfterCreate; override; 76 | 77 | public 78 | {##################}{$REGION '[ Events ]'}{#############################} 79 | procedure EnumFields(const AEnumorator: TArEnumorator); override; 80 | class function TableInfo_cls: TArTable; override; 81 | 82 | {##################}{$ENDREGION}{#######################################} 83 | {##################}{$REGION '[ GFields ]'}{############################} 84 | property FldID: TArDbField read FID; 85 | property FldNumber: TArDbField read FNumber; 86 | property FldFirstNameAR: TArDbStrField read FFirstNameAR; 87 | property FldFirstNameEN: TArDbStrField read FFirstNameEN; 88 | property FldLastNameAR: TArDbStrField read FLastNameAR; 89 | property FldLastNameEN: TArDbStrField read FLastNameEN; 90 | property FldFatherNameAR: TArDbStrField read FFatherNameAR; 91 | property FldFatherNameEN: TArDbStrField read FFatherNameEN; 92 | property FldMotherNameAR: TArDbStrField read FMotherNameAR; 93 | property FldMotherNameEN: TArDbStrField read FMotherNameEN; 94 | {##################}{$ENDREGION}{#######################################} 95 | end; 96 | {**********************}{$ENDREGION}{***************************************} 97 | {///////////////////////////////////////////////////////////////////////////} 98 | 99 | {///////////////////////////////////////////////////////////////////////////} 100 | {**********************}{$REGION '[ TPplDaCompany ]'}{**********************} 101 | TPplDaCompany = class(TPplDaContact) 102 | strict private 103 | FID: TArDbField; 104 | FNumber: TArDbField; 105 | public 106 | {##################}{$REGION '[ Events ]'}{#############################} 107 | procedure EnumFields(const AEnumorator: TArEnumorator); override; 108 | class function TableInfo_cls: TArTable; override; 109 | {##################}{$ENDREGION}{#######################################} 110 | {##################}{$REGION '[ GFields ]'}{############################} 111 | property FldID: TArDbField read FID; 112 | property FldNumber: TArDbField read FNumber; 113 | {##################}{$ENDREGION}{#######################################} 114 | end; 115 | {**********************}{$ENDREGION}{***************************************} 116 | {///////////////////////////////////////////////////////////////////////////} 117 | implementation 118 | 119 | {///////////////////////////////////////////////////////////////////////////} 120 | {**********************}{$REGION '[ TPplDaContact ]'}{**********************} 121 | procedure TPplDaContact.EnumFields(const AEnumorator: TArEnumorator); 122 | begin 123 | inherited; 124 | AEnumorator.EnumField(TArObj(Self.FID), TArDbField, CCol_ID, CTbl_PplContact, [csNotNull, csAutoNumber, csIdentity, csPrimaryKey], [ccNeeded]); 125 | AEnumorator.EnumField(TArObj(Self.FNumber), TArDbField, CCol_Number, CTbl_PplContact, [csAutoNumber], [{ccNeeded}]); 126 | AEnumorator.EnumField(TArObj(Self.FNameAR), TArDbStrField, CCol_NameAR, 40, CTbl_PplContact, [csCaption], [{ccNeeded}]); 127 | AEnumorator.EnumField(TArObj(Self.FNameEN), TArDbStrField, CCol_NameEN, 40, CTbl_PplContact, [csCaption], [{ccNeeded}]); 128 | AEnumorator.EnumField(TArObj(Self.FNationality), TArDbField, CCol_NationalityID, CTbl_PplContact, [csForeignKey], [{ccNeeded}]); 129 | Self.FNationality.Captions := [CCol_NationalityAR, CCol_NationalityEN]; 130 | end; 131 | 132 | class function TPplDaContact.TableInfo_cls: TArTable; 133 | begin 134 | Result := CTbl_PplContact; 135 | end; 136 | {**********************}{$ENDREGION}{***************************************} 137 | {///////////////////////////////////////////////////////////////////////////} 138 | 139 | {///////////////////////////////////////////////////////////////////////////} 140 | {**********************}{$REGION '[ TPplDaPerson ]'}{***********************} 141 | procedure TPplDaPerson.DoAfterCreate; 142 | begin 143 | inherited; 144 | Self.FldFirstNameAR.EventsManager.AddToDoAfterChange(Self.OnNameARChange); 145 | Self.FldLastNameAR.EventsManager.AddToDoAfterChange(Self.OnNameARChange); 146 | Self.FldFatherNameAR.EventsManager.AddToDoAfterChange(Self.OnNameARChange); 147 | 148 | Self.FldFirstNameEN.EventsManager.AddToDoAfterChange(Self.OnNameENChange); 149 | Self.FldLastNameEN.EventsManager.AddToDoAfterChange(Self.OnNameENChange); 150 | Self.FldFatherNameEN.EventsManager.AddToDoAfterChange(Self.OnNameENChange); 151 | end; 152 | 153 | procedure TPplDaPerson.EnumFields(const AEnumorator: TArEnumorator); 154 | begin 155 | inherited; 156 | AEnumorator.EnumField(TArObj(Self.FID), TArDbField, CCol_ID, CTbl_PplPerson, [csNotNull, csPrimaryKey, csForeignKey], [ccNeeded]); 157 | AEnumorator.EnumField(TArObj(Self.FNumber), TArDbField, CCol_Number, CTbl_PplPerson, [csAutoNumber]); 158 | AEnumorator.EnumField(TArObj(Self.FFirstNameAR), TArDbStrField, CCol_NameAR, 40, CTbl_PplPerson); 159 | AEnumorator.EnumField(TArObj(Self.FFirstNameEN), TArDbStrField, CCol_FirstNameEN, 40, CTbl_PplPerson); 160 | AEnumorator.EnumField(TArObj(Self.FLastNameAR), TArDbStrField, CCol_LastNameAR, 40, CTbl_PplPerson); 161 | AEnumorator.EnumField(TArObj(Self.FLastNameEN), TArDbStrField, CCol_LastNameEN, 40, CTbl_PplPerson); 162 | AEnumorator.EnumField(TArObj(Self.FFatherNameAR), TArDbStrField, CCol_FatherNameAR, 40, CTbl_PplPerson); 163 | AEnumorator.EnumField(TArObj(Self.FFatherNameEN), TArDbStrField, CCol_FatherNameEN, 40, CTbl_PplPerson); 164 | AEnumorator.EnumField(TArObj(Self.FMotherNameAR), TArDbStrField, CCol_MotherNameAR, 40, CTbl_PplPerson); 165 | AEnumorator.EnumField(TArObj(Self.FMotherNameEN), TArDbStrField, CCol_MotherNameEN, 40, CTbl_PplPerson); 166 | end; 167 | 168 | function TPplDaPerson.GetNameAR: string; 169 | var 170 | LFirstNameAR: string; 171 | LLastNameAR: string; 172 | LFatherNameAR: string; 173 | begin 174 | LFirstNameAR := Self.FldFirstNameAR.Value; 175 | LLastNameAR := Self.FldLastNameAR.Value; 176 | LFatherNameAR := Self.FldFatherNameAR.Value; 177 | Result := LFirstNameAR; 178 | if LFatherNameAR <> '' then Result := Result + ' ' + LFatherNameAR; 179 | if LLastNameAR <> '' then Result := Result + ' ' + LLastNameAR; 180 | end; 181 | 182 | function TPplDaPerson.GetNameEN: string; 183 | var 184 | LFirstNameEN: string; 185 | LLastNameEN: string; 186 | LFatherNameEN: string; 187 | begin 188 | LFirstNameEN := Self.FldFirstNameEN.Value; 189 | LLastNameEN := Self.FldLastNameEN.Value; 190 | LFatherNameEN := Self.FldFatherNameEN.Value; 191 | Result := LFirstNameEN; 192 | if LFatherNameEN <> '' then Result := Result + ' ' + LFatherNameEN; 193 | if LLastNameEN <> '' then Result := Result + ' ' + LLastNameEN; 194 | end; 195 | 196 | procedure TPplDaPerson.OnNameARChange(const APutInfo:TArPutInfo); 197 | begin 198 | if [pfInLoad, pfNew] * APutInfo.PutFlags <> [] then Exit; 199 | Self.FldNameAR.SetValue(Self.GetNameAR, [pfUserFlagA]); 200 | end; 201 | 202 | procedure TPplDaPerson.OnNameENChange(const APutInfo:TArPutInfo); 203 | begin 204 | if [pfInLoad, pfNew] * APutInfo.PutFlags <> [] then Exit; 205 | Self.FldNameEN.SetValue(Self.GetNameEN, [pfUserFlagA]); 206 | end; 207 | 208 | class function TPplDaPerson.TableInfo_cls: TArTable; 209 | begin 210 | Result := CTbl_PplPerson; 211 | end; 212 | {**********************}{$ENDREGION}{***************************************} 213 | {///////////////////////////////////////////////////////////////////////////} 214 | 215 | {///////////////////////////////////////////////////////////////////////////} 216 | {**********************}{$REGION '[ TPplDaCompany ]'}{***********************} 217 | procedure TPplDaCompany.EnumFields(const AEnumorator: TArEnumorator); 218 | begin 219 | inherited; 220 | AEnumorator.EnumField(TArObj(Self.FID), TArDbField, CCol_ID, CTbl_PplCompany, [csNotNull, csPrimaryKey, csForeignKey], [ccNeeded]); 221 | AEnumorator.EnumField(TArObj(Self.FNumber), TArDbField, CCol_Number, CTbl_PplCompany, [csAutoNumber]); 222 | end; 223 | 224 | class function TPplDaCompany.TableInfo_cls: TArTable; 225 | begin 226 | Result := CTbl_PplCompany; 227 | end; 228 | {**********************}{$ENDREGION}{***************************************} 229 | {///////////////////////////////////////////////////////////////////////////} 230 | end. 231 | -------------------------------------------------------------------------------- /Example/People/DataAccess/Ppl.Da.Region.pas: -------------------------------------------------------------------------------- 1 | unit Ppl.Da.Region; 2 | 3 | interface 4 | 5 | uses ArOrm.Da.Base, ArOrm.Obj.Info, ArOrm.Consts, Ppl.Consts; 6 | 7 | type 8 | {///////////////////////////////////////////////////////////////////////////} 9 | {**********************}{$REGION '[ TBases ]'}{*****************************} 10 | TPplDaRegion = class; 11 | TPplDaCountry = class; 12 | TPplDaProvince = class; 13 | TPplDaCity = class; 14 | {**********************}{$ENDREGION}{***************************************} 15 | {///////////////////////////////////////////////////////////////////////////} 16 | 17 | {///////////////////////////////////////////////////////////////////////////} 18 | {**********************}{$REGION '[ TPplDaRegion ]'}{***********************} 19 | TPplDaRegion = class(TIDContainer) 20 | strict private 21 | {##################}{$REGION '[ Fields ]'}{#############################} 22 | FNumber: TArDbField; 23 | FCode: TArDbStrField; 24 | FNameAR: TArDbStrField; 25 | FNameEN: TArDbStrField; 26 | FCallingCode: TArDbStrField; 27 | {##################}{$ENDREGION}{#######################################} 28 | public 29 | {##################}{$REGION '[ Events ]'}{#############################} 30 | procedure EnumFields(const AEnumorator: TArEnumorator); override; 31 | class function TableInfo_cls: TArTable; override; 32 | {##################}{$ENDREGION}{#######################################} 33 | {##################}{$REGION '[ GFields ]'}{############################} 34 | property FldNumber: TArDbField read FNumber; 35 | property FldCode: TArDbStrField read FCode; 36 | property FldNameAR: TArDbStrField read FNameAR; 37 | property FldNameEN: TArDbStrField read FNameEN; 38 | property FldCallingCode: TArDbStrField read FCallingCode; 39 | {##################}{$ENDREGION}{#######################################} 40 | end; 41 | {**********************}{$ENDREGION}{***************************************} 42 | {///////////////////////////////////////////////////////////////////////////} 43 | 44 | {///////////////////////////////////////////////////////////////////////////} 45 | {**********************}{$REGION '[ TPplDaCountry ]'}{**********************} 46 | TPplDaCountry = class(TPplDaRegion) 47 | strict private 48 | {##################}{$REGION '[ Fields ]'}{#############################} 49 | FID: TArDbField; 50 | FNumber: TArDbField; 51 | FNationalityAR: TArDbStrField; 52 | FNationalityEN: TArDbStrField; 53 | FCallingCode: TArDbStrField; 54 | FProvinces: TArDaList; 55 | {##################}{$ENDREGION}{#######################################} 56 | public 57 | {##################}{$REGION '[ Events ]'}{#############################} 58 | class function TableInfo_cls: TArTable; override; 59 | procedure EnumFields(const AEnumorator: TArEnumorator); override; 60 | procedure BeforeInsert; override; 61 | {##################}{$ENDREGION}{#######################################} 62 | {##################}{$REGION '[ GFields ]'}{############################} 63 | property FldID: TArDbField read FID; 64 | property FldNumber: TArDbField read FNumber; 65 | property FldNationalityAR: TArDbStrField read FNationalityAR; 66 | property FldNationalityEN: TArDbStrField read FNationalityEN; 67 | property FldCallingCode: TArDbStrField read FCallingCode; 68 | property FldProvinces: TArDaList read FProvinces; 69 | {##################}{$ENDREGION}{#######################################} 70 | end; 71 | {**********************}{$ENDREGION}{***************************************} 72 | {///////////////////////////////////////////////////////////////////////////} 73 | 74 | {///////////////////////////////////////////////////////////////////////////} 75 | {**********************}{$REGION '[ TPplDaProvince ]'}{*********************} 76 | TPplDaProvince = class(TPplDaRegion) 77 | strict private 78 | {##################}{$REGION '[ Fields ]'}{#############################} 79 | FID: TArDbField; 80 | FNumber: TArDbField; 81 | FCallingCode: TArDbStrField; 82 | FCountry: TArDbField; 83 | {##################}{$ENDREGION}{#######################################} 84 | public 85 | {##################}{$REGION '[ Events ]'}{#############################} 86 | class function TableInfo_cls: TArTable; override; 87 | procedure EnumFields(const AEnumorator: TArEnumorator); override; 88 | procedure BeforeInsert; override; 89 | {##################}{$ENDREGION}{#######################################} 90 | {##################}{$REGION '[ GFields ]'}{############################} 91 | property FldID: TArDbField read FID; 92 | property FldNumber: TArDbField read FNumber; 93 | // property FldCode: TArDbStrField read FCode; 94 | // property FldNationality: TArDbField read FNationality; 95 | property FldCallingCode: TArDbStrField read FCallingCode; 96 | property FldCountry: TArDbField read FCountry; 97 | // property FldParent: TArDbField read FParent; 98 | {##################}{$ENDREGION}{#######################################} 99 | end; 100 | {**********************}{$ENDREGION}{***************************************} 101 | {///////////////////////////////////////////////////////////////////////////} 102 | 103 | {///////////////////////////////////////////////////////////////////////////} 104 | {**********************}{$REGION '[ TPplDaCity ]'}{*************************} 105 | TPplDaCity = class(TPplDaRegion) 106 | strict private 107 | {##################}{$REGION '[ Fields ]'}{#############################} 108 | FID: TArDbField; 109 | FNumber: TArDbField; 110 | FProvince: TArDbField; 111 | {##################}{$ENDREGION}{#######################################} 112 | public 113 | {##################}{$REGION '[ Events ]'}{#############################} 114 | class function TableInfo_cls: TArTable; override; 115 | procedure EnumFields(const AEnumorator: TArEnumorator); override; 116 | procedure BeforeInsert; override; 117 | {##################}{$ENDREGION}{#######################################} 118 | {##################}{$REGION '[ GFields ]'}{############################} 119 | property FldID: TArDbField read FID; 120 | property FldNumber: TArDbField read FNumber; 121 | property FldProvince: TArDbField read FProvince; 122 | // property FldCode: TArDbStrField read FCode; 123 | // property FldProvince: TArDbField read FProvince; 124 | {##################}{$ENDREGION}{#######################################} 125 | end; 126 | {**********************}{$ENDREGION}{***************************************} 127 | {///////////////////////////////////////////////////////////////////////////} 128 | implementation 129 | 130 | {///////////////////////////////////////////////////////////////////////////} 131 | {**********************}{$REGION '[ TPplDaRegion ]'}{***********************} 132 | procedure TPplDaRegion.EnumFields(const AEnumorator: TArEnumorator); 133 | begin 134 | inherited; 135 | AEnumorator.EnumField(TArObj(Self.FID), TArDbField, CCol_ID, CTbl_PplRegion, [csNotNull, csAutoNumber, csIdentity, csPrimaryKey], [ccNeeded]); 136 | AEnumorator.EnumField(TArObj(Self.FNumber), TArDbField, CCol_Number, CTbl_PplRegion, [csAutoNumber], [ccReadOnly, ccNeeded]); 137 | AEnumorator.EnumField(TArObj(Self.FCode), TArDbStrField, CCol_Code, 20, CTbl_PplRegion, [csAutoCode, csNotNull, csUnique], [ccNeeded]); 138 | AEnumorator.EnumField(TArObj(Self.FNameAR), TArDbStrField, CCol_NameAR, 40, CTbl_PplRegion, [csCaption], [ccNeeded]); 139 | AEnumorator.EnumField(TArObj(Self.FNameEN), TArDbStrField, CCol_NameEN, 40, CTbl_PplRegion, [csCaption], [ccNeeded]); 140 | AEnumorator.EnumField(TArObj(Self.FCallingCode), TArDbStrField, CCol_CallingCode, 10, CTbl_PplRegion, [], [ccNeeded]); 141 | end; 142 | 143 | class function TPplDaRegion.TableInfo_cls: TArTable; 144 | begin 145 | Result := CTbl_PplRegion; 146 | end; 147 | {**********************}{$ENDREGION}{***************************************} 148 | {///////////////////////////////////////////////////////////////////////////} 149 | 150 | {///////////////////////////////////////////////////////////////////////////} 151 | {**********************}{$REGION '[ TPplDaCountry ]'}{**********************} 152 | procedure TPplDaCountry.BeforeInsert; 153 | begin 154 | inherited; 155 | TPplDaRegion(Self).FldCallingCode.SetValue(Self.FCallingCode.Value); 156 | end; 157 | 158 | procedure TPplDaCountry.EnumFields(const AEnumorator: TArEnumorator); 159 | begin 160 | inherited; 161 | AEnumorator.EnumField(TArObj(Self.FID), TArDbField, CCol_ID, CTbl_PplCountry, [csNotNull, csPrimaryKey, csForeignKey], [ccNeeded]); 162 | AEnumorator.EnumField(TArObj(Self.FNumber), TArDbField, CCol_Number, CTbl_PplCountry, [csAutoNumber], [ccReadOnly, ccNeeded]); 163 | AEnumorator.EnumField(TArObj(Self.FNationalityAR), TArDbStrField, CCol_NationalityAR, 40, CTbl_PplCountry, [csCaption], [ccNeeded]); 164 | AEnumorator.EnumField(TArObj(Self.FNationalityEN), TArDbStrField, CCol_NationalityEN, 40, CTbl_PplCountry, [csCaption], [ccNeeded]); 165 | AEnumorator.EnumField(TArObj(Self.FCallingCode), TArDbStrField, CCol_CallingCode, 10, CTbl_PplCountry, [], [ccNeeded]); 166 | AEnumorator.EnumField(TArObj(Self.FProvinces), TArDaList, CCol_Provinces, CCol_CountryID, Self); 167 | end; 168 | 169 | class function TPplDaCountry.TableInfo_cls: TArTable; 170 | begin 171 | Result := CTbl_PplCountry; 172 | end; 173 | {**********************}{$ENDREGION}{***************************************} 174 | {///////////////////////////////////////////////////////////////////////////} 175 | 176 | {///////////////////////////////////////////////////////////////////////////} 177 | {**********************}{$REGION '[ TPplDaProvince ]'}{*********************} 178 | procedure TPplDaProvince.BeforeInsert; 179 | var 180 | LCallingCode: string; 181 | begin 182 | inherited; 183 | LCallingCode := TPplDaRegion(Self.FCountry.Value).FldCallingCode.DaToString; 184 | LCallingCode := LCallingCode + Copy(Self.FCallingCode.Value, 2, Length(Self.FCallingCode.Value)); 185 | TPplDaRegion(Self).FldCallingCode.SetValue(LCallingCode); 186 | end; 187 | 188 | procedure TPplDaProvince.EnumFields(const AEnumorator: TArEnumorator); 189 | begin 190 | inherited; 191 | AEnumorator.EnumField(TArObj(Self.FID), TArDbField, CCol_ID, CTbl_PplProvince, [csNotNull, csPrimaryKey, csForeignKey], [ccNeeded]); 192 | AEnumorator.EnumField(TArObj(Self.FNumber), TArDbField, CCol_Number, CTbl_PplProvince, [csAutoNumber], [ccReadOnly, ccNeeded]); 193 | AEnumorator.EnumField(TArObj(Self.FCallingCode), TArDbStrField, CCol_CallingCode, 10, CTbl_PplProvince, [], [ccNeeded]); 194 | AEnumorator.EnumField(TArObj(Self.FCountry), TArDbField, CCol_CountryID, CTbl_PplProvince, [csForeignKey], [ccNeeded]); 195 | Self.FCountry.Captions := [CCol_NameAR, CCol_NameEN, CCol_NationalityAR, CCol_NationalityEN]; 196 | end; 197 | 198 | class function TPplDaProvince.TableInfo_cls: TArTable; 199 | begin 200 | Result := CTbl_PplProvince; 201 | end; 202 | {**********************}{$ENDREGION}{***************************************} 203 | {///////////////////////////////////////////////////////////////////////////} 204 | 205 | {///////////////////////////////////////////////////////////////////////////} 206 | {**********************}{$REGION '[ TPplDaCity ]'}{*************************} 207 | procedure TPplDaCity.BeforeInsert; 208 | begin 209 | inherited; 210 | Self.FldCallingCode.SetValue(Self.FldProvince.Value.FldCallingCode.Value); 211 | end; 212 | 213 | procedure TPplDaCity.EnumFields(const AEnumorator: TArEnumorator); 214 | begin 215 | inherited; 216 | AEnumorator.EnumField(TArObj(Self.FID), TArDbField, CCol_ID, CTbl_PplCity, [csNotNull, csPrimaryKey, csForeignKey], [ccNeeded]); 217 | AEnumorator.EnumField(TArObj(Self.FNumber), TArDbField, CCol_Number, CTbl_PplCity, [csAutoNumber], [ccReadOnly, ccNeeded]); 218 | AEnumorator.EnumField(TArObj(Self.FProvince), TArDbField, CCol_ProvinceID, CTbl_PplCity, [csForeignKey], [ccNeeded]); 219 | Self.FProvince.Captions := [CCol_NameAR, CCol_NameEN]; 220 | end; 221 | 222 | class function TPplDaCity.TableInfo_cls: TArTable; 223 | begin 224 | Result := CTbl_PplCity; 225 | end; 226 | {**********************}{$ENDREGION}{***************************************} 227 | {///////////////////////////////////////////////////////////////////////////} 228 | end. 229 | -------------------------------------------------------------------------------- /Design/ArEdit.pas: -------------------------------------------------------------------------------- 1 | unit ArEdit; 2 | 3 | interface 4 | 5 | uses 6 | Vcl.Dialogs, System.SysUtils, System.Classes, Vcl.Controls, Vcl.StdCtrls, Vcl.ExtCtrls, 7 | Vcl.WinXCtrls, Vcl.Grids, Vcl.Graphics, WinAPI.Messages, ArOrm.Obj.Info, ArOrm.Da.Base; 8 | 9 | type 10 | {///////////////////////////////////////////////////////////////////////////} 11 | {**********************}{$REGION '[ TDaEntity ]'}{**************************} 12 | TArDaEntity = class(TComponent) 13 | private 14 | FDataAccess: TArContainerBase; 15 | function GetDataAccess: TArContainerBase; 16 | procedure SetDataAccess(const AValue:TArContainerBase); 17 | public 18 | constructor Create(AOwner: TComponent); override; 19 | procedure EnumDataAccess(const AClassType:TArObjClass); 20 | published 21 | property DataAccess: TArContainerBase read GetDataAccess write SetDataAccess; 22 | end; 23 | {**********************}{$ENDREGION}{***************************************} 24 | {///////////////////////////////////////////////////////////////////////////} 25 | 26 | {///////////////////////////////////////////////////////////////////////////} 27 | {**********************}{$REGION '[ TStrEdit ]'}{***************************} 28 | TArStrEdit = class(TLabeledEdit) 29 | private 30 | FLoadCaption: Boolean; 31 | FDaEntity: TArDaEntity; 32 | FDaField: TArDbStrField; 33 | function GetLabelVisible: Boolean; 34 | function GetLabelCaption: string; 35 | procedure SetLabelVisble(const AValue:Boolean); 36 | procedure SetLabelCaption(const AValue:string); 37 | function GetCaption: string; 38 | procedure SetCaption(const AValue:string); 39 | protected 40 | procedure DoExit; override; 41 | procedure LoadValue(ASender:TObject;const APutFlag:TArPutFlags); 42 | procedure OnChange(const APutInfo:TArPutInfo); 43 | public 44 | constructor Create(AOwner: TComponent); override; 45 | procedure EnumField(const AField:TArDbStrField); 46 | published 47 | property DaEntity: TArDaEntity read FDaEntity write FDaEntity; 48 | property DaField: TArDbStrField read FDaField write FDaField; 49 | property LabelVisible: Boolean read GetLabelVisible write SetLabelVisble; 50 | property LabelCaption: string read GetLabelCaption write SetLabelCaption; 51 | property LoadCaption: Boolean read FLoadCaption write FLoadCaption; 52 | property Caption: string read GetCaption write SetCaption; 53 | end; 54 | {**********************}{$ENDREGION}{***************************************} 55 | {///////////////////////////////////////////////////////////////////////////} 56 | 57 | {///////////////////////////////////////////////////////////////////////////} 58 | {**********************}{$REGION '[ TIntEdit ]'}{***************************} 59 | TArIntEdit = class(TLabeledEdit) 60 | private 61 | FLoadCaption: Boolean; 62 | FDaEntity: TArDaEntity; 63 | FDaField: TArDbField; 64 | function GetLabelVisible: Boolean; 65 | function GetLabelCaption: string; 66 | procedure SetLabelVisble(const AValue:Boolean); 67 | procedure SetLabelCaption(const AValue:string); 68 | function GetCaption: string; 69 | procedure SetCaption(const AValue:string); 70 | protected 71 | procedure DoExit; override; 72 | procedure LoadValue(ASender:TObject;const AFlag:TArPutFlags); 73 | procedure OnChange(const APutInfo:TArPutInfo); 74 | public 75 | constructor Create(AOwner: TComponent); override; 76 | procedure EnumField(const AField:TArDbField); 77 | published 78 | property DaEntity: TArDaEntity read FDaEntity write FDaEntity; 79 | property DaField: TArDbField read FDaField write FDaField; 80 | property LabelVisible: Boolean read GetLabelVisible write SetLabelVisble; 81 | property LabelCaption: string read GetLabelCaption write SetLabelCaption; 82 | property LoadCaption: Boolean read FLoadCaption write FLoadCaption; 83 | property Caption: string read GetCaption write SetCaption; 84 | end; 85 | {**********************}{$ENDREGION}{***************************************} 86 | {///////////////////////////////////////////////////////////////////////////} 87 | 88 | {///////////////////////////////////////////////////////////////////////////} 89 | {**********************}{$REGION '[ TCustomSearchEdit ]'}{******************} 90 | TArCustomSearchEdit = class(TSearchBox) 91 | private 92 | FEditLabel: TBoundLabel; 93 | FLabelPosition: TLabelPosition; 94 | FLabelSpacing: Integer; 95 | procedure SetLabelPosition(const Value: TLabelPosition); 96 | procedure SetLabelSpacing(const Value: Integer); 97 | protected 98 | procedure SetParent(AParent: TWinControl); override; 99 | procedure Notification(AComponent: TComponent; Operation: TOperation); override; 100 | procedure SetName(const Value: TComponentName); override; 101 | procedure CMVisiblechanged(var Message: TMessage); 102 | message CM_VISIBLECHANGED; 103 | procedure CMEnabledchanged(var Message: TMessage); 104 | message CM_ENABLEDCHANGED; 105 | procedure CMBidimodechanged(var Message: TMessage); 106 | message CM_BIDIMODECHANGED; 107 | 108 | property EditLabel: TBoundLabel read FEditLabel; 109 | property LabelPosition: TLabelPosition read FLabelPosition write SetLabelPosition default lpAbove; 110 | property LabelSpacing: Integer read FLabelSpacing write SetLabelSpacing default 3; 111 | public 112 | { Public declarations } 113 | constructor Create(AOwner: TComponent); override; 114 | procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override; 115 | procedure SetupInternalLabel; 116 | end; 117 | {**********************}{$ENDREGION}{***************************************} 118 | {///////////////////////////////////////////////////////////////////////////} 119 | 120 | {///////////////////////////////////////////////////////////////////////////} 121 | {**********************}{$REGION '[ TSearchEdit ]'}{************************} 122 | TArSearchEdit = class(TArCustomSearchEdit) 123 | private 124 | FLoadCaption: Boolean; 125 | FDaEntity: TArDaEntity; 126 | FDaField: TArBasicField; 127 | FValue: TArContainerBase; 128 | FValueCaption: string; 129 | FValueCode: string; 130 | procedure SetCaption(const AValue:string); 131 | function GetCaption: string; 132 | 133 | protected 134 | procedure InvokeSearch; override; 135 | procedure DoExit; override; 136 | procedure LoadValue(ASender:TObject); 137 | procedure OnFieldChange(ASender:TObject;const AFlag:TArPutFlags); 138 | procedure OnChange(const APutInfo:TArPutInfo); 139 | public 140 | procedure EnumField(const AField:TArBasicField); 141 | constructor Create(AOwner: TComponent); override; 142 | destructor Destroy; override; 143 | 144 | property Value: TArContainerBase read FValue; 145 | published 146 | property EditLabel; 147 | property LabelPosition; 148 | property LabelSpacing; 149 | property LoadCaption: Boolean read FLoadCaption write FLoadCaption; 150 | property Caption: string read GetCaption write SetCaption; 151 | end; 152 | {**********************}{$ENDREGION}{***************************************} 153 | {///////////////////////////////////////////////////////////////////////////} 154 | 155 | procedure Register; 156 | 157 | implementation 158 | 159 | uses ArSearchDlg, System.Types; 160 | 161 | {///////////////////////////////////////////////////////////////////////////} 162 | {**********************}{$REGION '[ Register ]'}{***************************} 163 | procedure Register; 164 | begin 165 | RegisterComponents('ArOrm', [TArDaEntity]); 166 | RegisterComponents('ArOrm', [TArStrEdit]); 167 | RegisterComponents('ArOrm', [TArIntEdit]); 168 | RegisterComponents('ArOrm', [TArSearchEdit]); 169 | end; 170 | {**********************}{$ENDREGION}{***************************************} 171 | {///////////////////////////////////////////////////////////////////////////} 172 | 173 | {///////////////////////////////////////////////////////////////////////////} 174 | {**********************}{$REGION '[ TDaEntity ]'}{**************************} 175 | constructor TArDaEntity.Create(AOwner: TComponent); 176 | begin 177 | inherited; 178 | end; 179 | 180 | procedure TArDaEntity.EnumDataAccess(const AClassType: TArObjClass); 181 | var 182 | LContainer: TArObj; 183 | begin 184 | LContainer := AClassType.Create; 185 | Self.FDataAccess := TArContainerBase(LContainer); 186 | end; 187 | 188 | function TArDaEntity.GetDataAccess: TArContainerBase; 189 | begin 190 | Result := Self.FDataAccess; 191 | end; 192 | 193 | procedure TArDaEntity.SetDataAccess(const AValue: TArContainerBase); 194 | begin 195 | Self.FDataAccess := AValue; 196 | end; 197 | {**********************}{$ENDREGION}{***************************************} 198 | {///////////////////////////////////////////////////////////////////////////} 199 | 200 | {///////////////////////////////////////////////////////////////////////////} 201 | {**********************}{$REGION '[ TStrEdit ]'}{***************************} 202 | constructor TArStrEdit.Create(AOwner: TComponent); 203 | begin 204 | inherited; 205 | Self.LabelPosition := lpRight; 206 | Self.Name := 'Edt'; 207 | Self.FLoadCaption := True; 208 | end; 209 | 210 | procedure TArStrEdit.DoExit; 211 | begin 212 | inherited; 213 | if Self.FDaField <> nil then 214 | begin 215 | if Self.FDaField.Value <> Self.Text then 216 | begin 217 | if System.Length(Self.Text) = 0 then 218 | begin 219 | if Self.FDaField.IsNotNull then 220 | Self.FDaField.SetIsNull(True, [pfByEditor]) 221 | end 222 | else Self.FDaField.SetValue(Self.Text, [pfByEditor]); 223 | end; 224 | end; 225 | end; 226 | 227 | procedure TArStrEdit.EnumField(const AField: TArDbStrField); 228 | begin 229 | Self.FDaField := AField; 230 | if Self.FDaField <> nil then 231 | begin 232 | Self.FDaField.AddCondetions([ccNeeded]); 233 | // Self.FDaField.OnChange.Add(Self.LoadValue); 234 | Self.FDaField.EventsManager.AddToDoAfterChange(OnChange); 235 | if Self.FLoadCaption then 236 | Self.EditLabel.Caption := Self.FDaField.ColInfo.Caption_AR; 237 | end; 238 | end; 239 | 240 | function TArStrEdit.GetCaption: string; 241 | begin 242 | Result := Self.EditLabel.Caption; 243 | end; 244 | 245 | function TArStrEdit.GetLabelCaption: string; 246 | begin 247 | Result := Self.EditLabel.Caption; 248 | end; 249 | 250 | procedure TArStrEdit.SetCaption(const AValue: string); 251 | begin 252 | Self.EditLabel.Caption := AValue; 253 | end; 254 | 255 | procedure TArStrEdit.SetLabelCaption(const AValue: string); 256 | begin 257 | Self.EditLabel.Caption := AValue; 258 | end; 259 | 260 | function TArStrEdit.GetLabelVisible: Boolean; 261 | begin 262 | Result := Self.EditLabel.Visible; 263 | end; 264 | 265 | procedure TArStrEdit.SetLabelVisble(const AValue: Boolean); 266 | begin 267 | Self.EditLabel.Visible := AValue; 268 | end; 269 | 270 | procedure TArStrEdit.LoadValue; 271 | begin 272 | if Self.FDaField = nil then Exit; 273 | if Self.FDaField.IsNull then Self.Text := '' 274 | else Self.Text := Self.FDaField.Value; 275 | end; 276 | 277 | procedure TArStrEdit.OnChange(const APutInfo:TArPutInfo); 278 | begin 279 | if Self.FDaField.IsNotNull then Self.Text := APutInfo.NewValue 280 | else Self.Text := ''; 281 | end; 282 | 283 | {**********************}{$ENDREGION}{***************************************} 284 | {///////////////////////////////////////////////////////////////////////////} 285 | 286 | {///////////////////////////////////////////////////////////////////////////} 287 | {**********************}{$REGION '[ TIntEdit ]'}{***************************} 288 | constructor TArIntEdit.Create(AOwner: TComponent); 289 | begin 290 | inherited; 291 | Self.LabelPosition := lpRight; 292 | Self.Name := 'EdtN'; 293 | Self.FLoadCaption := True; 294 | end; 295 | 296 | procedure TArIntEdit.DoExit; 297 | begin 298 | inherited; 299 | if Self.FDaField <> nil then 300 | begin 301 | if Self.FDaField.Value <> StrToInt(Self.Text) then 302 | begin 303 | if System.Length(Self.Text) = 0 then 304 | begin 305 | if Self.FDaField.IsNotNull then 306 | Self.FDaField.SetIsNull(True, [pfByEditor]) 307 | end 308 | else Self.FDaField.SetValue(StrToInt(Self.Text), [pfByEditor]); 309 | end; 310 | end; 311 | end; 312 | 313 | procedure TArIntEdit.EnumField(const AField: TArDbField); 314 | begin 315 | Self.FDaField := AField; 316 | if Self.FDaField <> nil then 317 | begin 318 | Self.FDaField.AddCondetions([ccNeeded]); 319 | Self.FDaField.EventsManager.AddToDoAfterChange(OnChange); 320 | if Self.FLoadCaption then 321 | Self.EditLabel.Caption := Self.FDaField.ColInfo.Caption_AR; 322 | end; 323 | end; 324 | 325 | function TArIntEdit.GetCaption: string; 326 | begin 327 | Result := Self.EditLabel.Caption; 328 | end; 329 | 330 | function TArIntEdit.GetLabelCaption: string; 331 | begin 332 | Result := Self.EditLabel.Caption; 333 | end; 334 | 335 | procedure TArIntEdit.SetCaption(const AValue:string); 336 | begin 337 | Self.EditLabel.Caption := AValue; 338 | end; 339 | 340 | procedure TArIntEdit.SetLabelCaption(const AValue: string); 341 | begin 342 | Self.EditLabel.Caption := AValue; 343 | end; 344 | 345 | function TArIntEdit.GetLabelVisible: Boolean; 346 | begin 347 | Result := Self.EditLabel.Visible; 348 | end; 349 | 350 | procedure TArIntEdit.SetLabelVisble(const AValue: Boolean); 351 | begin 352 | Self.EditLabel.Visible := AValue; 353 | end; 354 | 355 | procedure TArIntEdit.LoadValue; 356 | begin 357 | if Self.FDaField = nil then Exit; 358 | if Self.FDaField.IsNull then Self.Text := '' 359 | else Self.Text := Self.FDaField.Value.ToString; 360 | end; 361 | procedure TArIntEdit.OnChange(const APutInfo:TArPutInfo); 362 | begin 363 | if Self.FDaField.IsNotNull then Self.Text := IntToStr(APutInfo.NewValue) 364 | else Self.Text := ''; 365 | end; 366 | 367 | {**********************}{$ENDREGION}{***************************************} 368 | {///////////////////////////////////////////////////////////////////////////} 369 | 370 | {///////////////////////////////////////////////////////////////////////////} 371 | {**********************}{$REGION '[ TCustomSearchEdit ]'}{******************} 372 | procedure TArCustomSearchEdit.CMBidimodechanged(var Message: TMessage); 373 | begin 374 | inherited; 375 | if FEditLabel <> nil then 376 | FEditLabel.BiDiMode := BiDiMode; 377 | end; 378 | 379 | procedure TArCustomSearchEdit.CMEnabledchanged(var Message: TMessage); 380 | begin 381 | inherited; 382 | if FEditLabel <> nil then 383 | FEditLabel.Enabled := Enabled; 384 | end; 385 | 386 | procedure TArCustomSearchEdit.CMVisiblechanged(var Message: TMessage); 387 | begin 388 | inherited; 389 | if FEditLabel <> nil then 390 | FEditLabel.Visible := Visible; 391 | end; 392 | 393 | constructor TArCustomSearchEdit.Create(AOwner: TComponent); 394 | begin 395 | inherited Create(AOwner); 396 | FLabelPosition := lpAbove; 397 | FLabelSpacing := 3; 398 | SetupInternalLabel; 399 | end; 400 | 401 | procedure TArCustomSearchEdit.Notification(AComponent: TComponent; 402 | Operation: TOperation); 403 | begin 404 | inherited Notification(AComponent, Operation); 405 | if (AComponent = FEditLabel) and (Operation = opRemove) then 406 | FEditLabel := nil; 407 | end; 408 | 409 | procedure TArCustomSearchEdit.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); 410 | begin 411 | inherited SetBounds(ALeft, ATop, AWidth, AHeight); 412 | SetLabelPosition(FLabelPosition); 413 | end; 414 | 415 | function AdjustedAlignment(RightToLeftAlignment: Boolean; Alignment: TAlignment): TAlignment; 416 | begin 417 | Result := Alignment; 418 | if RightToLeftAlignment then 419 | case Result of 420 | taLeftJustify: Result := taRightJustify; 421 | taRightJustify: Result := taLeftJustify; 422 | end; 423 | end; 424 | 425 | procedure TArCustomSearchEdit.SetLabelPosition(const Value: TLabelPosition); 426 | var 427 | P: TPoint; 428 | begin 429 | if FEditLabel = nil then Exit; 430 | FLabelPosition := Value; 431 | case Value of 432 | lpAbove: 433 | case AdjustedAlignment(UseRightToLeftAlignment, Alignment) of 434 | taLeftJustify: P := Point(Left, Top - FEditLabel.Height - FLabelSpacing); 435 | taRightJustify: P := Point(Left + Width - FEditLabel.Width, 436 | Top - FEditLabel.Height - FLabelSpacing); 437 | taCenter: P := Point(Left + (Width - FEditLabel.Width) div 2, 438 | Top - FEditLabel.Height - FLabelSpacing); 439 | end; 440 | lpBelow: 441 | case AdjustedAlignment(UseRightToLeftAlignment, Alignment) of 442 | taLeftJustify: P := Point(Left, Top + Height + FLabelSpacing); 443 | taRightJustify: P := Point(Left + Width - FEditLabel.Width, 444 | Top + Height + FLabelSpacing); 445 | taCenter: P := Point(Left + (Width - FEditLabel.Width) div 2, 446 | Top + Height + FLabelSpacing); 447 | end; 448 | lpLeft : P := Point(Left - FEditLabel.Width - FLabelSpacing, 449 | Top + ((Height - FEditLabel.Height) div 2)); 450 | lpRight: P := Point(Left + Width + FLabelSpacing, 451 | Top + ((Height - FEditLabel.Height) div 2)); 452 | end; 453 | FEditLabel.SetBounds(P.x, P.y, FEditLabel.Width, FEditLabel.Height); 454 | end; 455 | 456 | procedure TArCustomSearchEdit.SetLabelSpacing(const Value: Integer); 457 | begin 458 | FLabelSpacing := Value; 459 | SetLabelPosition(FLabelPosition); 460 | end; 461 | 462 | procedure TArCustomSearchEdit.SetName(const Value: TComponentName); 463 | var 464 | LClearText: Boolean; 465 | begin 466 | if (csDesigning in ComponentState) and (FEditLabel <> nil) and 467 | ((FEditlabel.GetTextLen = 0) or 468 | (CompareText(FEditLabel.Caption, Name) = 0)) then 469 | FEditLabel.Caption := Value; 470 | LClearText := (csDesigning in ComponentState) and (Text = ''); 471 | inherited SetName(Value); 472 | if LClearText then 473 | Text := ''; 474 | end; 475 | 476 | procedure TArCustomSearchEdit.SetParent(AParent: TWinControl); 477 | begin 478 | inherited SetParent(AParent); 479 | if FEditLabel = nil then exit; 480 | FEditLabel.Parent := AParent; 481 | FEditLabel.Visible := True; 482 | end; 483 | 484 | procedure TArCustomSearchEdit.SetupInternalLabel; 485 | begin 486 | if Assigned(FEditLabel) then exit; 487 | FEditLabel := TBoundLabel.Create(Self); 488 | FEditLabel.FreeNotification(Self); 489 | // FEditLabel.FocusControl := Self; 490 | end; 491 | 492 | {**********************}{$ENDREGION}{***************************************} 493 | {///////////////////////////////////////////////////////////////////////////} 494 | 495 | {///////////////////////////////////////////////////////////////////////////} 496 | {**********************}{$REGION '[ TSearchEdit ]'}{************************} 497 | constructor TArSearchEdit.Create(AOwner: TComponent); 498 | begin 499 | inherited Create(AOwner); 500 | Self.LabelPosition := lpRight; 501 | Self.Name := 'EdtS'; 502 | Self.FLoadCaption := True; 503 | end; 504 | 505 | destructor TArSearchEdit.Destroy; 506 | begin 507 | inherited; 508 | end; 509 | 510 | procedure TArSearchEdit.DoExit; 511 | begin 512 | inherited; 513 | if Self.Text= '' then Exit; 514 | if (Self.Text <> Self.FValueCode + ' - ' + Self.FValueCaption) or 515 | ((Self.Text = Self.FValueCode + ' - ' + Self.FValueCaption) and (Self.FValueCaption = '')) then 516 | begin 517 | Self.InvokeSearch; 518 | Abort; 519 | end; 520 | end; 521 | 522 | //procedure TArSearchEdit.DrawButton(Canvas: TCanvas); 523 | //begin 524 | // inherited; 525 | // 526 | //end; 527 | 528 | procedure TArSearchEdit.EnumField(const AField: TArBasicField); 529 | begin 530 | Self.FDaField := AField; 531 | if Self.FDaField <> nil then 532 | begin 533 | Self.FDaField.AddCondetions([ccNeeded]); 534 | TArDbField(Self.FDaField).EventsManager.AddToDoAfterChange(OnChange); 535 | if Self.FLoadCaption then 536 | Self.EditLabel.Caption := Self.FDaField.ColInfo.Caption_AR; 537 | end; 538 | end; 539 | 540 | function TArSearchEdit.GetCaption: string; 541 | begin 542 | Result := Self.EditLabel.Caption; 543 | end; 544 | 545 | procedure TArSearchEdit.InvokeSearch; 546 | var 547 | I: Integer; 548 | LSearchDlg: TArSearchDialog; 549 | LCode, LCaption: string; 550 | begin 551 | inherited; 552 | if Self.Text = Self.FValueCode + ' - ' + Self.FValueCaption then LCaption := Self.FValueCaption 553 | else LCaption := Self.Text; 554 | LSearchDlg := TArSearchDialog.Create(Self, Self.FDaEntity, Self.FDaField, LCaption); 555 | LCaption := ''; 556 | if LSearchDlg.ShowModal = mrOk then 557 | begin 558 | Self.FValue := LSearchDlg.SearchResult; 559 | // Self.FValue := TArDbField(Self.FDaField).Value; 560 | if Self.FValue <> nil then 561 | begin 562 | TArDbField(Self.FDaField).SetValue(Self.FValue); 563 | for I := 0 to Self.FValue.Fields.Count - 1 do 564 | begin 565 | if Self.FValue.Fields.Item(I).ColSettings * [csAutoCode] <> [] then 566 | LCode := Self.FValue.Fields.Item(I).DaToString 567 | else 568 | if Self.FValue.Fields.Item(I).ColSettings * [csCaption] <> [] then 569 | if LCaption = '' then LCaption := Self.FValue.Fields.Item(I).DaToString; 570 | end; 571 | Self.FValueCaption := LCaption; 572 | Self.FValueCode := LCode; 573 | Self.Text := LCode + ' - ' + LCaption; 574 | end; 575 | end; 576 | end; 577 | procedure TArSearchEdit.LoadValue(ASender: TObject); 578 | begin 579 | 580 | end; 581 | 582 | procedure TArSearchEdit.OnChange(const APutInfo:TArPutInfo); 583 | var 584 | I: Integer; 585 | LCode, LCaption: string; 586 | begin 587 | if not APutInfo.WillBeNull then 588 | begin 589 | if APutInfo.NewValue <> nil then 590 | begin 591 | Self.FValue := APutInfo.NewValue; 592 | if Self.FValue <> nil then 593 | begin 594 | for I := 0 to Self.FValue.Fields.Count - 1 do 595 | begin 596 | if Self.FValue.Fields.Item(I).ColSettings * [csAutoCode] <> [] then 597 | LCode := Self.FValue.Fields.Item(I).DaToString 598 | else 599 | if Self.FValue.Fields.Item(I).ColSettings * [csCaption] <> [] then 600 | if LCaption = '' then LCaption := Self.FValue.Fields.Item(I).DaToString; 601 | end; 602 | Self.FValueCaption := LCaption; 603 | Self.FValueCode := LCode; 604 | Self.Text := LCode + ' - ' + LCaption; 605 | end 606 | else Self.Text := ''; 607 | end 608 | else 609 | begin 610 | Self.FValue := nil; 611 | Self.Text := ''; 612 | end; 613 | end 614 | else 615 | begin 616 | Self.FValue := nil; 617 | Self.Text := ''; 618 | end; 619 | end; 620 | 621 | procedure TArSearchEdit.OnFieldChange(ASender: TObject;const AFlag:TArPutFlags); 622 | var 623 | I: Integer; 624 | LCode, LCaption: string; 625 | begin 626 | if Self.FDaField.IsNull then Self.FValue := nil 627 | else Self.FValue := TArDbField(Self.FDaField).Value; 628 | if Self.FValue <> nil then 629 | begin 630 | for I := 0 to Self.FValue.Fields.Count - 1 do 631 | begin 632 | if Self.FValue.Fields.Item(I).ColSettings * [csAutoCode] <> [] then 633 | LCode := Self.FValue.Fields.Item(I).DaToString 634 | else 635 | if Self.FValue.Fields.Item(I).ColSettings * [csCaption] <> [] then 636 | if LCaption = '' then LCaption := Self.FValue.Fields.Item(I).DaToString; 637 | end; 638 | Self.FValueCaption := LCaption; 639 | Self.FValueCode := LCode; 640 | Self.Text := LCode + ' - ' + LCaption; 641 | end 642 | else Self.Text := ''; 643 | end; 644 | 645 | procedure TArSearchEdit.SetCaption(const AValue: string); 646 | begin 647 | Self.EditLabel.Caption := AValue; 648 | end; 649 | 650 | {**********************}{$ENDREGION}{***************************************} 651 | {///////////////////////////////////////////////////////////////////////////} 652 | end. 653 | -------------------------------------------------------------------------------- /Design/ArOrm.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {9E2B38CF-3B4E-4658-8F77-7FF467B8DAD8} 4 | ArOrm.dpk 5 | 18.2 6 | VCL 7 | True 8 | Debug 9 | Win32 10 | 1 11 | Package 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Cfg_1 29 | true 30 | true 31 | 32 | 33 | true 34 | Base 35 | true 36 | 37 | 38 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) 39 | true 40 | true 41 | All 42 | ArOrm 43 | .\$(Platform)\$(Config) 44 | .\$(Platform)\$(Config) 45 | false 46 | false 47 | false 48 | false 49 | false 50 | 51 | 52 | vcl;rtl;dbrtl;vclwinx;adortl;xmlrtl;vclactnband;vclx;vclimg;vcldb;VclSmp;$(DCC_UsePackage) 53 | 1033 54 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 55 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 56 | true 57 | Debug 58 | 59 | 60 | DEBUG;$(DCC_Define) 61 | true 62 | false 63 | true 64 | true 65 | true 66 | 67 | 68 | false 69 | 70 | 71 | false 72 | RELEASE;$(DCC_Define) 73 | 0 74 | 0 75 | 76 | 77 | 78 | MainSource 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
ArSearchDialog
98 | dfm 99 |
100 | 101 | 102 | 103 | Cfg_2 104 | Base 105 | 106 | 107 | Base 108 | 109 | 110 | Cfg_1 111 | Base 112 | 113 |
114 | 115 | Delphi.Personality.12 116 | Package 117 | 118 | 119 | 120 | ArOrm.dpk 121 | 122 | 123 | 124 | 125 | 126 | ArOrm.bpl 127 | true 128 | 129 | 130 | 131 | 132 | 0 133 | .dll;.bpl 134 | 135 | 136 | 1 137 | .dylib 138 | 139 | 140 | 141 | 142 | Contents\Resources 143 | 1 144 | 145 | 146 | 147 | 148 | classes 149 | 1 150 | 151 | 152 | 153 | 154 | Contents\MacOS 155 | 0 156 | 157 | 158 | 1 159 | 160 | 161 | 162 | 163 | 1 164 | 165 | 166 | 1 167 | 168 | 169 | 1 170 | 171 | 172 | 173 | 174 | res\drawable-xxhdpi 175 | 1 176 | 177 | 178 | 179 | 180 | library\lib\mips 181 | 1 182 | 183 | 184 | 185 | 186 | 1 187 | 188 | 189 | 1 190 | 191 | 192 | 0 193 | 194 | 195 | 1 196 | 197 | 198 | 1 199 | 200 | 201 | library\lib\armeabi-v7a 202 | 1 203 | 204 | 205 | 1 206 | 207 | 208 | 209 | 210 | 0 211 | 212 | 213 | 1 214 | .framework 215 | 216 | 217 | 218 | 219 | 1 220 | 221 | 222 | 1 223 | 224 | 225 | 226 | 227 | 1 228 | 229 | 230 | 1 231 | 232 | 233 | 1 234 | 235 | 236 | 237 | 238 | 1 239 | 240 | 241 | 1 242 | 243 | 244 | 1 245 | 246 | 247 | 248 | 249 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 250 | 1 251 | 252 | 253 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 254 | 1 255 | 256 | 257 | 258 | 259 | 1 260 | 261 | 262 | 1 263 | 264 | 265 | 1 266 | 267 | 268 | 269 | 270 | 271 | library\lib\armeabi 272 | 1 273 | 274 | 275 | 276 | 277 | 0 278 | 279 | 280 | 1 281 | 282 | 283 | 1 284 | 285 | 286 | 287 | 288 | 1 289 | 290 | 291 | 1 292 | 293 | 294 | 1 295 | 296 | 297 | 298 | 299 | res\drawable-normal 300 | 1 301 | 302 | 303 | 304 | 305 | res\drawable-xhdpi 306 | 1 307 | 308 | 309 | 310 | 311 | res\drawable-large 312 | 1 313 | 314 | 315 | 316 | 317 | 1 318 | 319 | 320 | 1 321 | 322 | 323 | 1 324 | 325 | 326 | 327 | 328 | Assets 329 | 1 330 | 331 | 332 | Assets 333 | 1 334 | 335 | 336 | 337 | 338 | 339 | res\drawable-hdpi 340 | 1 341 | 342 | 343 | 344 | 345 | library\lib\armeabi-v7a 346 | 1 347 | 348 | 349 | 350 | 351 | 352 | 353 | Assets 354 | 1 355 | 356 | 357 | Assets 358 | 1 359 | 360 | 361 | 362 | 363 | 1 364 | 365 | 366 | 1 367 | 368 | 369 | 1 370 | 371 | 372 | 373 | 374 | res\values 375 | 1 376 | 377 | 378 | 379 | 380 | res\drawable-small 381 | 1 382 | 383 | 384 | 385 | 386 | res\drawable 387 | 1 388 | 389 | 390 | 391 | 392 | 1 393 | 394 | 395 | 1 396 | 397 | 398 | 1 399 | 400 | 401 | 402 | 403 | 1 404 | 405 | 406 | 407 | 408 | res\drawable 409 | 1 410 | 411 | 412 | 413 | 414 | 0 415 | 416 | 417 | 0 418 | 419 | 420 | 0 421 | 422 | 423 | 0 424 | 425 | 426 | 0 427 | 428 | 429 | 0 430 | 431 | 432 | 433 | 434 | library\lib\armeabi-v7a 435 | 1 436 | 437 | 438 | 439 | 440 | 0 441 | .bpl 442 | 443 | 444 | 1 445 | .dylib 446 | 447 | 448 | 1 449 | .dylib 450 | 451 | 452 | 1 453 | .dylib 454 | 455 | 456 | 1 457 | .dylib 458 | 459 | 460 | 461 | 462 | res\drawable-mdpi 463 | 1 464 | 465 | 466 | 467 | 468 | res\drawable-xlarge 469 | 1 470 | 471 | 472 | 473 | 474 | res\drawable-ldpi 475 | 1 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | True 490 | 491 | 492 | 12 493 | 494 | 495 | 496 | 497 |
498 | -------------------------------------------------------------------------------- /Example/MainApp.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {7CA77C27-0A01-4E4F-B21C-074E6CA52F66} 4 | 18.5 5 | VCL 6 | MainApp.dpr 7 | True 8 | Debug 9 | Win32 10 | 1 11 | Application 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Cfg_1 29 | true 30 | true 31 | 32 | 33 | true 34 | Base 35 | true 36 | 37 | 38 | true 39 | Cfg_2 40 | true 41 | true 42 | 43 | 44 | Light|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Light.vsf;"Windows10 SlateGray|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10SlateGray.vsf" 45 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 46 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) 47 | MainApp 48 | $(BDS)\bin\delphi_PROJECTICON.ico 49 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 50 | .\$(Platform)\$(Config) 51 | .\$(Platform)\$(Config) 52 | false 53 | false 54 | false 55 | false 56 | false 57 | 58 | 59 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 60 | DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;FireDACIBDriver;fmx;fmxdae;frx24;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;DbxClientDriver;DBXSybaseASADriver;frxTee24;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;frxe24;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;frxDB24;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) 61 | true 62 | $(BDS)\bin\default_app.manifest 63 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 64 | Debug 65 | 1033 66 | 67 | 68 | DEBUG;$(DCC_Define) 69 | true 70 | false 71 | true 72 | true 73 | true 74 | 75 | 76 | 1033 77 | true 78 | true 79 | false 80 | PerMonitor 81 | 82 | 83 | false 84 | RELEASE;$(DCC_Define) 85 | 0 86 | 0 87 | 88 | 89 | true 90 | PerMonitor 91 | 92 | 93 | 94 | MainSource 95 | 96 | 97 |
MainForm
98 |
99 | 100 | 101 | 102 |
MainCard
103 |
104 | 105 |
PplCaCountry
106 |
107 | 108 |
PplCaProvince
109 |
110 | 111 |
PplCaCity
112 |
113 | 114 | 115 |
PplCaContact
116 |
117 | 118 |
PplCaPerson
119 |
120 | 121 |
PplCaCompany
122 |
123 | 124 | 125 | Cfg_2 126 | Base 127 | 128 | 129 | Base 130 | 131 | 132 | Cfg_1 133 | Base 134 | 135 |
136 | 137 | Delphi.Personality.12 138 | Application 139 | 140 | 141 | 142 | MainApp.dpr 143 | 144 | 145 | Microsoft Office 2000 Sample Automation Server Wrapper Components 146 | Microsoft Office XP Sample Automation Server Wrapper Components 147 | 148 | 149 | 150 | 151 | 152 | MainApp.exe 153 | true 154 | 155 | 156 | 157 | 158 | 1 159 | 160 | 161 | Contents\MacOS 162 | 1 163 | 164 | 165 | 0 166 | 167 | 168 | 169 | 170 | classes 171 | 1 172 | 173 | 174 | 175 | 176 | res\xml 177 | 1 178 | 179 | 180 | 181 | 182 | library\lib\armeabi-v7a 183 | 1 184 | 185 | 186 | 187 | 188 | library\lib\armeabi 189 | 1 190 | 191 | 192 | 193 | 194 | library\lib\mips 195 | 1 196 | 197 | 198 | 199 | 200 | library\lib\armeabi-v7a 201 | 1 202 | 203 | 204 | 205 | 206 | res\drawable 207 | 1 208 | 209 | 210 | 211 | 212 | res\values 213 | 1 214 | 215 | 216 | 217 | 218 | res\values-v21 219 | 1 220 | 221 | 222 | 223 | 224 | res\drawable 225 | 1 226 | 227 | 228 | 229 | 230 | res\drawable-xxhdpi 231 | 1 232 | 233 | 234 | 235 | 236 | res\drawable-ldpi 237 | 1 238 | 239 | 240 | 241 | 242 | res\drawable-mdpi 243 | 1 244 | 245 | 246 | 247 | 248 | res\drawable-hdpi 249 | 1 250 | 251 | 252 | 253 | 254 | res\drawable-xhdpi 255 | 1 256 | 257 | 258 | 259 | 260 | res\drawable-small 261 | 1 262 | 263 | 264 | 265 | 266 | res\drawable-normal 267 | 1 268 | 269 | 270 | 271 | 272 | res\drawable-large 273 | 1 274 | 275 | 276 | 277 | 278 | res\drawable-xlarge 279 | 1 280 | 281 | 282 | 283 | 284 | 1 285 | 286 | 287 | Contents\MacOS 288 | 1 289 | 290 | 291 | 0 292 | 293 | 294 | 295 | 296 | Contents\MacOS 297 | 1 298 | .framework 299 | 300 | 301 | Contents\MacOS 302 | 1 303 | .framework 304 | 305 | 306 | 0 307 | 308 | 309 | 310 | 311 | 1 312 | .dylib 313 | 314 | 315 | 1 316 | .dylib 317 | 318 | 319 | 1 320 | .dylib 321 | 322 | 323 | Contents\MacOS 324 | 1 325 | .dylib 326 | 327 | 328 | Contents\MacOS 329 | 1 330 | .dylib 331 | 332 | 333 | 0 334 | .dll;.bpl 335 | 336 | 337 | 338 | 339 | 1 340 | .dylib 341 | 342 | 343 | 1 344 | .dylib 345 | 346 | 347 | 1 348 | .dylib 349 | 350 | 351 | Contents\MacOS 352 | 1 353 | .dylib 354 | 355 | 356 | Contents\MacOS 357 | 1 358 | .dylib 359 | 360 | 361 | 0 362 | .bpl 363 | 364 | 365 | 366 | 367 | 0 368 | 369 | 370 | 0 371 | 372 | 373 | 0 374 | 375 | 376 | 0 377 | 378 | 379 | Contents\Resources\StartUp\ 380 | 0 381 | 382 | 383 | Contents\Resources\StartUp\ 384 | 0 385 | 386 | 387 | 0 388 | 389 | 390 | 391 | 392 | 1 393 | 394 | 395 | 1 396 | 397 | 398 | 1 399 | 400 | 401 | 402 | 403 | 1 404 | 405 | 406 | 1 407 | 408 | 409 | 1 410 | 411 | 412 | 413 | 414 | 1 415 | 416 | 417 | 1 418 | 419 | 420 | 1 421 | 422 | 423 | 424 | 425 | 1 426 | 427 | 428 | 1 429 | 430 | 431 | 1 432 | 433 | 434 | 435 | 436 | 1 437 | 438 | 439 | 1 440 | 441 | 442 | 1 443 | 444 | 445 | 446 | 447 | 1 448 | 449 | 450 | 1 451 | 452 | 453 | 1 454 | 455 | 456 | 457 | 458 | 1 459 | 460 | 461 | 1 462 | 463 | 464 | 1 465 | 466 | 467 | 468 | 469 | 1 470 | 471 | 472 | 473 | 474 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 475 | 1 476 | 477 | 478 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 479 | 1 480 | 481 | 482 | 483 | 484 | 1 485 | 486 | 487 | 1 488 | 489 | 490 | 491 | 492 | ..\ 493 | 1 494 | 495 | 496 | ..\ 497 | 1 498 | 499 | 500 | 501 | 502 | 1 503 | 504 | 505 | 1 506 | 507 | 508 | 1 509 | 510 | 511 | 512 | 513 | 1 514 | 515 | 516 | 1 517 | 518 | 519 | 1 520 | 521 | 522 | 523 | 524 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 525 | 1 526 | 527 | 528 | 529 | 530 | ..\ 531 | 1 532 | 533 | 534 | ..\ 535 | 1 536 | 537 | 538 | 539 | 540 | Contents 541 | 1 542 | 543 | 544 | Contents 545 | 1 546 | 547 | 548 | 549 | 550 | Contents\Resources 551 | 1 552 | 553 | 554 | Contents\Resources 555 | 1 556 | 557 | 558 | 559 | 560 | library\lib\armeabi-v7a 561 | 1 562 | 563 | 564 | 1 565 | 566 | 567 | 1 568 | 569 | 570 | 1 571 | 572 | 573 | 1 574 | 575 | 576 | Contents\MacOS 577 | 1 578 | 579 | 580 | Contents\MacOS 581 | 1 582 | 583 | 584 | 0 585 | 586 | 587 | 588 | 589 | 1 590 | 591 | 592 | 1 593 | 594 | 595 | 596 | 597 | Assets 598 | 1 599 | 600 | 601 | Assets 602 | 1 603 | 604 | 605 | 606 | 607 | Assets 608 | 1 609 | 610 | 611 | Assets 612 | 1 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | True 627 | 628 | 629 | 12 630 | 631 | 632 | 633 | 634 |
635 | --------------------------------------------------------------------------------