Changeset 34 for trunk/Forms


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.
Location:
trunk/Forms
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.lfm

    r32 r34  
    1414  object ListView1: TListView
    1515    Left = 0
    16     Height = 837
     16    Height = 810
    1717    Top = 0
    1818    Width = 1210
     
    5858    Left = 0
    5959    Height = 39
    60     Top = 869
     60    Top = 842
    6161    Width = 1210
    6262    Align = alBottom
     
    8383    Left = 0
    8484    Height = 32
    85     Top = 837
     85    Top = 810
    8686    Width = 1210
    8787    OnChange = ListViewFilter1Change
    8888    Align = alBottom
     89  end
     90  object StatusBar1: TStatusBar
     91    Left = 0
     92    Height = 27
     93    Top = 881
     94    Width = 1210
     95    Panels = <   
     96      item
     97        Width = 50
     98      end>
     99    SimplePanel = False
    89100  end
    90101  object PopupMenuContact: TPopupMenu
  • 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
  • trunk/Forms/UFormMain.lfm

    r21 r34  
    1414  OnDestroy = FormDestroy
    1515  OnShow = FormShow
    16   LCLVersion = '2.0.0.4'
     16  LCLVersion = '2.0.12.0'
    1717  object CoolBar1: TCoolBar
    1818    Left = 0
     
    107107    end
    108108  end
    109   object StatusBar1: TStatusBar
    110     Left = 0
    111     Height = 28
    112     Top = 734
    113     Width = 1178
    114     Panels = <   
    115       item
    116         Width = 300
    117       end>
    118     ParentFont = False
    119     SimplePanel = False
    120   end
    121109  object MainMenu1: TMainMenu
    122110    Images = Core.ImageList1
    123     left = 192
    124     top = 120
     111    Left = 192
     112    Top = 120
    125113    object MenuItemFile: TMenuItem
    126114      Caption = 'File'
     
    187175  end
    188176  object PopupMenuOpenRecent: TPopupMenu
    189     left = 420
    190     top = 120
     177    Left = 420
     178    Top = 120
    191179  end
    192180end
  • trunk/Forms/UFormMain.pas

    r21 r34  
    3737    MenuItemFile: TMenuItem;
    3838    PopupMenuOpenRecent: TPopupMenu;
    39     StatusBar1: TStatusBar;
    4039    ToolBarOther: TToolBar;
    4140    ToolBarFile: TToolBar;
     
    7170
    7271resourcestring
    73   SCount = 'Count:';
    7472  SModified = 'Modified';
    7573
     
    153151  UpdateFormTitle;
    154152  CoolBar1.Visible := MenuItemToolbar.Checked;
    155   if Assigned(Core.DataFile) then
    156     StatusBar1.Panels[0].Text := SCount + ' ' + IntToStr(TcontactsFile(Core.DataFile).Contacts.Count)
    157     else StatusBar1.Panels[0].Text := '';
    158153end;
    159154
Note: See TracChangeset for help on using the changeset viewer.