Changeset 39 for trunk/Forms


Ignore:
Timestamp:
Nov 29, 2021, 2:17:26 PM (3 years ago)
Author:
chronos
Message:
  • Added: New more general contact properties list and item form.
  • Modified: Show Private and Work addresses in separate tab.
Location:
trunk/Forms
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.lfm

    r38 r39  
    11object FormContact: TFormContact
    22  Left = 604
    3   Height = 656
     3  Height = 865
    44  Top = 361
    55  Width = 915
    66  Caption = 'Contact'
    7   ClientHeight = 656
     7  ClientHeight = 865
    88  ClientWidth = 915
    99  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     12  OnDestroy = FormDestroy
    1213  OnShow = FormShow
    1314  LCLVersion = '2.0.12.0'
    1415  object PageControlContact: TPageControl
    15     Left = 10
    16     Height = 576
     16    Left = 8
     17    Height = 785
    1718    Top = 8
    1819    Width = 893
    19     ActivePage = TabSheetGeneral
     20    ActivePage = TabSheetWork
    2021    Anchors = [akTop, akLeft, akRight, akBottom]
    2122    ParentFont = False
    22     TabIndex = 0
     23    TabIndex = 2
    2324    TabOrder = 0
    2425    object TabSheetGeneral: TTabSheet
    2526      Caption = 'General'
    26       ClientHeight = 536
     27      ClientHeight = 745
    2728      ClientWidth = 883
     29      OnShow = TabSheetGeneralShow
    2830      ParentFont = False
    2931      object Label1: TLabel
     
    269271      end
    270272    end
    271     object TabSheetDetails: TTabSheet
    272       Caption = 'Details'
    273       ClientHeight = 536
     273    object TabSheetPrivate: TTabSheet
     274      Caption = 'Private'
     275      ClientHeight = 745
    274276      ClientWidth = 883
     277      OnShow = TabSheetGeneralShow
    275278      ParentFont = False
    276279      object Label7: TLabel
     
    352355      end
    353356      object EditFax: TEdit
    354         Left = 584
    355         Height = 42
    356         Top = 18
     357        Left = 608
     358        Height = 42
     359        Top = 16
    357360        Width = 254
    358361        ParentFont = False
     
    369372      end
    370373      object EditFaxHome: TEdit
    371         Left = 584
     374        Left = 608
    372375        Height = 42
    373376        Top = 62
     
    386389      end
    387390      object EditFaxWork: TEdit
    388         Left = 584
     391        Left = 608
    389392        Height = 42
    390393        Top = 108
     
    403406      end
    404407      object EditPager: TEdit
    405         Left = 584
     408        Left = 608
    406409        Height = 42
    407410        Top = 152
     
    410413        TabOrder = 7
    411414      end
    412       object Label15: TLabel
    413         Left = 10
    414         Height = 24
    415         Top = 224
    416         Width = 89
    417         Caption = 'Web page:'
    418         ParentColor = False
    419         ParentFont = False
    420       end
    421       object EditWebPage: TEdit
    422         Left = 173
    423         Height = 42
    424         Top = 220
     415      object EditAddressHomeStreet: TEdit
     416        Left = 173
     417        Height = 42
     418        Top = 200
    425419        Width = 254
    426420        ParentFont = False
    427421        TabOrder = 8
    428422      end
    429       object Label16: TLabel
    430         Left = 10
    431         Height = 24
    432         Top = 272
    433         Width = 155
    434         Caption = 'Web page (Home):'
    435         ParentColor = False
    436         ParentFont = False
    437       end
    438       object EditWebPageHome: TEdit
    439         Left = 173
    440         Height = 42
    441         Top = 262
     423      object Label36: TLabel
     424        Left = 10
     425        Height = 24
     426        Top = 210
     427        Width = 54
     428        Caption = 'Street:'
     429        ParentColor = False
     430        ParentFont = False
     431      end
     432      object Label37: TLabel
     433        Left = 10
     434        Height = 24
     435        Top = 258
     436        Width = 137
     437        Caption = 'Extended street:'
     438        ParentColor = False
     439        ParentFont = False
     440      end
     441      object Label38: TLabel
     442        Left = 10
     443        Height = 24
     444        Top = 304
     445        Width = 64
     446        Caption = 'Region:'
     447        ParentColor = False
     448        ParentFont = False
     449      end
     450      object Label39: TLabel
     451        Left = 10
     452        Height = 24
     453        Top = 352
     454        Width = 71
     455        Caption = 'Country:'
     456        ParentColor = False
     457        ParentFont = False
     458      end
     459      object Label40: TLabel
     460        Left = 10
     461        Height = 24
     462        Top = 400
     463        Width = 114
     464        Caption = 'Web address:'
     465        ParentColor = False
     466        ParentFont = False
     467      end
     468      object EditWebHome: TEdit
     469        Left = 173
     470        Height = 42
     471        Top = 392
    442472        Width = 254
    443473        ParentFont = False
    444474        TabOrder = 9
    445475      end
    446       object Label17: TLabel
    447         Left = 10
    448         Height = 24
    449         Top = 312
    450         Width = 148
    451         Caption = 'Web page (Work):'
    452         ParentColor = False
    453         ParentFont = False
    454       end
    455       object EditWebPageWork: TEdit
    456         Left = 173
    457         Height = 42
    458         Top = 306
     476      object EditAddressHomeCountry: TEdit
     477        Left = 173
     478        Height = 42
     479        Top = 344
    459480        Width = 254
    460481        ParentFont = False
    461482        TabOrder = 10
    462483      end
     484      object EditAddressHomeRegion: TEdit
     485        Left = 173
     486        Height = 42
     487        Top = 296
     488        Width = 254
     489        ParentFont = False
     490        TabOrder = 11
     491      end
     492      object Label41: TLabel
     493        Left = 451
     494        Height = 24
     495        Top = 342
     496        Width = 103
     497        Caption = 'Postal code:'
     498        ParentColor = False
     499        ParentFont = False
     500      end
     501      object EditAddressHomePostalCode: TEdit
     502        Left = 608
     503        Height = 42
     504        Top = 334
     505        Width = 254
     506        ParentFont = False
     507        TabOrder = 12
     508      end
     509      object EditAddressHomeCity: TEdit
     510        Left = 608
     511        Height = 42
     512        Top = 248
     513        Width = 254
     514        ParentFont = False
     515        TabOrder = 13
     516      end
     517      object Label42: TLabel
     518        Left = 451
     519        Height = 24
     520        Top = 256
     521        Width = 36
     522        Caption = 'City:'
     523        ParentColor = False
     524        ParentFont = False
     525      end
     526      object Label43: TLabel
     527        Left = 451
     528        Height = 24
     529        Top = 208
     530        Width = 131
     531        Caption = 'Post office box:'
     532        ParentColor = False
     533        ParentFont = False
     534      end
     535      object EditAddressHomePostOfficeBox: TEdit
     536        Left = 608
     537        Height = 42
     538        Top = 200
     539        Width = 254
     540        ParentFont = False
     541        TabOrder = 14
     542      end
     543      object EditAddressHomeStreetExtended: TEdit
     544        Left = 173
     545        Height = 42
     546        Top = 248
     547        Width = 254
     548        ParentFont = False
     549        TabOrder = 15
     550      end
     551    end
     552    object TabSheetWork: TTabSheet
     553      Caption = 'Work'
     554      ClientHeight = 745
     555      ClientWidth = 883
     556      OnShow = TabSheetGeneralShow
     557      object EditOrganization: TEdit
     558        Left = 173
     559        Height = 42
     560        Top = 64
     561        Width = 254
     562        ParentFont = False
     563        TabOrder = 0
     564      end
     565      object LabelOrganization: TLabel
     566        Left = 10
     567        Height = 24
     568        Top = 70
     569        Width = 114
     570        Caption = 'Organization:'
     571        ParentColor = False
     572        ParentFont = False
     573      end
     574      object LabelOrganization1: TLabel
     575        Left = 451
     576        Height = 24
     577        Top = 32
     578        Width = 106
     579        Caption = 'Department:'
     580        ParentColor = False
     581        ParentFont = False
     582      end
     583      object EditDepartment: TEdit
     584        Left = 608
     585        Height = 42
     586        Top = 20
     587        Width = 254
     588        ParentFont = False
     589        TabOrder = 1
     590      end
    463591      object Label18: TLabel
    464         Left = 450
    465         Height = 24
    466         Top = 224
     592        Left = 10
     593        Height = 24
     594        Top = 20
    467595        Width = 41
    468596        Caption = 'Title:'
     
    471599      end
    472600      object EditTitle: TEdit
    473         Left = 584
    474         Height = 42
    475         Top = 220
    476         Width = 254
    477         ParentFont = False
    478         TabOrder = 11
    479       end
    480       object Label19: TLabel
    481         Left = 450
    482         Height = 24
    483         Top = 272
    484         Width = 74
    485         Caption = 'Address:'
    486         ParentColor = False
    487         ParentFont = False
    488       end
    489       object EditAddress: TEdit
    490         Left = 584
    491         Height = 42
    492         Top = 262
    493         Width = 254
    494         ParentFont = False
    495         TabOrder = 12
    496       end
    497       object LabelOrganization: TLabel
    498         Left = 448
     601        Left = 173
     602        Height = 42
     603        Top = 16
     604        Width = 254
     605        ParentFont = False
     606        TabOrder = 2
     607      end
     608      object Label28: TLabel
     609        Left = 10
     610        Height = 24
     611        Top = 122
     612        Width = 54
     613        Caption = 'Street:'
     614        ParentColor = False
     615        ParentFont = False
     616      end
     617      object EditAddressWorkStreet: TEdit
     618        Left = 173
     619        Height = 42
     620        Top = 112
     621        Width = 254
     622        ParentFont = False
     623        TabOrder = 3
     624      end
     625      object Label29: TLabel
     626        Left = 451
     627        Height = 24
     628        Top = 168
     629        Width = 36
     630        Caption = 'City:'
     631        ParentColor = False
     632        ParentFont = False
     633      end
     634      object EditAddressWorkCity: TEdit
     635        Left = 608
     636        Height = 42
     637        Top = 160
     638        Width = 254
     639        ParentFont = False
     640        TabOrder = 4
     641      end
     642      object Label30: TLabel
     643        Left = 10
     644        Height = 24
     645        Top = 216
     646        Width = 64
     647        Caption = 'Region:'
     648        ParentColor = False
     649        ParentFont = False
     650      end
     651      object EditAddressWorkRegion: TEdit
     652        Left = 173
     653        Height = 42
     654        Top = 216
     655        Width = 254
     656        ParentFont = False
     657        TabOrder = 5
     658      end
     659      object EditAddressWorkCountry: TEdit
     660        Left = 173
     661        Height = 42
     662        Top = 264
     663        Width = 254
     664        ParentFont = False
     665        TabOrder = 6
     666      end
     667      object Label31: TLabel
     668        Left = 10
     669        Height = 24
     670        Top = 264
     671        Width = 71
     672        Caption = 'Country:'
     673        ParentColor = False
     674        ParentFont = False
     675      end
     676      object EditWebWork: TEdit
     677        Left = 173
     678        Height = 42
     679        Top = 312
     680        Width = 254
     681        ParentFont = False
     682        TabOrder = 7
     683      end
     684      object Label32: TLabel
     685        Left = 10
    499686        Height = 24
    500687        Top = 312
    501688        Width = 114
    502         Caption = 'Organization:'
    503         ParentColor = False
    504         ParentFont = False
    505       end
    506       object EditOrganization: TEdit
    507         Left = 584
    508         Height = 42
    509         Top = 306
    510         Width = 254
    511         ParentFont = False
    512         TabOrder = 13
    513       end
    514       object LabelOrganization1: TLabel
    515         Left = 450
    516         Height = 24
    517         Top = 360
    518         Width = 106
    519         Caption = 'Department:'
    520         ParentColor = False
    521         ParentFont = False
    522       end
    523       object EditDepartment: TEdit
    524         Left = 584
    525         Height = 42
    526         Top = 348
    527         Width = 254
    528         ParentFont = False
    529         TabOrder = 14
     689        Caption = 'Web address:'
     690        ParentColor = False
     691        ParentFont = False
     692      end
     693      object EditAddressWorkPostalCode: TEdit
     694        Left = 608
     695        Height = 42
     696        Top = 246
     697        Width = 254
     698        ParentFont = False
     699        TabOrder = 8
     700      end
     701      object Label33: TLabel
     702        Left = 451
     703        Height = 24
     704        Top = 254
     705        Width = 103
     706        Caption = 'Postal code:'
     707        ParentColor = False
     708        ParentFont = False
     709      end
     710      object EditAddressWorkPostOfficeBox: TEdit
     711        Left = 608
     712        Height = 42
     713        Top = 112
     714        Width = 254
     715        ParentFont = False
     716        TabOrder = 9
     717      end
     718      object Label34: TLabel
     719        Left = 451
     720        Height = 24
     721        Top = 122
     722        Width = 131
     723        Caption = 'Post office box:'
     724        ParentColor = False
     725        ParentFont = False
     726      end
     727      object Label35: TLabel
     728        Left = 10
     729        Height = 24
     730        Top = 170
     731        Width = 137
     732        Caption = 'Extended street:'
     733        ParentColor = False
     734        ParentFont = False
     735      end
     736      object EditAddressWorkStreetExtended: TEdit
     737        Left = 173
     738        Height = 42
     739        Top = 168
     740        Width = 254
     741        ParentFont = False
     742        TabOrder = 10
    530743      end
    531744    end
    532745    object TabSheetAll: TTabSheet
    533746      Caption = 'All fields'
    534       ClientHeight = 536
    535       ClientWidth = 883
    536747      OnShow = TabSheetAllShow
    537748      ParentFont = False
    538       object ListView1: TListView
    539         Left = 10
    540         Height = 509
    541         Top = 19
    542         Width = 865
    543         Anchors = [akTop, akLeft, akRight, akBottom]
    544         Columns = <       
    545           item
    546             Caption = 'Name'
    547             Width = 100
    548           end       
    549           item
    550             Caption = 'Attributes'
    551             Width = 200
    552           end       
    553           item
    554             Caption = 'Value'
    555             Width = 550
    556           end>
    557         OwnerData = True
    558         ParentFont = False
    559         PopupMenu = PopupMenu1
    560         ReadOnly = True
    561         RowSelect = True
    562         TabOrder = 0
    563         ViewStyle = vsReport
    564         OnData = ListView1Data
    565         OnDblClick = AEditFieldExecute
    566       end
    567749    end
    568750  end
     
    570752    Left = 788
    571753    Height = 37
    572     Top = 606
     754    Top = 815
    573755    Width = 115
    574756    Anchors = [akRight, akBottom]
     
    581763    Left = 653
    582764    Height = 37
    583     Top = 606
     765    Top = 815
    584766    Width = 119
    585767    Anchors = [akRight, akBottom]
    586768    Caption = 'OK'
    587769    ModalResult = 1
     770    OnClick = ButtonOkClick
    588771    ParentFont = False
    589772    TabOrder = 2
     
    595778    object AEditField: TAction
    596779      Caption = 'Edit'
    597       OnExecute = AEditFieldExecute
    598780    end
    599781  end
  • trunk/Forms/UFormContact.lrj

    r33 r39  
    1616{"hash":62410682,"name":"tformcontact.label26.caption","sourcebytes":[84,105,116,108,101,32,98,101,102,111,114,101,58],"value":"Title before:"},
    1717{"hash":63774250,"name":"tformcontact.label27.caption","sourcebytes":[84,105,116,108,101,32,97,102,116,101,114,58],"value":"Title after:"},
    18 {"hash":181043315,"name":"tformcontact.tabsheetdetails.caption","sourcebytes":[68,101,116,97,105,108,115],"value":"Details"},
     18{"hash":126929141,"name":"tformcontact.tabsheetprivate.caption","sourcebytes":[80,114,105,118,97,116,101],"value":"Private"},
    1919{"hash":170160314,"name":"tformcontact.label7.caption","sourcebytes":[80,104,111,110,101,32,40,72,111,109,101,41,58],"value":"Phone (Home):"},
    2020{"hash":187747002,"name":"tformcontact.label8.caption","sourcebytes":[80,104,111,110,101,32,40,87,111,114,107,41,58],"value":"Phone (Work):"},
     
    2525{"hash":229246954,"name":"tformcontact.label13.caption","sourcebytes":[70,97,120,32,40,87,111,114,107,41,58],"value":"Fax (Work):"},
    2626{"hash":90692698,"name":"tformcontact.label14.caption","sourcebytes":[80,97,103,101,114,58],"value":"Pager:"},
    27 {"hash":74850362,"name":"tformcontact.label15.caption","sourcebytes":[87,101,98,32,112,97,103,101,58],"value":"Web page:"},
    28 {"hash":194526122,"name":"tformcontact.label16.caption","sourcebytes":[87,101,98,32,112,97,103,101,32,40,72,111,109,101,41,58],"value":"Web page (Home):"},
    29 {"hash":180650410,"name":"tformcontact.label17.caption","sourcebytes":[87,101,98,32,112,97,103,101,32,40,87,111,114,107,41,58],"value":"Web page (Work):"},
    30 {"hash":95466122,"name":"tformcontact.label18.caption","sourcebytes":[84,105,116,108,101,58],"value":"Title:"},
    31 {"hash":179883546,"name":"tformcontact.label19.caption","sourcebytes":[65,100,100,114,101,115,115,58],"value":"Address:"},
     27{"hash":179878954,"name":"tformcontact.label36.caption","sourcebytes":[83,116,114,101,101,116,58],"value":"Street:"},
     28{"hash":116835754,"name":"tformcontact.label37.caption","sourcebytes":[69,120,116,101,110,100,101,100,32,115,116,114,101,101,116,58],"value":"Extended street:"},
     29{"hash":146671178,"name":"tformcontact.label38.caption","sourcebytes":[82,101,103,105,111,110,58],"value":"Region:"},
     30{"hash":113622378,"name":"tformcontact.label39.caption","sourcebytes":[67,111,117,110,116,114,121,58],"value":"Country:"},
     31{"hash":258182170,"name":"tformcontact.label40.caption","sourcebytes":[87,101,98,32,97,100,100,114,101,115,115,58],"value":"Web address:"},
     32{"hash":186708218,"name":"tformcontact.label41.caption","sourcebytes":[80,111,115,116,97,108,32,99,111,100,101,58],"value":"Postal code:"},
     33{"hash":4852682,"name":"tformcontact.label42.caption","sourcebytes":[67,105,116,121,58],"value":"City:"},
     34{"hash":252071146,"name":"tformcontact.label43.caption","sourcebytes":[80,111,115,116,32,111,102,102,105,99,101,32,98,111,120,58],"value":"Post office box:"},
     35{"hash":386699,"name":"tformcontact.tabsheetwork.caption","sourcebytes":[87,111,114,107],"value":"Work"},
    3236{"hash":101155194,"name":"tformcontact.labelorganization.caption","sourcebytes":[79,114,103,97,110,105,122,97,116,105,111,110,58],"value":"Organization:"},
    3337{"hash":167347194,"name":"tformcontact.labelorganization1.caption","sourcebytes":[68,101,112,97,114,116,109,101,110,116,58],"value":"Department:"},
     38{"hash":95466122,"name":"tformcontact.label18.caption","sourcebytes":[84,105,116,108,101,58],"value":"Title:"},
     39{"hash":179878954,"name":"tformcontact.label28.caption","sourcebytes":[83,116,114,101,101,116,58],"value":"Street:"},
     40{"hash":4852682,"name":"tformcontact.label29.caption","sourcebytes":[67,105,116,121,58],"value":"City:"},
     41{"hash":146671178,"name":"tformcontact.label30.caption","sourcebytes":[82,101,103,105,111,110,58],"value":"Region:"},
     42{"hash":113622378,"name":"tformcontact.label31.caption","sourcebytes":[67,111,117,110,116,114,121,58],"value":"Country:"},
     43{"hash":258182170,"name":"tformcontact.label32.caption","sourcebytes":[87,101,98,32,97,100,100,114,101,115,115,58],"value":"Web address:"},
     44{"hash":186708218,"name":"tformcontact.label33.caption","sourcebytes":[80,111,115,116,97,108,32,99,111,100,101,58],"value":"Postal code:"},
     45{"hash":252071146,"name":"tformcontact.label34.caption","sourcebytes":[80,111,115,116,32,111,102,102,105,99,101,32,98,111,120,58],"value":"Post office box:"},
     46{"hash":116835754,"name":"tformcontact.label35.caption","sourcebytes":[69,120,116,101,110,100,101,100,32,115,116,114,101,101,116,58],"value":"Extended street:"},
    3447{"hash":113983571,"name":"tformcontact.tabsheetall.caption","sourcebytes":[65,108,108,32,102,105,101,108,100,115],"value":"All fields"},
    35 {"hash":346165,"name":"tformcontact.listview1.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"},
    36 {"hash":150815091,"name":"tformcontact.listview1.columns[1].caption","sourcebytes":[65,116,116,114,105,98,117,116,101,115],"value":"Attributes"},
    37 {"hash":6063029,"name":"tformcontact.listview1.columns[2].caption","sourcebytes":[86,97,108,117,101],"value":"Value"},
    3848{"hash":77089212,"name":"tformcontact.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"},
    3949{"hash":1339,"name":"tformcontact.buttonok.caption","sourcebytes":[79,75],"value":"OK"},
  • trunk/Forms/UFormContact.pas

    r38 r39  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, ActnList, Menus, ExtCtrls, UContact, base64;
     9  ComCtrls, ActnList, Menus, ExtCtrls, UContact, base64, UFormProperties;
    1010
    1111type
     
    1818    ButtonCancel: TButton;
    1919    ButtonOk: TButton;
     20    EditAddressHomeCity: TEdit;
     21    EditAddressHomeCountry: TEdit;
     22    EditAddressHomePostalCode: TEdit;
     23    EditAddressHomePostOfficeBox: TEdit;
     24    EditAddressHomeRegion: TEdit;
     25    EditAddressHomeStreetExtended: TEdit;
     26    EditAddressWorkStreet: TEdit;
     27    EditAddressWorkCity: TEdit;
     28    EditAddressWorkRegion: TEdit;
     29    EditAddressWorkCountry: TEdit;
     30    EditAddressHomeStreet: TEdit;
     31    EditWebWork: TEdit;
     32    EditAddressWorkPostalCode: TEdit;
     33    EditAddressWorkPostOfficeBox: TEdit;
     34    EditAddressWorkStreetExtended: TEdit;
    2035    EditDepartment: TEdit;
    2136    EditFullName: TEdit;
     37    EditOrganization: TEdit;
     38    EditTitle: TEdit;
    2239    EditTitleBefore: TEdit;
    2340    EditMiddleName: TEdit;
    2441    EditTitleAfter: TEdit;
    25     EditWebPage: TEdit;
    26     EditWebPageHome: TEdit;
    27     EditWebPageWork: TEdit;
    2842    EditEmailHome: TEdit;
    2943    EditEmailWork: TEdit;
    3044    EditBirthday: TEdit;
    31     EditTitle: TEdit;
    32     EditAddress: TEdit;
    33     EditOrganization: TEdit;
    3445    EditPhoneHome: TEdit;
    3546    EditPhoneWork: TEdit;
     
    4556    EditFirstName: TEdit;
    4657    EditCellPhone: TEdit;
     58    EditWebHome: TEdit;
    4759    ImagePhoto: TImage;
    4860    Label1: TLabel;
     
    5264    Label13: TLabel;
    5365    Label14: TLabel;
    54     Label15: TLabel;
    55     Label16: TLabel;
    56     Label17: TLabel;
    5766    Label18: TLabel;
    58     Label19: TLabel;
    5967    Label2: TLabel;
    6068    Label20: TLabel;
     
    6674    Label26: TLabel;
    6775    Label27: TLabel;
    68     LabelOrganization: TLabel;
     76    Label28: TLabel;
     77    Label29: TLabel;
    6978    Label3: TLabel;
     79    Label30: TLabel;
     80    Label31: TLabel;
     81    Label32: TLabel;
     82    Label33: TLabel;
     83    Label34: TLabel;
     84    Label35: TLabel;
     85    Label36: TLabel;
     86    Label37: TLabel;
     87    Label38: TLabel;
     88    Label39: TLabel;
    7089    Label4: TLabel;
     90    Label40: TLabel;
     91    Label41: TLabel;
     92    Label42: TLabel;
     93    Label43: TLabel;
    7194    Label5: TLabel;
    7295    Label6: TLabel;
     
    7497    Label8: TLabel;
    7598    Label9: TLabel;
     99    LabelOrganization: TLabel;
    76100    LabelOrganization1: TLabel;
    77     ListView1: TListView;
    78101    MemoNotes: TMemo;
    79102    MenuItem1: TMenuItem;
    80103    PageControlContact: TPageControl;
    81104    PopupMenu1: TPopupMenu;
     105    TabSheetWork: TTabSheet;
    82106    TabSheetGeneral: TTabSheet;
    83     TabSheetDetails: TTabSheet;
     107    TabSheetPrivate: TTabSheet;
    84108    TabSheetAll: TTabSheet;
    85     procedure AEditFieldExecute(Sender: TObject);
     109    procedure ButtonOkClick(Sender: TObject);
    86110    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    87111    procedure FormCreate(Sender: TObject);
     112    procedure FormDestroy(Sender: TObject);
    88113    procedure FormShow(Sender: TObject);
    89114    procedure ListView1Data(Sender: TObject; Item: TListItem);
    90115    procedure TabSheetAllShow(Sender: TObject);
     116    procedure TabSheetGeneralShow(Sender: TObject);
    91117  private
    92     Contact: TContact;
     118    FContact: TContact;
     119    FormProperties: TFormProperties;
     120    procedure SetContact(AValue: TContact);
    93121  public
    94     procedure ReloadFields;
    95     procedure LoadData(Contact: TContact);
    96     procedure SaveData(Contact: TContact);
     122    procedure LoadData;
     123    procedure SaveData;
     124    property Contact: TContact read FContact write SetContact;
    97125  end;
    98126
     
    118146  Core.PersistentForm1.Load(Self);
    119147  PageControlContact.TabIndex := 0;
     148
     149  FormProperties.ManualDock(TabSheetAll, nil, alClient);
     150  FormProperties.Align := alClient;
     151  FormProperties.Show;
    120152end;
    121153
     
    133165procedure TFormContact.TabSheetAllShow(Sender: TObject);
    134166begin
    135   ReloadFields;
    136 end;
    137 
    138 procedure TFormContact.ReloadFields;
    139 begin
    140   if Assigned(Contact) then begin
    141     ListView1.Items.Count := Contact.Properties.Count;
    142   end else ListView1.Items.Count := 0;
    143   ListView1.Refresh;
     167  SaveData;
     168  FormProperties.ReloadList;
     169  FormProperties.UpdateInterface;
     170end;
     171
     172procedure TFormContact.TabSheetGeneralShow(Sender: TObject);
     173begin
     174  LoadData;
     175end;
     176
     177procedure TFormContact.SetContact(AValue: TContact);
     178begin
     179  if FContact = AValue then Exit;
     180  FContact := AValue;
     181  LoadData;
    144182end;
    145183
     
    150188end;
    151189
    152 procedure TFormContact.AEditFieldExecute(Sender: TObject);
    153 begin
    154   if Assigned(ListView1.Selected) then begin
    155     TContactProperty(ListView1.Selected.Data).Values.DelimitedText :=
    156       InputBox(SFieldEdit, SEditFieldValue, TContactProperty(ListView1.Selected.Data).Values.DelimitedText);
    157   end;
     190procedure TFormContact.ButtonOkClick(Sender: TObject);
     191begin
     192  SaveData;
    158193end;
    159194
     
    162197  Core.Translator.TranslateComponentRecursive(Self);
    163198  Core.ThemeManager1.UseTheme(Self);
    164   Contact := nil;
    165 end;
    166 
    167 procedure TFormContact.LoadData(Contact: TContact);
     199  FContact := nil;
     200  FormProperties := TFormProperties.Create(nil);
     201end;
     202
     203procedure TFormContact.FormDestroy(Sender: TObject);
     204begin
     205  FreeAndNil(FormProperties);
     206end;
     207
     208procedure TFormContact.LoadData;
    168209var
    169210  Photo: string;
     
    172213  PhotoProperty: TContactProperty;
    173214begin
    174   Self.Contact := Contact;
     215  FormProperties.Properties := Contact.Properties;
     216
    175217  EditFullName.Text := Contact.Fields[cfFullName];
    176218  EditFirstName.Text := Contact.Fields[cfFirstName];
     
    184226  EditEmail.Text := Contact.Fields[cfEmail];
    185227  MemoNotes.Lines.Text := Contact.Fields[cfNote];
     228
     229  // Work
    186230  EditTitle.Text := Contact.Fields[cfTitle];
    187231  EditOrganization.Text := Contact.Fields[cfOrganization];
    188232  EditDepartment.Text := Contact.Fields[cfDepartment];
    189   EditAddress.Text := Contact.Fields[cfHomeAddress];
     233  EditAddressWorkPostOfficeBox.Text := Contact.Fields[cfWorkAddressPostOfficeBox];
     234  EditAddressWorkStreet.Text := Contact.Fields[cfWorkAddressStreet];
     235  EditAddressWorkStreetExtended.Text := Contact.Fields[cfWorkAddressStreetExtended];
     236  EditAddressWorkCity.Text := Contact.Fields[cfWorkAddressCity];
     237  EditAddressWorkRegion.Text := Contact.Fields[cfWorkAddressRegion];
     238  EditAddressWorkCountry.Text := Contact.Fields[cfWorkAddressCountry];
     239  EditAddressWorkPostalCode.Text := Contact.Fields[cfWorkAddressPostalCode];
     240  EditWebHome.Text := Contact.Fields[cfUrlWork];
     241
     242  // Private
     243  EditAddressHomePostOfficeBox.Text := Contact.Fields[cfHomeAddressPostOfficeBox];
     244  EditAddressHomeStreet.Text := Contact.Fields[cfHomeAddressStreet];
     245  EditAddressHomeStreetExtended.Text := Contact.Fields[cfHomeAddressStreetExtended];
     246  EditAddressHomeCity.Text := Contact.Fields[cfHomeAddressCity];
     247  EditAddressHomeRegion.Text := Contact.Fields[cfHomeAddressRegion];
     248  EditAddressHomeCountry.Text := Contact.Fields[cfHomeAddressCountry];
     249  EditAddressHomePostalCode.Text := Contact.Fields[cfHomeAddressPostalCode];
     250  EditWebHome.Text := Contact.Fields[cfUrlHome];
     251  EditBirthday.Text := Contact.Fields[cfDayOfBirth];
     252
    190253  EditEmailHome.Text := Contact.Fields[cfEmail];
    191   EditWebPage.Text := Contact.Fields[cfUrl];
    192   EditBirthday.Text := Contact.Fields[cfDayOfBirth];
    193 
    194254  ImagePhoto.Picture.Bitmap.Clear;
    195255  PhotoProperty := Contact.GetProperty(cfPhoto);
     
    226286end;
    227287
    228 procedure TFormContact.SaveData(Contact: TContact);
     288procedure TFormContact.SaveData;
    229289begin
    230290  Contact.Fields[cfFullName] := EditFullName.Text;
     
    239299  Contact.Fields[cfEmail] := EditEmail.Text;
    240300  Contact.Fields[cfNote] := MemoNotes.Lines.Text;
     301  Contact.Fields[cfEmail] := EditEmailHome.Text;
     302  Contact.Fields[cfDayOfBirth] := EditBirthday.Text;
     303
     304  // Work
    241305  Contact.Fields[cfTitle] := EditTitle.Text;
    242306  Contact.Fields[cfOrganization] := EditOrganization.Text;
    243307  Contact.Fields[cfDepartment] := EditDepartment.Text;
    244   Contact.Fields[cfHomeAddress] := EditAddress.Text;
    245   Contact.Fields[cfEmail] := EditEmailHome.Text;
    246   Contact.Fields[cfUrl] := EditWebPage.Text;
    247   Contact.Fields[cfDayOfBirth] := EditBirthday.Text;
     308  Contact.Fields[cfWorkAddressPostOfficeBox] := EditAddressWorkPostOfficeBox.Text;
     309  Contact.Fields[cfWorkAddressStreet] := EditAddressWorkStreet.Text;
     310  Contact.Fields[cfWorkAddressStreetExtended] := EditAddressWorkStreetExtended.Text;
     311  Contact.Fields[cfWorkAddressCity] := EditAddressWorkCity.Text;
     312  Contact.Fields[cfWorkAddressRegion] := EditAddressWorkRegion.Text;
     313  Contact.Fields[cfWorkAddressCountry] := EditAddressWorkCountry.Text;
     314  Contact.Fields[cfWorkAddressPostalCode] := EditAddressWorkPostalCode.Text;
     315  Contact.Fields[cfUrlWork] := EditWebWork.Text;
     316
     317  // Private
     318  Contact.Fields[cfHomeAddressPostOfficeBox] := EditAddressHomePostOfficeBox.Text;
     319  Contact.Fields[cfHomeAddressStreet] := EditAddressHomeStreet.Text;
     320  Contact.Fields[cfHomeAddressStreetExtended] := EditAddressHomeStreetExtended.Text;
     321  Contact.Fields[cfHomeAddressCity] := EditAddressHomeCity.Text;
     322  Contact.Fields[cfHomeAddressRegion] := EditAddressHomeRegion.Text;
     323  Contact.Fields[cfHomeAddressCountry] := EditAddressHomeCountry.Text;
     324  Contact.Fields[cfHomeAddressPostalCode] := EditAddressHomePostalCode.Text;
     325  Contact.Fields[cfUrlHome] := EditWebHome.Text;
    248326end;
    249327
  • trunk/Forms/UFormContacts.pas

    r36 r39  
    197197  FormContact := TFormContact.Create(nil);
    198198  try
    199   if FormContact.ShowModal = mrOK then begin
    200199    Contact := TContact.Create;
    201     Contact.Parent := Contacts.ContactsFile;
    202     FormContact.SaveData(Contact);
    203     Contacts.Add(Contact);
    204     Core.DataFile.Modified := True;
    205     ReloadList;
    206     UpdateInterface;
    207   end;
     200    try
     201      Contact.Parent := Contacts.ContactsFile;
     202      FormContact.Contact := Contact;
     203      if FormContact.ShowModal = mrOK then begin
     204        Contacts.Add(Contact);
     205        Contact := nil;
     206        Core.DataFile.Modified := True;
     207        ReloadList;
     208        UpdateInterface;
     209      end;
     210    finally
     211      if Assigned(Contact) then
     212        Contact.Free;
     213    end;
    208214  finally
    209215    FormContact.Free;
     
    214220var
    215221  FormContact: TFormContact;
     222  Contact: TContact;
    216223begin
    217224  FormContact := TFormContact.Create(nil);
    218225  try
    219     FormContact.LoadData(TContact(ListView1.Selected.Data));
    220     if FormContact.ShowModal = mrOK then begin
    221       FormContact.SaveData(TContact(ListView1.Selected.Data));
    222       Core.DataFile.Modified := True;
    223       ReloadList;
    224       UpdateInterface;
     226    Contact := TContact.Create;
     227    Contact.Assign(TContact(ListView1.Selected.Data));
     228    FormContact.Contact := Contact;
     229    try
     230      if FormContact.ShowModal = mrOK then begin
     231        TContact(ListView1.Selected.Data).Assign(Contact);
     232        Core.DataFile.Modified := True;
     233        ReloadList;
     234        UpdateInterface;
     235      end;
     236    finally
     237      Contact.Free;
    225238    end;
    226239  finally
Note: See TracChangeset for help on using the changeset viewer.