Changeset 38 for trunk/Forms


Ignore:
Timestamp:
Nov 25, 2021, 3:35:59 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Avoid exception if photo data are not valid image data.
  • Fixed: Some contact fields were not saved.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.lfm

    r35 r38  
    1515    Left = 10
    1616    Height = 576
    17     Top = 10
     17    Top = 8
    1818    Width = 893
    19     ActivePage = TabSheetAll
     19    ActivePage = TabSheetGeneral
    2020    Anchors = [akTop, akLeft, akRight, akBottom]
    2121    ParentFont = False
    22     TabIndex = 2
     22    TabIndex = 0
    2323    TabOrder = 0
    2424    object TabSheetGeneral: TTabSheet
     
    126126        Left = 240
    127127        Height = 24
    128         Top = 264
     128        Top = 304
    129129        Width = 55
    130130        Caption = 'Notes:'
  • trunk/Forms/UFormContact.pas

    r35 r38  
    204204          JpegImage := TJPEGImage.Create;
    205205          try
    206             JpegImage.LoadFromStream(Stream);
    207             ImagePhoto.Picture.Bitmap.SetSize(JpegImage.Width, JpegImage.Height);
    208             ImagePhoto.Picture.Bitmap.Canvas.Draw(0, 0, JpegImage);
     206            try
     207              JpegImage.LoadFromStream(Stream);
     208              ImagePhoto.Picture.Bitmap.SetSize(JpegImage.Width, JpegImage.Height);
     209              ImagePhoto.Picture.Bitmap.Canvas.Draw(0, 0, JpegImage);
     210            except
     211            end;
    209212          finally
    210213            JpegImage.Free;
    211214          end;
    212215        end else begin
    213           ImagePhoto.Picture.Bitmap.LoadFromStream(Stream);
     216          try
     217            ImagePhoto.Picture.LoadFromStream(Stream);
     218          except
     219          end;
    214220        end;
    215221      finally
     
    222228procedure TFormContact.SaveData(Contact: TContact);
    223229begin
     230  Contact.Fields[cfFullName] := EditFullName.Text;
     231  Contact.Fields[cfMiddleName] := EditMiddleName.Text;
    224232  Contact.Fields[cfFirstName] := EditFirstName.Text;
    225233  Contact.Fields[cfLastName] := EditLastName.Text;
     234  Contact.Fields[cfTitleAfter] := EditTitleAfter.Text;
     235  Contact.Fields[cfTitleBefore] := EditTitleBefore.Text;
    226236  Contact.Fields[cfTelCell] := EditCellPhone.Text;
    227237  Contact.Fields[cfTelHome] := EditPhoneHome.Text;
Note: See TracChangeset for help on using the changeset viewer.