Changeset 47 for trunk/Forms
- Timestamp:
- Dec 3, 2021, 12:13:51 PM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r45 r47 25 25 object TabSheetGeneral: TTabSheet 26 26 Caption = 'General' 27 ClientHeight = 744 28 ClientWidth = 931 27 ClientHeight = 742 28 ClientWidth = 929 29 OnHide = TabSheetGeneralHide 29 30 OnShow = TabSheetGeneralShow 30 31 ParentFont = False 31 32 object Label1: TLabel 32 33 Left = 240 33 Height = 2 534 Height = 24 34 35 Top = 80 35 Width = 8636 Width = 94 36 37 Caption = 'First name:' 37 38 ParentColor = False … … 40 41 object EditFirstName: TEdit 41 42 Left = 360 42 Height = 3343 Height = 42 43 44 Top = 72 44 45 Width = 155 … … 48 49 object Label2: TLabel 49 50 Left = 16 50 Height = 2 551 Height = 24 51 52 Top = 250 52 Width = 5953 Width = 63 53 54 Caption = 'Mobile:' 54 55 ParentColor = False … … 57 58 object EditMobile: TEdit 58 59 Left = 144 59 Height = 3360 Height = 42 60 61 Top = 240 61 62 Width = 254 … … 65 66 object EditPhone: TEdit 66 67 Left = 144 67 Height = 3368 Height = 42 68 69 Top = 286 69 70 Width = 254 … … 73 74 object Label3: TLabel 74 75 Left = 16 75 Height = 2 576 Height = 24 76 77 Top = 290 77 Width = 5 478 Width = 59 78 79 Caption = 'Phone:' 79 80 ParentColor = False … … 82 83 object EditEmail: TEdit 83 84 Left = 144 84 Height = 3385 Height = 42 85 86 Top = 328 86 87 Width = 254 … … 90 91 object Label4: TLabel 91 92 Left = 16 92 Height = 2 593 Height = 24 93 94 Top = 336 94 Width = 5 395 Width = 58 95 96 Caption = 'E-mail:' 96 97 ParentColor = False … … 99 100 object EditLastName: TEdit 100 101 Left = 671 101 Height = 33102 Height = 42 102 103 Top = 72 103 104 Width = 155 … … 107 108 object Label5: TLabel 108 109 Left = 536 109 Height = 2 5110 Height = 24 110 111 Top = 80 111 Width = 8 0112 Width = 87 112 113 Caption = 'Last name' 113 114 ParentColor = False … … 116 117 object EditBirthday: TEdit 117 118 Left = 144 118 Height = 33119 Height = 42 119 120 Top = 424 120 121 Width = 254 … … 124 125 object Label22: TLabel 125 126 Left = 16 126 Height = 2 5127 Height = 24 127 128 Top = 432 128 Width = 69129 Width = 76 129 130 Caption = 'Birthday:' 130 131 ParentColor = False … … 142 143 object Label24: TLabel 143 144 Left = 240 144 Height = 2 5145 Height = 24 145 146 Top = 32 146 Width = 8 0147 Width = 88 147 148 Caption = 'Full name:' 148 149 ParentColor = False … … 151 152 object EditFullName: TEdit 152 153 Left = 360 153 Height = 33154 Height = 42 154 155 Top = 24 155 156 Width = 467 … … 159 160 object Label25: TLabel 160 161 Left = 536 161 Height = 2 5162 Height = 24 162 163 Top = 128 163 Width = 1 08164 Width = 116 164 165 Caption = 'Middle name:' 165 166 ParentColor = False … … 168 169 object EditMiddleName: TEdit 169 170 Left = 671 170 Height = 33171 Height = 42 171 172 Top = 120 172 173 Width = 155 … … 176 177 object Label26: TLabel 177 178 Left = 240 178 Height = 2 5179 Height = 24 179 180 Top = 176 180 Width = 93181 Width = 101 181 182 Caption = 'Title before:' 182 183 ParentColor = False … … 185 186 object EditTitleBefore: TEdit 186 187 Left = 360 187 Height = 33188 Height = 42 188 189 Top = 168 189 190 Width = 155 … … 193 194 object Label27: TLabel 194 195 Left = 536 195 Height = 2 5196 Height = 24 196 197 Top = 176 197 Width = 77198 Width = 85 198 199 Caption = 'Title after:' 199 200 ParentColor = False … … 202 203 object EditTitleAfter: TEdit 203 204 Left = 671 204 Height = 33205 Height = 42 205 206 Top = 168 206 207 Width = 155 … … 210 211 object Label44: TLabel 211 212 Left = 240 212 Height = 2 5213 Height = 24 213 214 Top = 128 214 Width = 82215 Width = 91 215 216 Caption = 'Nickname:' 216 217 ParentColor = False … … 219 220 object EditNickName: TEdit 220 221 Left = 360 221 Height = 33222 Height = 42 222 223 Top = 120 223 224 Width = 155 … … 227 228 object Label45: TLabel 228 229 Left = 432 229 Height = 2 5230 Height = 24 230 231 Top = 432 231 Width = 96232 Width = 105 232 233 Caption = 'Anniversary:' 233 234 ParentColor = False … … 236 237 object EditAniversary: TEdit 237 238 Left = 575 238 Height = 33239 Height = 42 239 240 Top = 424 240 241 Width = 254 … … 244 245 object Label9: TLabel 245 246 Left = 432 246 Height = 2 5247 Height = 24 247 248 Top = 248 248 Width = 29249 Width = 34 249 250 Caption = 'Fax:' 250 251 ParentColor = False … … 253 254 object EditFax: TEdit 254 255 Left = 575 255 Height = 33256 Height = 42 256 257 Top = 240 257 258 Width = 254 … … 261 262 object EditPager: TEdit 262 263 Left = 575 263 Height = 33264 Height = 42 264 265 Top = 286 265 266 Width = 254 … … 269 270 object Label10: TLabel 270 271 Left = 432 271 Height = 2 5272 Height = 24 272 273 Top = 290 273 Width = 48274 Width = 54 274 275 Caption = 'Pager:' 275 276 ParentColor = False … … 278 279 object Label46: TLabel 279 280 Left = 16 280 Height = 2 5281 Height = 24 281 282 Top = 384 282 Width = 1 07283 Width = 114 283 284 Caption = 'Web address:' 284 285 ParentColor = False … … 287 288 object EditWeb: TEdit 288 289 Left = 144 289 Height = 33290 Height = 42 290 291 Top = 376 291 292 Width = 683 … … 298 299 ClientHeight = 742 299 300 ClientWidth = 929 300 OnShow = TabSheetGeneralShow 301 OnHide = TabSheetHomeHide 302 OnShow = TabSheetHomeShow 301 303 ParentFont = False 302 304 object Label7: TLabel … … 391 393 Anchors = [akTop, akLeft, akRight] 392 394 Caption = 'Address' 393 ClientHeight = 21 2394 ClientWidth = 88 6395 ClientHeight = 215 396 ClientWidth = 888 395 397 TabOrder = 6 396 398 object Label36: TLabel … … 537 539 ClientHeight = 742 538 540 ClientWidth = 929 539 OnShow = TabSheetGeneralShow 541 OnHide = TabSheetWorkHide 542 OnShow = TabSheetWorkShow 540 543 object EditOrganization: TEdit 541 544 Left = 173 … … 612 615 Width = 911 613 616 Caption = 'Address' 614 ClientHeight = 2 17615 ClientWidth = 90 7617 ClientHeight = 220 618 ClientWidth = 909 616 619 TabOrder = 4 617 620 object Label31: TLabel … … 825 828 ClientHeight = 742 826 829 ClientWidth = 929 830 OnHide = TabSheetOthersHide 831 OnShow = TabSheetOthersShow 827 832 object MemoNotes: TMemo 828 833 Left = 16 … … 871 876 Caption = 'OK' 872 877 ModalResult = 1 873 OnClick = ButtonOkClick874 878 ParentFont = False 875 879 TabOrder = 2 -
trunk/Forms/UFormContact.pas
r45 r47 128 128 procedure APhotoSaveExecute(Sender: TObject); 129 129 procedure ButtonNextClick(Sender: TObject); 130 procedure ButtonOkClick(Sender: TObject);131 130 procedure ButtonPreviousClick(Sender: TObject); 132 131 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); … … 134 133 procedure FormDestroy(Sender: TObject); 135 134 procedure FormShow(Sender: TObject); 136 procedure ListView1Data(Sender: TObject; Item: TListItem);137 135 procedure TabSheetAllShow(Sender: TObject); 136 procedure TabSheetGeneralHide(Sender: TObject); 138 137 procedure TabSheetGeneralShow(Sender: TObject); 138 procedure TabSheetHomeHide(Sender: TObject); 139 procedure TabSheetHomeShow(Sender: TObject); 140 procedure TabSheetOthersHide(Sender: TObject); 141 procedure TabSheetOthersShow(Sender: TObject); 142 procedure TabSheetWorkHide(Sender: TObject); 143 procedure TabSheetWorkShow(Sender: TObject); 139 144 private 140 145 FContact: TContact; … … 143 148 FormProperties: TFormProperties; 144 149 procedure SetContact(AValue: TContact); 150 procedure ReloadAllPropertiesTab; 145 151 public 146 procedure LoadData;147 procedure SaveData;148 152 procedure UpdateInterface; 149 153 property Contact: TContact read FContact write SetContact; … … 168 172 begin 169 173 Core.PersistentForm1.Load(Self); 170 PageControlContact.TabIndex := 0;171 174 172 175 FormProperties.ManualDock(TabSheetAll, nil, alClient); … … 176 179 end; 177 180 178 procedure TFormContact.ListView1Data(Sender: TObject; Item: TListItem);179 begin180 if Item.Index < Contact.Properties.Count then181 with Contact.Properties[Item.Index] do begin182 Item.Caption := Contact.Properties[Item.Index].Name;183 Item.SubItems.Add(Attributes.DelimitedText);184 Item.SubItems.Add(Contact.Properties[Item.Index].Value);185 Item.Data := Contact.Properties[Item.Index];186 end;187 end;188 189 181 procedure TFormContact.TabSheetAllShow(Sender: TObject); 190 182 begin 191 SaveData;183 FormProperties.Properties := Contact.Properties; 192 184 FormProperties.ReloadList; 193 185 FormProperties.UpdateInterface; 194 186 end; 195 187 188 procedure TFormContact.TabSheetGeneralHide(Sender: TObject); 189 var 190 Photo: string; 191 PhotoProperty: TContactProperty; 192 Stream: TMemoryStream; 193 JpegImage: TJpegImage; 194 begin 195 Contact.Fields[cfFullName] := EditFullName.Text; 196 Contact.Fields[cfMiddleName] := EditMiddleName.Text; 197 Contact.Fields[cfFirstName] := EditFirstName.Text; 198 Contact.Fields[cfLastName] := EditLastName.Text; 199 Contact.Fields[cfTitleAfter] := EditTitleAfter.Text; 200 Contact.Fields[cfTitleBefore] := EditTitleBefore.Text; 201 Contact.Fields[cfNickName] := EditNickName.Text; 202 Contact.Fields[cfEmail] := EditEmail.Text; 203 Contact.Fields[cfTel] := EditPhone.Text; 204 Contact.Fields[cfTelCell] := EditMobile.Text; 205 Contact.Fields[cfTelFax] := EditFax.Text; 206 Contact.Fields[cfTelPager] := EditPager.Text; 207 Contact.Fields[cfDayOfBirth] := EditBirthday.Text; 208 Contact.Fields[cfAnniversary] := EditAniversary.Text; 209 Contact.Fields[cfUrl] := EditWeb.Text; 210 211 // Photo 212 if (ImagePhoto.Picture.Bitmap.Width <> 0) and (ImagePhoto.Picture.Bitmap.Height <> 0) then begin 213 PhotoProperty := Contact.GetProperty(cfPhoto); 214 if not Assigned(PhotoProperty) then begin 215 PhotoProperty := TContactProperty.Create; 216 PhotoProperty.Name := 'PHOTO'; 217 PhotoProperty.Attributes.DelimitedText := 'JPEG'; 218 Contact.Properties.Add(PhotoProperty); 219 end; 220 PhotoProperty.Encoding := 'BASE64'; 221 Stream := TMemoryStream.Create; 222 try 223 if PhotoProperty.Attributes.IndexOf('JPEG') <> -1 then begin 224 JpegImage := TJPEGImage.Create; 225 try 226 try 227 JpegImage.SetSize(ImagePhoto.Picture.Bitmap.Width, ImagePhoto.Picture.Bitmap.Height); 228 JpegImage.Canvas.Draw(0, 0, ImagePhoto.Picture.Bitmap); 229 JpegImage.SaveToStream(Stream); 230 except 231 end; 232 finally 233 JpegImage.Free; 234 end; 235 end else begin 236 try 237 ImagePhoto.Picture.SaveToStream(Stream); 238 except 239 end; 240 end; 241 242 SetLength(Photo, Stream.Size); 243 Stream.Position := 0; 244 Stream.Read(Photo[1], Length(Photo)); 245 Contact.Fields[cfPhoto] := Photo; 246 finally 247 Stream.Free; 248 end; 249 end; 250 251 ReloadAllPropertiesTab; 252 end; 253 196 254 procedure TFormContact.TabSheetGeneralShow(Sender: TObject); 197 begin198 LoadData;199 end;200 201 procedure TFormContact.SetContact(AValue: TContact);202 begin203 if FContact = AValue then Exit;204 FContact := AValue;205 if Visible then LoadData;206 end;207 208 procedure TFormContact.FormClose(Sender: TObject; var CloseAction: TCloseAction209 );210 begin211 Core.PersistentForm1.Save(Self);212 end;213 214 procedure TFormContact.ButtonOkClick(Sender: TObject);215 begin216 SaveData;217 end;218 219 procedure TFormContact.ButtonNextClick(Sender: TObject);220 begin221 if Assigned(FOnNext) then FOnNext(Self);222 end;223 224 procedure TFormContact.APhotoLoadExecute(Sender: TObject);225 begin226 if OpenPictureDialog1.Execute then begin227 ImagePhoto.Picture.LoadFromFile(OpenPictureDialog1.FileName);228 end;229 end;230 231 procedure TFormContact.APhotoSaveExecute(Sender: TObject);232 begin233 if SavePictureDialog1.Execute then begin234 ImagePhoto.Picture.SaveToFile(SavePictureDialog1.FileName);235 end;236 end;237 238 procedure TFormContact.ButtonPreviousClick(Sender: TObject);239 begin240 if Assigned(FOnPrevious) then FOnPrevious(Self);241 end;242 243 procedure TFormContact.FormCreate(Sender: TObject);244 begin245 Core.Translator.TranslateComponentRecursive(Self);246 Core.ThemeManager1.UseTheme(Self);247 FContact := nil;248 FormProperties := TFormProperties.Create(nil);249 end;250 251 procedure TFormContact.FormDestroy(Sender: TObject);252 begin253 FreeAndNil(FormProperties);254 end;255 256 procedure TFormContact.LoadData;257 255 var 258 256 Photo: string; … … 261 259 PhotoProperty: TContactProperty; 262 260 begin 263 FormProperties.Properties := Contact.Properties;264 265 // General266 261 EditFullName.Text := Contact.Fields[cfFullName]; 267 262 EditFirstName.Text := Contact.Fields[cfFirstName]; … … 279 274 EditAniversary.Text := Contact.Fields[cfAnniversary]; 280 275 EditWeb.Text := Contact.Fields[cfUrl]; 281 282 // Home283 EditHomeEmail.Text := Contact.Fields[cfEmailHome];284 EditHomePhone.Text := Contact.Fields[cfTelHome];285 EditHomeMobile.Text := Contact.Fields[cfTelCellHome];286 EditHomeFax.Text := Contact.Fields[cfTelFaxHome];287 EditHomePager.Text := Contact.Fields[cfTelPagerHome];288 EditHomeAddressPostOfficeBox.Text := Contact.Fields[cfHomeAddressPostOfficeBox];289 EditHomeAddressStreet.Text := Contact.Fields[cfHomeAddressStreet];290 EditHomeAddressStreetExtended.Text := Contact.Fields[cfHomeAddressStreetExtended];291 EditHomeAddressCity.Text := Contact.Fields[cfHomeAddressCity];292 EditHomeAddressRegion.Text := Contact.Fields[cfHomeAddressRegion];293 EditHomeAddressCountry.Text := Contact.Fields[cfHomeAddressCountry];294 EditHomeAddressPostalCode.Text := Contact.Fields[cfHomeAddressPostalCode];295 EditHomeWeb.Text := Contact.Fields[cfUrlHome];296 297 // Work298 EditWorkEmail.Text := Contact.Fields[cfEmailWork];299 EditWorkPhone.Text := Contact.Fields[cfTelWork];300 EditWorkMobile.Text := Contact.Fields[cfTelCellWork];301 EditWorkFax.Text := Contact.Fields[cfTelFaxWork];302 EditWorkPager.Text := Contact.Fields[cfTelPagerWork];303 EditTitle.Text := Contact.Fields[cfTitle];304 EditOrganization.Text := Contact.Fields[cfOrganization];305 EditDepartment.Text := Contact.Fields[cfDepartment];306 EditAddressWorkPostOfficeBox.Text := Contact.Fields[cfWorkAddressPostOfficeBox];307 EditAddressWorkStreet.Text := Contact.Fields[cfWorkAddressStreet];308 EditAddressWorkStreetExtended.Text := Contact.Fields[cfWorkAddressStreetExtended];309 EditAddressWorkCity.Text := Contact.Fields[cfWorkAddressCity];310 EditAddressWorkRegion.Text := Contact.Fields[cfWorkAddressRegion];311 EditAddressWorkCountry.Text := Contact.Fields[cfWorkAddressCountry];312 EditAddressWorkPostalCode.Text := Contact.Fields[cfWorkAddressPostalCode];313 EditWorkWeb.Text := Contact.Fields[cfUrlWork];314 315 // Others316 MemoNotes.Lines.Text := Contact.Fields[cfNote];317 276 318 277 // Photo … … 349 308 end; 350 309 end; 351 UpdateInterface; 352 end; 353 354 procedure TFormContact.SaveData; 355 var 356 Photo: string; 357 PhotoProperty: TContactProperty; 358 Stream: TMemoryStream; 359 JpegImage: TJpegImage; 360 begin 361 // General 362 Contact.Fields[cfFullName] := EditFullName.Text; 363 Contact.Fields[cfMiddleName] := EditMiddleName.Text; 364 Contact.Fields[cfFirstName] := EditFirstName.Text; 365 Contact.Fields[cfLastName] := EditLastName.Text; 366 Contact.Fields[cfTitleAfter] := EditTitleAfter.Text; 367 Contact.Fields[cfTitleBefore] := EditTitleBefore.Text; 368 Contact.Fields[cfNickName] := EditNickName.Text; 369 Contact.Fields[cfEmail] := EditEmail.Text; 370 Contact.Fields[cfTel] := EditPhone.Text; 371 Contact.Fields[cfTelCell] := EditMobile.Text; 372 Contact.Fields[cfTelFax] := EditFax.Text; 373 Contact.Fields[cfTelPager] := EditPager.Text; 374 Contact.Fields[cfDayOfBirth] := EditBirthday.Text; 375 Contact.Fields[cfAnniversary] := EditAniversary.Text; 376 Contact.Fields[cfUrl] := EditWeb.Text; 377 378 // Home 310 end; 311 312 procedure TFormContact.TabSheetHomeHide(Sender: TObject); 313 begin 379 314 Contact.Fields[cfEmailHome] := EditHomeEmail.Text; 380 315 Contact.Fields[cfTelHome] := EditHomePhone.Text; … … 391 326 Contact.Fields[cfUrlHome] := EditHomeWeb.Text; 392 327 393 // Work 328 ReloadAllPropertiesTab; 329 end; 330 331 procedure TFormContact.TabSheetHomeShow(Sender: TObject); 332 begin 333 EditHomeEmail.Text := Contact.Fields[cfEmailHome]; 334 EditHomePhone.Text := Contact.Fields[cfTelHome]; 335 EditHomeMobile.Text := Contact.Fields[cfTelCellHome]; 336 EditHomeFax.Text := Contact.Fields[cfTelFaxHome]; 337 EditHomePager.Text := Contact.Fields[cfTelPagerHome]; 338 EditHomeAddressPostOfficeBox.Text := Contact.Fields[cfHomeAddressPostOfficeBox]; 339 EditHomeAddressStreet.Text := Contact.Fields[cfHomeAddressStreet]; 340 EditHomeAddressStreetExtended.Text := Contact.Fields[cfHomeAddressStreetExtended]; 341 EditHomeAddressCity.Text := Contact.Fields[cfHomeAddressCity]; 342 EditHomeAddressRegion.Text := Contact.Fields[cfHomeAddressRegion]; 343 EditHomeAddressCountry.Text := Contact.Fields[cfHomeAddressCountry]; 344 EditHomeAddressPostalCode.Text := Contact.Fields[cfHomeAddressPostalCode]; 345 EditHomeWeb.Text := Contact.Fields[cfUrlHome]; 346 end; 347 348 procedure TFormContact.TabSheetOthersHide(Sender: TObject); 349 begin 350 Contact.Fields[cfNote] := MemoNotes.Lines.Text; 351 352 ReloadAllPropertiesTab; 353 end; 354 355 procedure TFormContact.TabSheetOthersShow(Sender: TObject); 356 begin 357 MemoNotes.Lines.Text := Contact.Fields[cfNote]; 358 end; 359 360 procedure TFormContact.TabSheetWorkHide(Sender: TObject); 361 begin 394 362 Contact.Fields[cfEmailWork] := EditWorkEmail.Text; 395 363 Contact.Fields[cfTelWork] := EditWorkPhone.Text; … … 409 377 Contact.Fields[cfUrlWork] := EditWorkWeb.Text; 410 378 411 // Others 412 Contact.Fields[cfNote] := MemoNotes.Lines.Text; 413 414 // Photo 415 if (ImagePhoto.Picture.Bitmap.Width <> 0) and (ImagePhoto.Picture.Bitmap.Height <> 0) then begin 416 PhotoProperty := Contact.GetProperty(cfPhoto); 417 if not Assigned(PhotoProperty) then begin 418 PhotoProperty := TContactProperty.Create; 419 PhotoProperty.Name := 'PHOTO'; 420 PhotoProperty.Attributes.DelimitedText := 'JPEG'; 421 Contact.Properties.Add(PhotoProperty); 422 end; 423 PhotoProperty.Encoding := 'BASE64'; 424 Stream := TMemoryStream.Create; 425 try 426 if PhotoProperty.Attributes.IndexOf('JPEG') <> -1 then begin 427 JpegImage := TJPEGImage.Create; 428 try 429 try 430 JpegImage.SetSize(ImagePhoto.Picture.Bitmap.Width, ImagePhoto.Picture.Bitmap.Height); 431 JpegImage.Canvas.Draw(0, 0, ImagePhoto.Picture.Bitmap); 432 JpegImage.SaveToStream(Stream); 433 except 434 end; 435 finally 436 JpegImage.Free; 437 end; 438 end else begin 439 try 440 ImagePhoto.Picture.SaveToStream(Stream); 441 except 442 end; 443 end; 444 445 SetLength(Photo, Stream.Size); 446 Stream.Position := 0; 447 Stream.Read(Photo[1], Length(Photo)); 448 Contact.Fields[cfPhoto] := Photo; 449 finally 450 Stream.Free; 451 end; 452 end; 379 ReloadAllPropertiesTab; 380 end; 381 382 procedure TFormContact.TabSheetWorkShow(Sender: TObject); 383 begin 384 EditWorkEmail.Text := Contact.Fields[cfEmailWork]; 385 EditWorkPhone.Text := Contact.Fields[cfTelWork]; 386 EditWorkMobile.Text := Contact.Fields[cfTelCellWork]; 387 EditWorkFax.Text := Contact.Fields[cfTelFaxWork]; 388 EditWorkPager.Text := Contact.Fields[cfTelPagerWork]; 389 EditTitle.Text := Contact.Fields[cfTitle]; 390 EditOrganization.Text := Contact.Fields[cfOrganization]; 391 EditDepartment.Text := Contact.Fields[cfDepartment]; 392 EditAddressWorkPostOfficeBox.Text := Contact.Fields[cfWorkAddressPostOfficeBox]; 393 EditAddressWorkStreet.Text := Contact.Fields[cfWorkAddressStreet]; 394 EditAddressWorkStreetExtended.Text := Contact.Fields[cfWorkAddressStreetExtended]; 395 EditAddressWorkCity.Text := Contact.Fields[cfWorkAddressCity]; 396 EditAddressWorkRegion.Text := Contact.Fields[cfWorkAddressRegion]; 397 EditAddressWorkCountry.Text := Contact.Fields[cfWorkAddressCountry]; 398 EditAddressWorkPostalCode.Text := Contact.Fields[cfWorkAddressPostalCode]; 399 EditWorkWeb.Text := Contact.Fields[cfUrlWork]; 400 end; 401 402 procedure TFormContact.SetContact(AValue: TContact); 403 begin 404 if FContact = AValue then Exit; 405 FContact := AValue; 406 end; 407 408 procedure TFormContact.ReloadAllPropertiesTab; 409 begin 410 if TabSheetAll.Visible then begin 411 TabSheetAllShow(nil); 412 end; 413 end; 414 415 procedure TFormContact.FormClose(Sender: TObject; var CloseAction: TCloseAction 416 ); 417 begin 418 Core.PersistentForm1.Save(Self); 419 end; 420 421 procedure TFormContact.ButtonNextClick(Sender: TObject); 422 begin 423 if Assigned(FOnNext) then FOnNext(Self); 424 end; 425 426 procedure TFormContact.APhotoLoadExecute(Sender: TObject); 427 begin 428 if OpenPictureDialog1.Execute then begin 429 ImagePhoto.Picture.LoadFromFile(OpenPictureDialog1.FileName); 430 end; 431 end; 432 433 procedure TFormContact.APhotoSaveExecute(Sender: TObject); 434 begin 435 if SavePictureDialog1.Execute then begin 436 ImagePhoto.Picture.SaveToFile(SavePictureDialog1.FileName); 437 end; 438 end; 439 440 procedure TFormContact.ButtonPreviousClick(Sender: TObject); 441 begin 442 if Assigned(FOnPrevious) then FOnPrevious(Self); 443 end; 444 445 procedure TFormContact.FormCreate(Sender: TObject); 446 begin 447 Core.Translator.TranslateComponentRecursive(Self); 448 Core.ThemeManager1.UseTheme(Self); 449 FContact := nil; 450 FormProperties := TFormProperties.Create(nil); 451 end; 452 453 procedure TFormContact.FormDestroy(Sender: TObject); 454 begin 455 FreeAndNil(FormProperties); 453 456 end; 454 457
Note:
See TracChangeset
for help on using the changeset viewer.