Changeset 52 for trunk/Forms
- Timestamp:
- Dec 3, 2021, 8:50:43 PM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r49 r52 25 25 object TabSheetGeneral: TTabSheet 26 26 Caption = 'General' 27 ClientHeight = 74 428 ClientWidth = 9 3127 ClientHeight = 742 28 ClientWidth = 929 29 29 OnHide = TabSheetGeneralHide 30 30 OnShow = TabSheetGeneralShow … … 298 298 object TabSheetHome: TTabSheet 299 299 Caption = 'Home' 300 ClientHeight = 74 4301 ClientWidth = 9 31300 ClientHeight = 742 301 ClientWidth = 929 302 302 OnHide = TabSheetHomeHide 303 303 OnShow = TabSheetHomeShow … … 394 394 Anchors = [akTop, akLeft, akRight] 395 395 Caption = 'Address' 396 ClientHeight = 21 2397 ClientWidth = 8 88396 ClientHeight = 215 397 ClientWidth = 890 398 398 TabOrder = 6 399 399 object Label36: TLabel … … 538 538 object TabSheetWork: TTabSheet 539 539 Caption = 'Work' 540 ClientHeight = 74 4541 ClientWidth = 9 31540 ClientHeight = 742 541 ClientWidth = 929 542 542 OnHide = TabSheetWorkHide 543 543 OnShow = TabSheetWorkShow … … 616 616 Width = 911 617 617 Caption = 'Address' 618 ClientHeight = 2 17619 ClientWidth = 90 7618 ClientHeight = 220 619 ClientWidth = 909 620 620 TabOrder = 4 621 621 object Label31: TLabel … … 827 827 object TabSheetOthers: TTabSheet 828 828 Caption = 'Others' 829 ClientHeight = 74 4830 ClientWidth = 9 31829 ClientHeight = 742 830 ClientWidth = 929 831 831 OnHide = TabSheetOthersHide 832 832 OnShow = TabSheetOthersShow -
trunk/Forms/UFormContacts.lfm
r51 r52 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 8 0116 Height = 810 17 17 Top = 0 18 18 Width = 1210 … … 58 58 Left = 0 59 59 Height = 39 60 Top = 8 3360 Top = 842 61 61 Width = 1210 62 62 Align = alBottom … … 90 90 Left = 0 91 91 Height = 32 92 Top = 8 0192 Top = 810 93 93 Width = 1210 94 94 OnChange = ListViewFilter1Change … … 97 97 object StatusBar1: TStatusBar 98 98 Left = 0 99 Height = 36100 Top = 8 7299 Height = 27 100 Top = 881 101 101 Width = 1210 102 102 Panels = < -
trunk/Forms/UFormContacts.pas
r51 r52 53 53 private 54 54 FContacts: TContacts; 55 FUpdateCount: Integer; 55 56 procedure FilterList(List: TFPGObjectList<TObject>); 56 57 procedure SetContacts(AValue: TContacts); 57 58 procedure FormContactPrevious(Sender: TObject); 58 59 procedure FormContactNext(Sender: TObject); 60 procedure DoUpdateInterface; 59 61 public 60 62 property Contacts: TContacts read FContacts write SetContacts; 61 63 procedure ReloadList; 64 procedure BeginUpdate; 65 procedure EndUpdate; 62 66 procedure UpdateInterface; 63 67 end; … … 80 84 SFiltered = 'Filtered'; 81 85 SSelected = 'Selected'; 86 SEndUpdateTooLow = 'Update counter error'; 82 87 83 88 { TFormContacts } … … 99 104 if Item.Index < ListViewSort1.List.Count then 100 105 with TContact(ListViewSort1.List[Item.Index]) do begin 101 102 106 AddItem(Fields[cfFullName], True); 103 107 AddItem(Fields[cfFirstName]); … … 220 224 end; 221 225 226 procedure TFormContacts.DoUpdateInterface; 227 var 228 Text: string; 229 SelectedCount: Integer; 230 begin 231 AAdd.Enabled := Assigned(Contacts); 232 AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 233 ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 234 235 Text := ''; 236 if Assigned(Contacts) then begin 237 Text := STotal + ': ' + IntToStr(Contacts.Count); 238 if ListView1.Items.Count < Contacts.Count then 239 Text := Text + ', ' + SFiltered + ': ' + IntToStr(ListView1.Items.Count); 240 SelectedCount := ListView1.SelCount; 241 if SelectedCount > 0 then 242 Text := Text + ', ' + SSelected + ': ' + IntToStr(SelectedCount); 243 end; 244 StatusBar1.Panels[0].Text := Text; 245 end; 246 222 247 procedure TFormContacts.FormShow(Sender: TObject); 223 248 begin … … 268 293 Contact := TContact.Create; 269 294 try 295 Contact.Parent := Contacts.ContactsFile; 270 296 Contact.Assign(TContact(ListView1.Selected.Data)); 271 297 FormContact.Contact := Contact; … … 297 323 Contact := TContact.Create; 298 324 try 325 Contact.Parent := Contacts.ContactsFile; 299 326 Contact.Assign(TContact(ListView1.Selected.Data)); 300 327 FormContact.Contact := Contact; … … 333 360 334 361 procedure TFormContacts.ASelectAllExecute(Sender: TObject); 335 begin 336 ListView1.SelectAll; 337 UpdateInterface; 362 var 363 I: Integer; 364 begin 365 BeginUpdate; 366 ListView1.BeginUpdate; 367 for I := 0 to ListView1.Items.Count - 1 do 368 ListView1.Items[I].Selected := True; 369 //ListView1.SelectAll; 370 ListView1.EndUpdate; 371 EndUpdate; 338 372 end; 339 373 … … 360 394 end; 361 395 396 procedure TFormContacts.BeginUpdate; 397 begin 398 Inc(FUpdateCount); 399 end; 400 401 procedure TFormContacts.EndUpdate; 402 begin 403 if FUpdateCount <= 0 then raise Exception(SEndUpdateTooLow); 404 Dec(FUpdateCount); 405 if FUpdateCount = 0 then DoUpdateInterface; 406 end; 407 362 408 procedure TFormContacts.UpdateInterface; 363 var 364 Text: string; 365 SelectedCount: Integer; 366 begin 367 AAdd.Enabled := Assigned(Contacts); 368 AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 369 ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 370 371 Text := ''; 372 if Assigned(Contacts) then begin 373 Text := STotal + ': ' + IntToStr(Contacts.Count); 374 if ListView1.Items.Count < Contacts.Count then 375 Text := Text + ', ' + SFiltered + ': ' + IntToStr(ListView1.Items.Count); 376 SelectedCount := ListView1.SelCount; 377 if SelectedCount > 0 then 378 Text := Text + ', ' + SSelected + ': ' + IntToStr(SelectedCount); 379 end; 380 StatusBar1.Panels[0].Text := Text; 409 begin 410 if FUpdateCount = 0 then DoUpdateInterface; 381 411 end; 382 412 -
trunk/Forms/UFormProperties.lfm
r51 r52 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 8 0116 Height = 810 17 17 Top = 0 18 18 Width = 1210 … … 46 46 Left = 0 47 47 Height = 39 48 Top = 8 3348 Top = 842 49 49 Width = 1210 50 50 Align = alBottom … … 73 73 Left = 0 74 74 Height = 32 75 Top = 8 0175 Top = 810 76 76 Width = 1210 77 77 OnChange = ListViewFilter1Change … … 80 80 object StatusBar1: TStatusBar 81 81 Left = 0 82 Height = 3683 Top = 8 7282 Height = 27 83 Top = 881 84 84 Width = 1210 85 85 Panels = <
Note:
See TracChangeset
for help on using the changeset viewer.