Changeset 43 for trunk


Ignore:
Timestamp:
Dec 2, 2021, 2:13:03 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: List of contacts may not be reloaded on file open.
  • Modified: Preparation for previous/next contact actions.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.lfm

    r42 r43  
    1818    Top = 8
    1919    Width = 939
    20     ActivePage = TabSheetOthers
     20    ActivePage = TabSheetGeneral
    2121    Anchors = [akTop, akLeft, akRight, akBottom]
    2222    ParentFont = False
    23     TabIndex = 3
     23    TabIndex = 0
    2424    TabOrder = 0
    2525    object TabSheetGeneral: TTabSheet
     
    3030      ParentFont = False
    3131      object Label1: TLabel
    32         Left = 16
    33         Height = 24
    34         Top = 72
     32        Left = 240
     33        Height = 24
     34        Top = 80
    3535        Width = 94
    3636        Caption = 'First name:'
     
    3939      end
    4040      object EditFirstName: TEdit
    41         Left = 144
    42         Height = 42
    43         Top = 64
    44         Width = 254
     41        Left = 360
     42        Height = 42
     43        Top = 72
     44        Width = 155
    4545        ParentFont = False
    4646        TabOrder = 0
     
    4949        Left = 16
    5050        Height = 24
    51         Top = 226
     51        Top = 250
    5252        Width = 63
    5353        Caption = 'Mobile:'
     
    5858        Left = 144
    5959        Height = 42
    60         Top = 216
     60        Top = 240
    6161        Width = 254
    6262        ParentFont = False
     
    6666        Left = 144
    6767        Height = 42
    68         Top = 262
     68        Top = 286
    6969        Width = 254
    7070        ParentFont = False
     
    7474        Left = 16
    7575        Height = 24
    76         Top = 266
     76        Top = 290
    7777        Width = 59
    7878        Caption = 'Phone:'
     
    8383        Left = 144
    8484        Height = 42
    85         Top = 304
     85        Top = 328
    8686        Width = 254
    8787        ParentFont = False
     
    9191        Left = 16
    9292        Height = 24
    93         Top = 312
     93        Top = 336
    9494        Width = 58
    9595        Caption = 'E-mail:'
     
    9898      end
    9999      object EditLastName: TEdit
    100         Left = 575
    101         Height = 42
    102         Top = 64
    103         Width = 254
     100        Left = 671
     101        Height = 42
     102        Top = 72
     103        Width = 155
    104104        ParentFont = False
    105105        TabOrder = 4
    106106      end
    107107      object Label5: TLabel
    108         Left = 432
    109         Height = 24
    110         Top = 72
     108        Left = 536
     109        Height = 24
     110        Top = 80
    111111        Width = 87
    112112        Caption = 'Last name'
     
    117117        Left = 144
    118118        Height = 42
    119         Top = 400
     119        Top = 424
    120120        Width = 254
    121121        ParentFont = False
     
    125125        Left = 16
    126126        Height = 24
    127         Top = 408
     127        Top = 432
    128128        Width = 76
    129129        Caption = 'Birthday:'
     
    134134        Left = 16
    135135        Height = 210
    136         Top = 496
     136        Top = 16
    137137        Width = 207
    138138        Proportional = True
    139139        Stretch = True
    140140      end
    141       object Label23: TLabel
    142         Left = 16
    143         Height = 24
    144         Top = 456
    145         Width = 55
    146         Caption = 'Photo:'
    147         ParentColor = False
    148         ParentFont = False
    149       end
    150141      object Label24: TLabel
    151         Left = 16
    152         Height = 24
    153         Top = 24
     142        Left = 240
     143        Height = 24
     144        Top = 32
    154145        Width = 88
    155146        Caption = 'Full name:'
     
    158149      end
    159150      object EditFullName: TEdit
    160         Left = 144
    161         Height = 42
    162         Top = 16
    163         Width = 254
     151        Left = 360
     152        Height = 42
     153        Top = 24
     154        Width = 467
    164155        ParentFont = False
    165156        TabOrder = 6
    166157      end
    167158      object Label25: TLabel
    168         Left = 432
    169         Height = 24
    170         Top = 24
     159        Left = 536
     160        Height = 24
     161        Top = 128
    171162        Width = 116
    172163        Caption = 'Middle name:'
     
    175166      end
    176167      object EditMiddleName: TEdit
    177         Left = 575
    178         Height = 42
    179         Top = 16
    180         Width = 254
     168        Left = 671
     169        Height = 42
     170        Top = 120
     171        Width = 155
    181172        ParentFont = False
    182173        TabOrder = 7
    183174      end
    184175      object Label26: TLabel
    185         Left = 16
    186         Height = 24
    187         Top = 120
     176        Left = 240
     177        Height = 24
     178        Top = 176
    188179        Width = 101
    189180        Caption = 'Title before:'
     
    192183      end
    193184      object EditTitleBefore: TEdit
    194         Left = 144
    195         Height = 42
    196         Top = 112
    197         Width = 254
     185        Left = 360
     186        Height = 42
     187        Top = 168
     188        Width = 155
    198189        ParentFont = False
    199190        TabOrder = 8
    200191      end
    201192      object Label27: TLabel
    202         Left = 432
    203         Height = 24
    204         Top = 120
     193        Left = 536
     194        Height = 24
     195        Top = 176
    205196        Width = 85
    206197        Caption = 'Title after:'
     
    209200      end
    210201      object EditTitleAfter: TEdit
    211         Left = 575
    212         Height = 42
    213         Top = 112
    214         Width = 254
     202        Left = 671
     203        Height = 42
     204        Top = 168
     205        Width = 155
    215206        ParentFont = False
    216207        TabOrder = 9
    217208      end
    218209      object Label44: TLabel
    219         Left = 16
    220         Height = 24
    221         Top = 168
     210        Left = 240
     211        Height = 24
     212        Top = 128
    222213        Width = 91
    223214        Caption = 'Nickname:'
     
    226217      end
    227218      object EditNickName: TEdit
    228         Left = 144
    229         Height = 42
    230         Top = 160
    231         Width = 254
     219        Left = 360
     220        Height = 42
     221        Top = 120
     222        Width = 155
    232223        ParentFont = False
    233224        TabOrder = 10
     
    236227        Left = 432
    237228        Height = 24
    238         Top = 408
     229        Top = 432
    239230        Width = 105
    240231        Caption = 'Anniversary:'
     
    245236        Left = 575
    246237        Height = 42
    247         Top = 400
     238        Top = 424
    248239        Width = 254
    249240        ParentFont = False
     
    253244        Left = 432
    254245        Height = 24
    255         Top = 224
     246        Top = 248
    256247        Width = 34
    257248        Caption = 'Fax:'
     
    262253        Left = 575
    263254        Height = 42
    264         Top = 216
     255        Top = 240
    265256        Width = 254
    266257        ParentFont = False
     
    270261        Left = 575
    271262        Height = 42
    272         Top = 262
     263        Top = 286
    273264        Width = 254
    274265        ParentFont = False
     
    278269        Left = 432
    279270        Height = 24
    280         Top = 266
     271        Top = 290
    281272        Width = 54
    282273        Caption = 'Pager:'
     
    287278        Left = 16
    288279        Height = 24
    289         Top = 360
     280        Top = 384
    290281        Width = 114
    291282        Caption = 'Web address:'
     
    296287        Left = 144
    297288        Height = 42
    298         Top = 352
     289        Top = 376
    299290        Width = 683
    300291        ParentFont = False
     
    883874    TabOrder = 2
    884875  end
     876  object ButtonPrevious: TButton
     877    Left = 8
     878    Height = 37
     879    Top = 800
     880    Width = 119
     881    Anchors = [akLeft, akBottom]
     882    Caption = 'Previous'
     883    OnClick = ButtonPreviousClick
     884    ParentFont = False
     885    TabOrder = 3
     886    Visible = False
     887  end
     888  object ButtonNext: TButton
     889    Left = 144
     890    Height = 37
     891    Top = 800
     892    Width = 115
     893    Anchors = [akLeft, akBottom]
     894    Caption = 'Next'
     895    OnClick = ButtonNextClick
     896    ParentFont = False
     897    TabOrder = 4
     898    Visible = False
     899  end
    885900  object ActionList1: TActionList
    886901    Images = Core.ImageList1
    887     Left = 320
    888     Top = 568
     902    Left = 848
     903    Top = 488
    889904    object AEditField: TAction
    890905      Caption = 'Edit'
     
    893908  object PopupMenu1: TPopupMenu
    894909    Images = Core.ImageList1
    895     Left = 184
    896     Top = 568
     910    Left = 856
     911    Top = 368
    897912    object MenuItem1: TMenuItem
    898913      Action = AEditField
  • trunk/Forms/UFormContact.lrj

    r40 r43  
    88{"hash":174528181,"name":"tformcontact.label5.caption","sourcebytes":[76,97,115,116,32,110,97,109,101],"value":"Last name"},
    99{"hash":162456010,"name":"tformcontact.label22.caption","sourcebytes":[66,105,114,116,104,100,97,121,58],"value":"Birthday:"},
    10 {"hash":91188010,"name":"tformcontact.label23.caption","sourcebytes":[80,104,111,116,111,58],"value":"Photo:"},
    1110{"hash":242270122,"name":"tformcontact.label24.caption","sourcebytes":[70,117,108,108,32,110,97,109,101,58],"value":"Full name:"},
    1211{"hash":40626346,"name":"tformcontact.label25.caption","sourcebytes":[77,105,100,100,108,101,32,110,97,109,101,58],"value":"Middle name:"},
     
    5655{"hash":77089212,"name":"tformcontact.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"},
    5756{"hash":1339,"name":"tformcontact.buttonok.caption","sourcebytes":[79,75],"value":"OK"},
     57{"hash":147653555,"name":"tformcontact.buttonprevious.caption","sourcebytes":[80,114,101,118,105,111,117,115],"value":"Previous"},
     58{"hash":347380,"name":"tformcontact.buttonnext.caption","sourcebytes":[78,101,120,116],"value":"Next"},
    5859{"hash":310020,"name":"tformcontact.aeditfield.caption","sourcebytes":[69,100,105,116],"value":"Edit"}
    5960]}
  • trunk/Forms/UFormContact.pas

    r42 r43  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, ActnList, Menus, ExtCtrls, UContact, base64, UFormProperties;
     9  ComCtrls, ActnList, Menus, ExtCtrls, UContact, UFormProperties;
    1010
    1111type
     
    1717    ActionList1: TActionList;
    1818    ButtonCancel: TButton;
     19    ButtonNext: TButton;
    1920    ButtonOk: TButton;
     21    ButtonPrevious: TButton;
    2022    EditHomeAddressCity: TEdit;
    2123    EditHomeAddressCountry: TEdit;
     
    7880    Label2: TLabel;
    7981    Label22: TLabel;
    80     Label23: TLabel;
    8182    Label24: TLabel;
    8283    Label25: TLabel;
     
    120121    TabSheetGeneral: TTabSheet;
    121122    TabSheetAll: TTabSheet;
     123    procedure ButtonNextClick(Sender: TObject);
    122124    procedure ButtonOkClick(Sender: TObject);
     125    procedure ButtonPreviousClick(Sender: TObject);
    123126    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    124127    procedure FormCreate(Sender: TObject);
     
    130133  private
    131134    FContact: TContact;
     135    FOnNext: TNotifyEvent;
     136    FOnPrevious: TNotifyEvent;
    132137    FormProperties: TFormProperties;
    133138    procedure SetContact(AValue: TContact);
     
    136141    procedure SaveData;
    137142    property Contact: TContact read FContact write SetContact;
     143    property OnPrevious: TNotifyEvent read FOnPrevious write FOnPrevious;
     144    property OnNext: TNotifyEvent read FOnNext write FOnNext;
    138145  end;
    139146
     
    148155uses
    149156  UCore;
    150 
    151 resourcestring
    152   SFieldEdit = 'Field edit';
    153   SEditFieldValue = 'Edit field value';
    154157
    155158{ TFormContact }
     
    204207begin
    205208  SaveData;
     209end;
     210
     211procedure TFormContact.ButtonNextClick(Sender: TObject);
     212begin
     213  if Assigned(FOnNext) then FOnNext(Self);
     214end;
     215
     216procedure TFormContact.ButtonPreviousClick(Sender: TObject);
     217begin
     218  if Assigned(FOnPrevious) then FOnPrevious(Self);
    206219end;
    207220
  • trunk/Forms/UFormContacts.pas

    r42 r43  
    5151    procedure FilterList(List: TFPGObjectList<TObject>);
    5252    procedure SetContacts(AValue: TContacts);
     53    procedure FormContactPrevious(Sender: TObject);
     54    procedure FormContactNext(Sender: TObject);
    5355  public
    5456    property Contacts: TContacts read FContacts write SetContacts;
     
    183185end;
    184186
     187procedure TFormContacts.FormContactPrevious(Sender: TObject);
     188var
     189  I: Integer;
     190begin
     191  I := ListViewSort1.List.IndexOf(TFormContact(Sender).Contact);
     192  if (I <> -1) and (I > 0) then
     193    TFormContact(Sender).Contact := TContact(ListViewSort1.List[I - 1]);
     194end;
     195
     196procedure TFormContacts.FormContactNext(Sender: TObject);
     197var
     198  I: Integer;
     199begin
     200  I := ListViewSort1.List.IndexOf(TFormContact(Sender).Contact);
     201  if (I <> -1) and (I < ListViewSort1.List.Count - 1) then
     202    TFormContact(Sender).Contact := TContact(ListViewSort1.List[I + 1]);
     203end;
     204
    185205procedure TFormContacts.FormShow(Sender: TObject);
    186206begin
     
    204224      Contact.Parent := Contacts.ContactsFile;
    205225      FormContact.Contact := Contact;
     226      FormContact.OnPrevious := FormContactPrevious;
     227      FormContact.OnNext := FormContactNext;
    206228      if FormContact.ShowModal = mrOK then begin
    207229        Contacts.Add(Contact);
     
    230252    Contact.Assign(TContact(ListView1.Selected.Data));
    231253    FormContact.Contact := Contact;
     254    FormContact.OnPrevious := FormContactPrevious;
     255    FormContact.OnNext := FormContactNext;
    232256    try
    233257      if FormContact.ShowModal = mrOK then begin
  • trunk/Languages/vCardStudio.cs.po

    r40 r43  
    8383msgstr "Zrušit"
    8484
     85#: tformcontact.buttonnext.caption
     86msgid "Next"
     87msgstr "Další"
     88
    8589#: tformcontact.buttonok.caption
    8690msgctxt "tformcontact.buttonok.caption"
     
    8892msgstr "OK"
    8993
     94#: tformcontact.buttonprevious.caption
     95msgid "Previous"
     96msgstr "Předchozí"
     97
    9098#: tformcontact.caption
    9199msgid "Contact"
     
    164172msgstr "Narozeniny:"
    165173
    166 #: tformcontact.label23.caption
    167 msgid "Photo:"
    168 msgstr "Fotka:"
    169 
    170174#: tformcontact.label24.caption
    171175msgid "Full name:"
     
    498502msgctxt "tformproperties.listview1.columns[0].caption"
    499503msgid "Name"
    500 msgstr "Jméno:"
     504msgstr "Jméno"
    501505
    502506#: tformproperties.listview1.columns[1].caption
     
    596600#: ucontact.sfax
    597601msgid "Fax"
    598 msgstr ""
     602msgstr "Fax"
    599603
    600604#: ucontact.sfieldindexnotdefined
     
    649653#: ucontact.shomeemail
    650654msgid "Home E-mail"
    651 msgstr "Domácí E-mail"
     655msgstr "Domov E-mail"
    652656
    653657#: ucontact.shomefax
    654658msgid "Home fax"
    655 msgstr ""
     659msgstr "Domov fax"
    656660
    657661#: ucontact.shomemobile
    658662msgid "Home mobile"
    659 msgstr ""
     663msgstr "Domov mobil"
    660664
    661665#: ucontact.shomepager
    662666msgid "Home pager"
    663 msgstr ""
     667msgstr "Domov pager"
    664668
    665669#: ucontact.shomephone
    666670msgctxt "ucontact.shomephone"
    667671msgid "Home phone"
    668 msgstr "Domácí telefon"
     672msgstr "Domov telefon"
    669673
    670674#: ucontact.shomephone2
    671675msgid "Home phone 2"
    672 msgstr "Domácí telefon 2"
     676msgstr "Domov telefon 2"
    673677
    674678#: ucontact.sinternetemail
     
    699703#: ucontact.smobilephone
    700704msgid "Mobile phone"
    701 msgstr ""
     705msgstr "Mobil"
    702706
    703707#: ucontact.snickname
     
    715719#: ucontact.spager
    716720msgid "Pager"
    717 msgstr ""
     721msgstr "Pager"
    718722
    719723#: ucontact.sphoto
     
    764768#: ucontact.swebaddress
    765769msgid "Web address"
    766 msgstr ""
     770msgstr "Webová adresa"
    767771
    768772#: ucontact.swebaddresshome
     
    804808#: ucontact.sworkemail
    805809msgid "Work E-mail"
    806 msgstr ""
     810msgstr "Práce E-mail"
    807811
    808812#: ucontact.sworkfax
    809813msgid "Work fax"
    810 msgstr ""
     814msgstr "Práce fax"
    811815
    812816#: ucontact.sworkmobile
    813817msgid "Work mobile"
    814 msgstr ""
     818msgstr "Práce mobil"
    815819
    816820#: ucontact.sworkpager
    817821msgid "Work pager"
    818 msgstr ""
     822msgstr "Práce pager"
    819823
    820824#: ucontact.sworkphone
  • trunk/Languages/vCardStudio.po

    r40 r43  
    7373msgstr ""
    7474
     75#: tformcontact.buttonnext.caption
     76msgid "Next"
     77msgstr ""
     78
    7579#: tformcontact.buttonok.caption
    7680msgctxt "tformcontact.buttonok.caption"
     
    7882msgstr ""
    7983
     84#: tformcontact.buttonprevious.caption
     85msgid "Previous"
     86msgstr ""
     87
    8088#: tformcontact.caption
    8189msgid "Contact"
     
    154162msgstr ""
    155163
    156 #: tformcontact.label23.caption
    157 msgid "Photo:"
    158 msgstr ""
    159 
    160164#: tformcontact.label24.caption
    161165msgid "Full name:"
  • trunk/UCore.pas

    r42 r43  
    401401      FormContacts.Contacts := TContactsFile(DataFile).Contacts
    402402      else FormContacts.Contacts := nil;
     403    FormContacts.ReloadList;
     404    FormContacts.UpdateInterface;
    403405  end;
    404406end;
Note: See TracChangeset for help on using the changeset viewer.