Changeset 31 for trunk/Forms
- Timestamp:
- Nov 25, 2021, 1:18:44 AM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r30 r31 1 1 object FormContact: TFormContact 2 2 Left = 604 3 Height = 5884 Top = 4295 Width = 91 43 Height = 656 4 Top = 361 5 Width = 915 6 6 Caption = 'Contact' 7 ClientHeight = 5888 ClientWidth = 91 47 ClientHeight = 656 8 ClientWidth = 915 9 9 DesignTimePPI = 144 10 10 OnClose = FormClose … … 14 14 object PageControlContact: TPageControl 15 15 Left = 10 16 Height = 5 0816 Height = 576 17 17 Top = 10 18 Width = 89 218 Width = 893 19 19 ActivePage = TabSheetAll 20 20 Anchors = [akTop, akLeft, akRight, akBottom] … … 24 24 object TabSheetGeneral: TTabSheet 25 25 Caption = 'General' 26 ClientHeight = 46827 ClientWidth = 88 226 ClientHeight = 536 27 ClientWidth = 883 28 28 ParentFont = False 29 29 object Label1: TLabel … … 113 113 end 114 114 object MemoNotes: TMemo 115 Left = 16116 Height = 146115 Left = 240 116 Height = 282 117 117 Top = 230 118 Width = 846118 Width = 623 119 119 Anchors = [akTop, akLeft, akRight, akBottom] 120 120 ParentFont = False 121 ParentShowHint = False 122 ScrollBars = ssAutoBoth 121 123 TabOrder = 5 122 124 end 123 125 object Label6: TLabel 124 Left = 19126 Left = 240 125 127 Height = 24 126 128 Top = 202 … … 181 183 ParentFont = False 182 184 end 185 object ImagePhoto: TImage 186 Left = 16 187 Height = 208 188 Top = 232 189 Width = 207 190 Proportional = True 191 Stretch = True 192 end 193 object Label23: TLabel 194 Left = 16 195 Height = 24 196 Top = 200 197 Width = 55 198 Caption = 'Photo:' 199 ParentColor = False 200 ParentFont = False 201 end 183 202 end 184 203 object TabSheetDetails: TTabSheet 185 204 Caption = 'Details' 186 ClientHeight = 468187 ClientWidth = 88 2205 ClientHeight = 536 206 ClientWidth = 883 188 207 ParentFont = False 189 208 object Label7: TLabel … … 428 447 object TabSheetAll: TTabSheet 429 448 Caption = 'All fields' 430 ClientHeight = 468431 ClientWidth = 88 2449 ClientHeight = 536 450 ClientWidth = 883 432 451 OnShow = TabSheetAllShow 433 452 ParentFont = False 434 453 object ListView1: TListView 435 454 Left = 10 436 Height = 441455 Height = 509 437 456 Top = 19 438 Width = 86 4457 Width = 865 439 458 Anchors = [akTop, akLeft, akRight, akBottom] 440 459 Columns = < 441 460 item 442 Caption = 'Item' 443 Width = 240 461 Caption = 'Name' 462 Width = 100 463 end 464 item 465 Caption = 'Attributes' 466 Width = 200 444 467 end 445 468 item 446 469 Caption = 'Value' 447 Width = 609470 Width = 550 448 471 end> 449 472 OwnerData = True … … 460 483 end 461 484 object ButtonCancel: TButton 462 Left = 78 7485 Left = 788 463 486 Height = 37 464 Top = 538487 Top = 606 465 488 Width = 115 466 489 Anchors = [akRight, akBottom] … … 471 494 end 472 495 object ButtonOk: TButton 473 Left = 65 2496 Left = 653 474 497 Height = 37 475 Top = 538498 Top = 606 476 499 Width = 119 477 500 Anchors = [akRight, akBottom] -
trunk/Forms/UFormContact.lrj
r21 r31 11 11 {"hash":166819690,"name":"tformcontact.label21.caption","sourcebytes":[69,45,109,97,105,108,32,40,87,111,114,107,41,58],"value":"E-mail (Work):"}, 12 12 {"hash":162456010,"name":"tformcontact.label22.caption","sourcebytes":[66,105,114,116,104,100,97,121,58],"value":"Birthday:"}, 13 {"hash":91188010,"name":"tformcontact.label23.caption","sourcebytes":[80,104,111,116,111,58],"value":"Photo:"}, 13 14 {"hash":181043315,"name":"tformcontact.tabsheetdetails.caption","sourcebytes":[68,101,116,97,105,108,115],"value":"Details"}, 14 15 {"hash":170160314,"name":"tformcontact.label7.caption","sourcebytes":[80,104,111,110,101,32,40,72,111,109,101,41,58],"value":"Phone (Home):"}, … … 27 28 {"hash":101155194,"name":"tformcontact.labelorganization.caption","sourcebytes":[79,114,103,97,110,105,122,97,116,105,111,110,58],"value":"Organization:"}, 28 29 {"hash":113983571,"name":"tformcontact.tabsheetall.caption","sourcebytes":[65,108,108,32,102,105,101,108,100,115],"value":"All fields"}, 29 {"hash":330429,"name":"tformcontact.listview1.columns[0].caption","sourcebytes":[73,116,101,109],"value":"Item"}, 30 {"hash":6063029,"name":"tformcontact.listview1.columns[1].caption","sourcebytes":[86,97,108,117,101],"value":"Value"}, 30 {"hash":346165,"name":"tformcontact.listview1.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"}, 31 {"hash":150815091,"name":"tformcontact.listview1.columns[1].caption","sourcebytes":[65,116,116,114,105,98,117,116,101,115],"value":"Attributes"}, 32 {"hash":6063029,"name":"tformcontact.listview1.columns[2].caption","sourcebytes":[86,97,108,117,101],"value":"Value"}, 31 33 {"hash":77089212,"name":"tformcontact.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}, 32 34 {"hash":1339,"name":"tformcontact.buttonok.caption","sourcebytes":[79,75],"value":"OK"}, -
trunk/Forms/UFormContact.pas
r29 r31 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ActnList, Menus, UContact;9 ComCtrls, ActnList, Menus, ExtCtrls, UContact, base64; 10 10 11 11 type … … 40 40 EditName: TEdit; 41 41 EditCellPhone: TEdit; 42 ImagePhoto: TImage; 42 43 Label1: TLabel; 43 44 Label10: TLabel; … … 55 56 Label21: TLabel; 56 57 Label22: TLabel; 58 Label23: TLabel; 57 59 LabelOrganization: TLabel; 58 60 Label3: TLabel; … … 110 112 procedure TFormContact.ListView1Data(Sender: TObject; Item: TListItem); 111 113 begin 112 if Item.Index < Contact.Parent.Fields.Count then 113 with TContactField(Contact.Parent.Fields[Item.Index]) do begin 114 Item.Caption := Name; 115 Item.SubItems.Add(Contact.Fields[Index]); 114 if Item.Index < Contact.Properties.Count then 115 with Contact.Properties[Item.Index] do begin 116 Item.Caption := Contact.Properties[Item.Index].Name; 117 Item.SubItems.Add(Attributes.DelimitedText); 118 Item.SubItems.Add(Contact.Properties[Item.Index].Values.DelimitedText); 119 Item.Data := Contact.Properties[Item.Index]; 116 120 end; 117 121 end; … … 125 129 begin 126 130 if Assigned(Contact) then begin 127 ListView1.Items.Count := Contact.P arent.Fields.Count;131 ListView1.Items.Count := Contact.Properties.Count; 128 132 end else ListView1.Items.Count := 0; 129 133 ListView1.Refresh; … … 139 143 begin 140 144 if Assigned(ListView1.Selected) then begin 141 Contact.Fields[TContactFieldIndex(ListView1.Selected.Index)]:=142 InputBox(SFieldEdit, SEditFieldValue, Contact.Fields[TContactFieldIndex(ListView1.Selected.Index)]);145 TContactProperty(ListView1.Selected.Data).Values.DelimitedText := 146 InputBox(SFieldEdit, SEditFieldValue, TContactProperty(ListView1.Selected.Data).Values.DelimitedText); 143 147 end; 144 148 end; … … 152 156 153 157 procedure TFormContact.LoadData(Contact: TContact); 158 var 159 Photo: string; 160 JpegImage: TJpegImage; 161 Stream: TMemoryStream; 162 PhotoProperty: TContactProperty; 154 163 begin 155 164 Self.Contact := Contact; 156 EditName.Text := Contact.FirstName; 157 EditSurname.Text := Contact.LastName; 158 EditCellPhone.Text := Contact.TelCell; 159 EditPhoneHome.Text := Contact.TelHome; 160 EditPhoneWork.Text := Contact.TelWork; 161 EditEmail.Text := Contact.EmailHome; 162 MemoNotes.Lines.Text := Contact.Note; 163 EditTitle.Text := Contact.Title; 164 EditOrganization.Text := Contact.Organization; 165 EditAddress.Text := Contact.AdrHome; 166 EditEmailHome.Text := Contact.EmailHome; 165 EditName.Text := Contact.Fields[cfFirstName]; 166 EditSurname.Text := Contact.Fields[cfLastName]; 167 EditCellPhone.Text := Contact.Fields[cfTelCell]; 168 EditPhoneHome.Text := Contact.Fields[cfTelHome]; 169 EditPhoneWork.Text := Contact.Fields[cfTelWork]; 170 EditEmail.Text := Contact.Fields[cfEmail]; 171 MemoNotes.Lines.Text := Contact.Fields[cfNote]; 172 EditTitle.Text := Contact.Fields[cfTitle]; 173 EditOrganization.Text := Contact.Fields[cfOrganization]; 174 EditAddress.Text := Contact.Fields[cfAdrHome]; 175 EditEmailHome.Text := Contact.Fields[cfEmailHome]; 176 177 ImagePhoto.Picture.Bitmap.Clear; 178 PhotoProperty := Contact.GetProperty(cfPhoto); 179 if Assigned(PhotoProperty) then begin 180 Photo := Contact.Fields[cfPhoto]; 181 if (Photo <> '') and (PhotoProperty.Encoding <> '') then begin 182 Photo := PhotoProperty.GetDecodedValue; 183 Stream := TMemoryStream.Create; 184 Stream.Write(Photo[1], Length(Photo)); 185 Stream.Position := 0; 186 JpegImage := TJPEGImage.Create; 187 JpegImage.LoadFromStream(Stream); 188 ImagePhoto.Picture.Bitmap.SetSize(JpegImage.Width, JpegImage.Height); 189 ImagePhoto.Picture.Bitmap.Canvas.Draw(0, 0, JpegImage); 190 JpegImage.Free; 191 Stream.Free; 192 end; 193 end; 167 194 end; 168 195 169 196 procedure TFormContact.SaveData(Contact: TContact); 170 197 begin 171 Contact.Fi rstName:= EditName.Text;172 Contact. LastName:= EditSurname.Text;173 Contact. TelCell:= EditCellPhone.Text;174 Contact. TelHome:= EditPhoneHome.Text;175 Contact. TelWork:= EditPhoneWork.Text;176 Contact. EmailHome:= EditEmail.Text;177 Contact. Note:= MemoNotes.Lines.Text;178 Contact. Title:= EditTitle.Text;179 Contact. Organization:= EditOrganization.Text;180 Contact. AdrHome:= EditAddress.Text;181 Contact. EmailHome:= EditEmailHome.Text;198 Contact.Fields[cfFirstName] := EditName.Text; 199 Contact.Fields[cfLastName] := EditSurname.Text; 200 Contact.Fields[cfTelCell] := EditCellPhone.Text; 201 Contact.Fields[cfTelHome] := EditPhoneHome.Text; 202 Contact.Fields[cfTelWork] := EditPhoneWork.Text; 203 Contact.Fields[cfEmail] := EditEmail.Text; 204 Contact.Fields[cfNote] := MemoNotes.Lines.Text; 205 Contact.Fields[cfTitle] := EditTitle.Text; 206 Contact.Fields[cfOrganization] := EditOrganization.Text; 207 Contact.Fields[cfAdrHome] := EditAddress.Text; 208 Contact.Fields[cfEmailHome] := EditEmailHome.Text; 182 209 end; 183 210 -
trunk/Forms/UFormContacts.pas
r29 r31 70 70 if Assigned(Contacts) and (Item.Index < Contacts.Count) then 71 71 with TContact(Contacts[Item.Index]) do begin 72 Item.Caption := F ullName;73 Item.SubItems.Add(Fi rstName);74 Item.SubItems.Add( MiddleName);75 Item.SubItems.Add( LastName);76 Item.SubItems.Add( TelCell);77 Item.SubItems.Add( TelHome);72 Item.Caption := Fields[cfFullName]; 73 Item.SubItems.Add(Fields[cfFirstName]); 74 Item.SubItems.Add(Fields[cfMiddleName]); 75 Item.SubItems.Add(Fields[cfLastName]); 76 Item.SubItems.Add(Fields[cfTelCell]); 77 Item.SubItems.Add(Fields[cfTelHome]); 78 78 Item.Data := Contacts[Item.Index]; 79 79 end; -
trunk/Forms/UFormError.pas
r30 r31 17 17 procedure FormCreate(Sender: TObject); 18 18 procedure FormShow(Sender: TObject); 19 private20 21 public22 23 19 end; 24 20 -
trunk/Forms/UFormGenerate.pas
r29 r31 46 46 for I := 1 to SpinEditCount.Value do begin 47 47 Contact := Contacts.AddNew; 48 Contact.Fi rstName:= 'First ' + IntToStr(Random(10000));49 Contact. LastName:= 'Last ' + IntToStr(Random(10000));50 Contact.F ullName:= 'FullName ' + IntToStr(Random(100));51 Contact. TelCell:= IntToStr(Random(1000000000));52 Contact. TelHome:= IntToStr(Random(1000000000));48 Contact.Fields[cfFirstName] := 'First ' + IntToStr(Random(10000)); 49 Contact.Fields[cfLastName] := 'Last ' + IntToStr(Random(10000)); 50 Contact.Fields[cfFullName] := 'FullName ' + IntToStr(Random(100)); 51 Contact.Fields[cfTelCell] := IntToStr(Random(1000000000)); 52 Contact.Fields[cfTelHome] := IntToStr(Random(1000000000)); 53 53 end; 54 54 Close;
Note:
See TracChangeset
for help on using the changeset viewer.