TMSFNCListBox and filter

Hi to all,
  i'm working on Android (s10/10+ and delphi 10.3.3) and i have some trouble with TMSFNCListBox and filter.
This happend even on windows 10 64 pro same compiler and your demo (regarding this component).
Using the example, i have add a fncedit in order to have a filter edit.
When press enterkey i apply the filter.
This is the fncedit event

procedure TForm130.TMSFNCEdit1KeyUp(Sender: TObject; var Key: Word;
  var KeyChar: Char; Shift: TShiftState);
begin
  if Key = 13 then
  begin
    TMSFNCListBox1.Filter.Clear;
    With TMSFNCListBox1.Filter.Add do
    begin
      Condition :='*' + TMSFNCEdit1.Text + '*';
    end;
    TMSFNCListBox1.ApplyFilter;
    if TMSFNCListBox1.Items.Count>0 then // <<----- **** here always 14
    begin

    end;
  end;
end;

As expected the filter works, but the question is ... where is stored the filter items count?
In fact if i type a non matched value (in your example a value could be 'qq') the listbox will be empty (due the fact no one items contain 'qq' string) but TMSFNCListBox1.Items.Count return always 14 (it is non zero based??) because the list have 14 items.
How i can get the real filtered items? (the list box still have always 14 items but 0 match filter condition).
Can you expose a property like TMSFNCListBox1.Items.filtercount ? (if does not already exist)

Thank's for all

Regards
Daniele 

hi,


We have investigate this and while filtering is exposed and there is a way to access the treeview to eventually access the filtered data, we think that this is not the way the filtered items should be accessed and therefore have added a new way of accessing the filtered items. The next version will have a FilteredItems property that allows you to directly access the TTMSFNCListBoxItems that have been filtered. Below is the code that you can use to achieve this as soon as the next version will be released.



procedure TForm17.Button1Click(Sender: TObject);
var
  I: Integer;
  f: TTMSFNCListBoxFilteredItems;
begin
  TMSFNCListBox1.BeginUpdate;
  TMSFNCListBox1.Filter.Clear;
  with TMSFNCListBox1.Filter.Add do
  begin
    Condition := '*BMW*';
  end;


  TMSFNCListBox1.ApplyFilter;
  TMSFNCListBox1.EndUpdate;
  f := TMSFNCListBox1.FilteredItems;
  for I := 0 to Length(f) - 1 do
  begin
    FMX.Types.Log.D(f.Text);
  end;
end;

Hi Pieter,

  thank's for very quick reply.
Waiting next version, i'm use your (appreciate) code.

Regards
Daniele

Hi Pieter,

  excuse me ... but 

TTMSFNCListBoxFilteredItems

in which unit is declared ?

Thank's
Daniele


It is not yet released.

Ok, tank's again Pieter


Daniele