Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Bugfix für VirtualEditTree (https://www.delphipraxis.net/110538-bugfix-fuer-virtualedittree.html)

phreax 19. Mär 2008 16:25


Bugfix für VirtualEditTree
 
Für alle die den VirtualEditTree benutzen, die Unit "VTEditors.pas" enthält einen Bug, welcher ein korrektes Autocomplete beim TComboEditLink verhindert:
Hier die korrigierte Version:
(der auskommentierte Teil führte zum Fehler, warum weiß ich auch nicht so genau ^^)
Delphi-Quellcode:
procedure TComboEditLink.DoAutoComplete(var Key: Char);
var
  S, S1: string;
  I, St, L: Integer;
begin
  if (FStyle in [csDropDown, csSimple]) and (Key in [#32 .. #255]) then
    with TComboBox(EditControl) do
      case FAutoCompleteMode of
        acComplete:
          begin
            St := SelStart;
            S := Copy(Text, 1, St) + Key;
            L := Length(S);
            with FPickList do
              for I := 0 to Count - 1 do
                if AnsiSameText(Copy(Strings[I], 1, L), S) then
                begin
                  S1 := S + Copy(Strings[I], Length(S) + 1, MaxInt);
                  TComboBox(EditControl).Text := S1;
                  SelStart := St;// + 1;
                  SelLength := Length(S1) - St;
                  //Key := #0;
                  Exit;
                end;
          end;
      end;
end;
Villeicht bewahrt das ja jemanden anderen vor einer verzweifelten dreistündigen Bugsuche, das Glück hatte ich ja leider nicht :wink: ...

viele Grüße phreax


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:55 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz