- Timestamp:
- Dec 3, 2021, 7:44:05 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.lfm
r36 r51 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 8 1016 Height = 801 17 17 Top = 0 18 18 Width = 1210 … … 58 58 Left = 0 59 59 Height = 39 60 Top = 8 4260 Top = 833 61 61 Width = 1210 62 62 Align = alBottom … … 77 77 end 78 78 object ToolButton3: TToolButton 79 Left = 106 80 Top = 2 81 Action = ARemove 82 end 83 object ToolButton4: TToolButton 79 84 Left = 71 80 85 Top = 2 81 Action = A Remove86 Action = AClone 82 87 end 83 88 end … … 85 90 Left = 0 86 91 Height = 32 87 Top = 8 1092 Top = 801 88 93 Width = 1210 89 94 OnChange = ListViewFilter1Change … … 92 97 object StatusBar1: TStatusBar 93 98 Left = 0 94 Height = 2795 Top = 8 8199 Height = 36 100 Top = 872 96 101 Width = 1210 97 102 Panels = < … … 108 113 Action = AAdd 109 114 end 115 object MenuItem2: TMenuItem 116 Action = AModify 117 end 118 object MenuItem5: TMenuItem 119 Action = AClone 120 end 110 121 object MenuItem3: TMenuItem 111 122 Action = ARemove 112 end113 object MenuItem2: TMenuItem114 Action = AModify115 123 end 116 124 object MenuItem4: TMenuItem … … 145 153 ShortCut = 16449 146 154 end 155 object AClone: TAction 156 Caption = 'Clone' 157 ImageIndex = 11 158 OnExecute = ACloneExecute 159 end 147 160 end 148 161 object ListViewSort1: TListViewSort -
trunk/Forms/UFormContacts.lrj
r21 r51 10 10 {"hash":88453081,"name":"tformcontacts.amodify.caption","sourcebytes":[77,111,100,105,102,121],"value":"Modify"}, 11 11 {"hash":93079237,"name":"tformcontacts.aremove.caption","sourcebytes":[82,101,109,111,118,101],"value":"Remove"}, 12 {"hash":195296268,"name":"tformcontacts.aselectall.caption","sourcebytes":[83,101,108,101,99,116,32,97,108,108],"value":"Select all"} 12 {"hash":195296268,"name":"tformcontacts.aselectall.caption","sourcebytes":[83,101,108,101,99,116,32,97,108,108],"value":"Select all"}, 13 {"hash":4863557,"name":"tformcontacts.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"} 13 14 ]} -
trunk/Forms/UFormContacts.pas
r43 r51 15 15 TFormContacts = class(TForm) 16 16 AAdd: TAction; 17 AClone: TAction; 17 18 ASelectAll: TAction; 18 19 ARemove: TAction; … … 26 27 MenuItem3: TMenuItem; 27 28 MenuItem4: TMenuItem; 29 MenuItem5: TMenuItem; 28 30 PopupMenuContact: TPopupMenu; 29 31 StatusBar1: TStatusBar; … … 32 34 ToolButton2: TToolButton; 33 35 ToolButton3: TToolButton; 36 ToolButton4: TToolButton; 34 37 procedure AAddExecute(Sender: TObject); 38 procedure ACloneExecute(Sender: TObject); 35 39 procedure AModifyExecute(Sender: TObject); 36 40 procedure ARemoveExecute(Sender: TObject); … … 80 84 81 85 procedure TFormContacts.ListView1Data(Sender: TObject; Item: TListItem); 86 87 procedure AddItem(Text: string; IsCaption: Boolean = False); 88 begin 89 if IsCaption then begin 90 if Text <> '' then Item.Caption := Text 91 else Item.Caption := ' '; 92 end else begin 93 if Text <> '' then Item.SubItems.Add(Text) 94 else Item.SubItems.Add(' '); 95 end; 96 end; 97 82 98 begin 83 99 if Item.Index < ListViewSort1.List.Count then 84 100 with TContact(ListViewSort1.List[Item.Index]) do begin 85 Item.Caption := Fields[cfFullName]; 86 Item.SubItems.Add(Fields[cfFirstName]); 87 Item.SubItems.Add(Fields[cfMiddleName]); 88 Item.SubItems.Add(Fields[cfLastName]); 89 Item.SubItems.Add(Fields[cfTelCell]); 90 Item.SubItems.Add(Fields[cfTelHome]); 101 102 AddItem(Fields[cfFullName], True); 103 AddItem(Fields[cfFirstName]); 104 AddItem(Fields[cfMiddleName]); 105 AddItem(Fields[cfLastName]); 106 AddItem(Fields[cfTelCell]); 107 AddItem(Fields[cfTelHome]); 91 108 Item.Data := ListViewSort1.List[Item.Index]; 92 109 end; … … 228 245 if FormContact.ShowModal = mrOK then begin 229 246 Contacts.Add(Contact); 247 Core.DataFile.Modified := True; 248 ReloadList; 249 UpdateInterface; 250 Contact := nil; 251 end; 252 finally 253 if Assigned(Contact) then 254 Contact.Free; 255 end; 256 finally 257 FormContact.Free; 258 end; 259 end; 260 261 procedure TFormContacts.ACloneExecute(Sender: TObject); 262 var 263 FormContact: TFormContact; 264 Contact: TContact; 265 begin 266 FormContact := TFormContact.Create(nil); 267 try 268 Contact := TContact.Create; 269 try 270 Contact.Assign(TContact(ListView1.Selected.Data)); 271 FormContact.Contact := Contact; 272 FormContact.OnPrevious := FormContactPrevious; 273 FormContact.OnNext := FormContactNext; 274 if FormContact.ShowModal = mrOK then begin 275 Contacts.Add(Contact); 230 276 Contact := nil; 231 277 Core.DataFile.Modified := True; … … 250 296 try 251 297 Contact := TContact.Create; 252 Contact.Assign(TContact(ListView1.Selected.Data));253 FormContact.Contact := Contact;254 FormContact.OnPrevious := FormContactPrevious;255 FormContact.OnNext := FormContactNext;256 298 try 299 Contact.Assign(TContact(ListView1.Selected.Data)); 300 FormContact.Contact := Contact; 301 FormContact.OnPrevious := FormContactPrevious; 302 FormContact.OnNext := FormContactNext; 257 303 if FormContact.ShowModal = mrOK then begin 258 304 TContact(ListView1.Selected.Data).Assign(Contact); -
trunk/Forms/UFormProperties.lfm
r39 r51 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 8 1016 Height = 801 17 17 Top = 0 18 18 Width = 1210 … … 46 46 Left = 0 47 47 Height = 39 48 Top = 8 4248 Top = 833 49 49 Width = 1210 50 50 Align = alBottom … … 73 73 Left = 0 74 74 Height = 32 75 Top = 8 1075 Top = 801 76 76 Width = 1210 77 77 OnChange = ListViewFilter1Change … … 80 80 object StatusBar1: TStatusBar 81 81 Left = 0 82 Height = 2783 Top = 8 8182 Height = 36 83 Top = 872 84 84 Width = 1210 85 85 Panels = < … … 96 96 Action = AAdd 97 97 end 98 object MenuItem2: TMenuItem 99 Action = AModify 100 end 101 object MenuItem5: TMenuItem 102 Action = AClone 103 end 98 104 object MenuItem3: TMenuItem 99 105 Action = ARemove 100 end101 object MenuItem2: TMenuItem102 Action = AModify103 106 end 104 107 object MenuItem4: TMenuItem … … 133 136 ShortCut = 16449 134 137 end 138 object AClone: TAction 139 Caption = 'Clone' 140 ImageIndex = 11 141 OnExecute = ACloneExecute 142 end 135 143 end 136 144 object ListViewSort1: TListViewSort -
trunk/Forms/UFormProperties.lrj
r39 r51 7 7 {"hash":88453081,"name":"tformproperties.amodify.caption","sourcebytes":[77,111,100,105,102,121],"value":"Modify"}, 8 8 {"hash":93079237,"name":"tformproperties.aremove.caption","sourcebytes":[82,101,109,111,118,101],"value":"Remove"}, 9 {"hash":195296268,"name":"tformproperties.aselectall.caption","sourcebytes":[83,101,108,101,99,116,32,97,108,108],"value":"Select all"} 9 {"hash":195296268,"name":"tformproperties.aselectall.caption","sourcebytes":[83,101,108,101,99,116,32,97,108,108],"value":"Select all"}, 10 {"hash":4863557,"name":"tformproperties.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"} 10 11 ]} -
trunk/Forms/UFormProperties.pas
r42 r51 15 15 TFormProperties = class(TForm) 16 16 AAdd: TAction; 17 AClone: TAction; 17 18 ASelectAll: TAction; 18 19 ARemove: TAction; … … 26 27 MenuItem3: TMenuItem; 27 28 MenuItem4: TMenuItem; 29 MenuItem5: TMenuItem; 28 30 PopupMenuField: TPopupMenu; 29 31 StatusBar1: TStatusBar; … … 33 35 ToolButton3: TToolButton; 34 36 procedure AAddExecute(Sender: TObject); 37 procedure ACloneExecute(Sender: TObject); 35 38 procedure AModifyExecute(Sender: TObject); 36 39 procedure ARemoveExecute(Sender: TObject); … … 78 81 79 82 procedure TFormProperties.ListView1Data(Sender: TObject; Item: TListItem); 83 84 procedure AddItem(Text: string; IsCaption: Boolean = False); 85 begin 86 if IsCaption then begin 87 if Text <> '' then Item.Caption := Text 88 else Item.Caption := ' '; 89 end else begin 90 if Text <> '' then Item.SubItems.Add(Text) 91 else Item.SubItems.Add(' '); 92 end; 93 end; 94 80 95 begin 81 96 if Item.Index < ListViewSort1.List.Count then 82 97 with TContactProperty(ListViewSort1.List[Item.Index]) do begin 83 Item.Caption := Name;84 Item.SubItems.Add(Attributes.DelimitedText);85 Item.SubItems.Add(Value);98 AddItem(Name, True); 99 AddItem(Attributes.DelimitedText); 100 AddItem(Value); 86 101 Item.Data := ListViewSort1.List[Item.Index]; 87 102 end; … … 204 219 end; 205 220 221 procedure TFormProperties.ACloneExecute(Sender: TObject); 222 var 223 FormProperty: TFormProperty; 224 ContactProperty: TContactProperty; 225 begin 226 FormProperty := TFormProperty.Create(nil); 227 try 228 ContactProperty := TContactProperty.Create; 229 ContactProperty.Assign(TContactProperty(ListView1.Selected.Data)); 230 FormProperty.ContactProperty := ContactProperty; 231 try 232 if FormProperty.ShowModal = mrOK then begin 233 Properties.Add(ContactProperty); 234 ContactProperty := nil; 235 Core.DataFile.Modified := True; 236 ReloadList; 237 UpdateInterface; 238 end; 239 finally 240 if Assigned(ContactProperty) then 241 ContactProperty.Free; 242 end; 243 finally 244 FormProperty.Free; 245 end; 246 end; 247 206 248 procedure TFormProperties.AModifyExecute(Sender: TObject); 207 249 var -
trunk/Languages/vCardStudio.cs.po
r49 r51 72 72 msgstr "Nastavení" 73 73 74 #: tformcontact.aphotoclear.caption 74 75 msgid "Clear" 75 76 msgstr "Vyčistit" … … 352 353 msgstr "Přidat" 353 354 355 #: tformcontacts.aclone.caption 356 msgctxt "tformcontacts.aclone.caption" 357 msgid "Clone" 358 msgstr "Klonovat" 359 354 360 #: tformcontacts.amodify.caption 355 361 msgctxt "tformcontacts.amodify.caption" … … 484 490 msgstr "Přidat" 485 491 492 #: tformproperties.aclone.caption 493 msgctxt "tformproperties.aclone.caption" 494 msgid "Clone" 495 msgstr "Klonovat" 496 486 497 #: tformproperties.amodify.caption 487 498 msgctxt "tformproperties.amodify.caption" -
trunk/Languages/vCardStudio.po
r49 r51 343 343 msgstr "" 344 344 345 #: tformcontacts.aclone.caption 346 msgctxt "tformcontacts.aclone.caption" 347 msgid "Clone" 348 msgstr "" 349 345 350 #: tformcontacts.amodify.caption 346 351 msgctxt "tformcontacts.amodify.caption" … … 473 478 msgstr "" 474 479 480 #: tformproperties.aclone.caption 481 msgctxt "tformproperties.aclone.caption" 482 msgid "Clone" 483 msgstr "" 484 475 485 #: tformproperties.amodify.caption 476 486 msgctxt "tformproperties.amodify.caption"
Note:
See TracChangeset
for help on using the changeset viewer.