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
0006042 [JEDI VCL] 00 JVCL Components minor always 2012-12-03 14:08 2013-12-13 16:25
Reporter gta View Status public  
Assigned To obones
Priority normal Resolution duplicate  
Status resolved   Product Version 3.39
Summary 0006042: TJvDBLookupCombo searching with national characters UTF (with bugfix)
Description in function TJvLookupControl.ProcessSearchKey and TJvDBLookupCombo.KeyPress searching is limited to
characters from range: 1..255:
For Delphi >= 2009 char type takes 2 bytes so it gets values greater than 255.



Here is a bug fix for TJvLookupControl.ProcessSearchKey:
 +++ OLD VERSION (CURRENT VERSION) +++
procedure TJvLookupControl.ProcessSearchKey(Key: Char);
var
  TickCount: Longint;
  S: string;
begin
  S := '';
  if (FDisplayField <> nil) {and (FDisplayField.DataType = ftString)} then
    case Key of
      Tab, Esc:
        FSearchText := '';
      Backspace, 0000032..0000255:
        if CanModify then
        begin
          if not FPopup then
     (...)
end;

 +++ NEW VERSION (WITHOUT BUG) +++
procedure TJvLookupControl.ProcessSearchKey(Key: Char);
var
  TickCount: Longint;
  S: string;
begin
  S := '';
  if (FDisplayField <> nil) {and (FDisplayField.DataType = ftString)} then
    case Key of
      Tab, Esc:
        FSearchText := '';
      // Backspace, 0000032..0000255:
      Backspace, 0000032..High(Char):
        if CanModify then
        begin
          if not FPopup then
     (...)
end;




Here is a bug fix for TJvDBLookupCombo.KeyPress
 +++ OLD VERSION (CURRENT VERSION) +++
procedure TJvDBLookupCombo.KeyPress(var Key: Char);
begin
  if FListVisible then
  begin
    if TabSelects and IsDropDown and (Key = Tab) then
      Key := Cr;

    if CharInSet(Key, [Cr, Esc]) then
    begin
      CloseUp(Key = Cr);
      Key := #0;
    end
    else
      FDataList.KeyPress(Key)
  end
  else
  begin
    if CharInSet(Key, [0000032..0000255]) then
    begin
      DropDown;
      if FListVisible then
        FDataList.KeyPress(Key);
    
     (...)
end;

 +++ NEW VERSION (WITHOUT BUG) +++
procedure TJvDBLookupCombo.KeyPress(var Key: Char);
begin
  if FListVisible then
  begin
    if TabSelects and IsDropDown and (Key = Tab) then
      Key := Cr;

    if CharInSet(Key, [Cr, Esc]) then
    begin
      CloseUp(Key = Cr);
      Key := #0;
    end
    else
      FDataList.KeyPress(Key)
  end
  else
  begin
    // if CharInSet(Key, [0000032..0000255]) then
    if (Key >= 0000032) AND (Key <= High(Char)) then
    begin
      DropDown;
      if FListVisible then
        FDataList.KeyPress(Key);
    
     (...)
end;
Additional Information
Tags No tags attached.
Attached Files

- Relationships
duplicate of 0006174resolvedAHUser jvDBLookup and jvDBLookupTreeView don't search by Chars of codes greater than 255 (ex. Polish letters) 
has duplicate 0006043resolvedobones TJvDBLookupTreeViewCombo searching with national characters UTF (with bugfix) 

-  Notes
(0020377)
obones (administrator)
2013-01-15 16:03

Please provide the zipped sources of a sample application showing this.
(0020836)
obones (administrator)
2013-12-13 16:25

Please see 0006174

- Issue History
Date Modified Username Field Change
2012-12-03 14:08 gta New Issue
2013-01-15 16:03 obones Note Added: 0020377
2013-01-15 16:03 obones Status new => feedback
2013-01-15 16:03 obones Relationship added has duplicate 0006043
2013-12-13 11:36 obones Status feedback => acknowledged
2013-12-13 16:25 obones Note Added: 0020836
2013-12-13 16:25 obones Relationship added duplicate of 0006174
2013-12-13 16:25 obones Duplicate ID 0 => 6174
2013-12-13 16:25 obones Status acknowledged => resolved
2013-12-13 16:25 obones Resolution open => duplicate
2013-12-13 16:25 obones Assigned To => obones


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