Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002983 [JEDI VCL] 00 JVCL Components feature N/A 2005-05-23 05:01 2005-05-24 06:46
Reporter westphal View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0002983: jvAutoComplete
Description Added feature

Possibility to change the searched part of the autocomplete using a new assigned property: OnGetSearchPart

usefull if you wish to be able to enter in an edit box, multiple items
Additional Information Usage exemple:

  FAutoComplete := TJvEditListAutoComplete.Create(edRecipients,FDirectoryList);
  FAutoComplete.OnGetSearchPart:=GetSearchPart;



function TForm1.GetSearchPart(sender : TObject; anItem : string) : string;
var p : integer;
begin
  result:=anItem;
  p:=lastDelimiter(';',anItem);
  if p<>0 then delete(result,1,p);
  result:=TrimLeft(result);
end;
Tags No tags attached.
Attached Files ? file icon JvAutoComplete.pas [^] (28,514 bytes) 2005-05-23 05:03

- Relationships

-  Notes
(0007301)
AHUser (developer)
2005-05-23 05:16

I have added the feature. But I've renamed the event to "OnGetSearchPrefix".

Added to CVS.
(0007332)
westphal (reporter)
2005-05-24 05:37

Hello, whoaho it was fast ! Thanks

But my proposition contained also a modification of the selectItem proc in the procedure Autocomplete in order to not replace the full content of the control, with that modification, you can add sevral items in an edit box

Here is an adapted version of this procedure:


  function SelectItem(const AnItem: string): Boolean;
  var
    Idx: Integer;
    ValueChange: Boolean;
    partToFind : string;
  begin
    partToFind:=anItem;
    GetSearchItemPrefix(partToFind);

    if partToFind = '' then
    begin
      Result := False;
      SetItemIndex(-1);
      DoChange;
      Exit;
    end;
    Idx := FindItemPrefix(-1, partToFind);
    Result := (Idx <> -1);
    if not Result then
      Exit;
    ValueChange := Idx <> GetItemIndex;
    SetItemIndex(Idx);
    if ListSearch then
    begin
      SetItemIndex(Idx);
      FFilter := partToFind;
    end
    else
    begin
      SetText(AnItem + Copy(GetItemAt(Idx), Length(partToFind) + 1, MaxInt));
      SetEditSel(Length(AnItem), Length(GetText));
    end;
    if ValueChange then
      DoValueChange;
  end;
(0007333)
AHUser (developer)
2005-05-24 06:46

Fixed in CVS.

- Issue History
Date Modified Username Field Change
2005-05-23 05:01 westphal New Issue
2005-05-23 05:03 westphal File Added: JvAutoComplete.pas
2005-05-23 05:16 AHUser Status new => resolved
2005-05-23 05:16 AHUser Resolution open => fixed
2005-05-23 05:16 AHUser Assigned To => AHUser
2005-05-23 05:16 AHUser Note Added: 0007301
2005-05-24 05:37 westphal Status resolved => feedback
2005-05-24 05:37 westphal Resolution fixed => reopened
2005-05-24 05:37 westphal Note Added: 0007332
2005-05-24 06:46 AHUser Status feedback => resolved
2005-05-24 06:46 AHUser Resolution reopened => fixed
2005-05-24 06:46 AHUser Note Added: 0007333


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker