Ignore:
Timestamp:
Nov 25, 2021, 1:51:20 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Memory allocation during files merge.
  • Fixed: Select all context menu action was not selecting all items.
  • Modified: Statusbar moved into contacts form and it is now showin total, filtered and selected number of items.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.pas

    r32 r34  
    2727    MenuItem4: TMenuItem;
    2828    PopupMenuContact: TPopupMenu;
     29    StatusBar1: TStatusBar;
    2930    ToolBar1: TToolBar;
    3031    ToolButton1: TToolButton;
     
    7071  SRemoveContacts = 'Remove contacts';
    7172  SRemoveContactsQuery = 'Do you want to remove selected contacts?';
     73  STotal = 'Total';
     74  SFiltered = 'Filtered';
     75  SSelected = 'Selected';
    7276
    7377{ TFormContacts }
     
    8387    Item.SubItems.Add(Fields[cfTelCell]);
    8488    Item.SubItems.Add(Fields[cfTelHome]);
    85     Item.Data := Contacts[Item.Index];
     89    Item.Data := ListViewSort1.List[Item.Index];
    8690  end;
    8791end;
     
    101105begin
    102106  ReloadList;
     107  UpdateInterface;
    103108end;
    104109
     
    244249begin
    245250  ListView1.SelectAll;
     251  UpdateInterface;
    246252end;
    247253
     
    263269
    264270procedure TFormContacts.UpdateInterface;
     271var
     272  Text: string;
     273  SelectedCount: Integer;
    265274begin
    266275  AAdd.Enabled := Assigned(Contacts);
    267276  AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    268277  ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
     278
     279  Text := '';
     280  if Assigned(Contacts) then begin
     281    Text := STotal + ': ' + IntToStr(Contacts.Count);
     282    if ListView1.Items.Count < Contacts.Count then
     283      Text := Text + ', ' + SFiltered + ': ' + IntToStr(ListView1.Items.Count);
     284    SelectedCount := ListView1.SelCount;
     285    if SelectedCount > 0 then
     286      Text := Text + ', ' + SSelected + ': ' + IntToStr(SelectedCount);
     287  end;
     288  StatusBar1.Panels[0].Text := Text;
    269289end;
    270290
Note: See TracChangeset for help on using the changeset viewer.