Added property AutoCompleteText
Didn't use AutoComplete as property name due to recent
Delphi's AutoComplete is a Boolean property and the one
I implemented is a Set which provides a few settings
for the behaviour of AutoComplete feature. So as not to clash.

Index: ideintf/propedits.pp
===================================================================
--- ideintf/propedits.pp        (revision 8470)
+++ ideintf/propedits.pp        (working copy)
@@ -2816,7 +2816,6 @@
   SetInt64Value(StrToInt64(NewValue));
 end;
 
-
 { TQWordPropertyEditor }
 
 function TQWordPropertyEditor.GetValue: ansistring;
Index: components/tdbf/dbflaz.pas
===================================================================
--- components/tdbf/dbflaz.pas  (revision 8470)
+++ components/tdbf/dbflaz.pas  (working copy)
@@ -7,13 +7,13 @@
 interface
 
 uses
-  RegisterDBF, Dbf, LazarusPackageIntf; 
+  registerdbf, Dbf, LazarusPackageIntf; 
 
 implementation
 
 procedure Register; 
 begin
-  RegisterUnit('RegisterDBF', @RegisterDBF.Register); 
+  RegisterUnit('registerdbf', @registerdbf.Register); 
 end; 
 
 initialization
Index: components/memds/memdslaz.pas
===================================================================
--- components/memds/memdslaz.pas       (revision 8470)
+++ components/memds/memdslaz.pas       (working copy)
@@ -1,22 +1,21 @@
 { This file was automatically created by Lazarus. Do not edit!
-  This source is only used to compile and install
-  the package MemDSLaz 1.2.1.
-}
+This source is only used to compile and install the package.
+ }
 
 unit MemDSLaz; 
 
 interface
 
 uses
-  memds, frmSelectDataset, LazarusPackageIntf; 
+  memds, frmselectdataset, LazarusPackageIntf; 
 
 implementation
 
 procedure Register; 
 begin
-  RegisterUnit('frmSelectDataset', @frmSelectDataset.Register); 
+  RegisterUnit('frmselectdataset', @frmselectdataset.Register); 
 end; 
 
 initialization
-  RegisterPackage('MemDSLaz', @Register)
+  RegisterPackage('MemDSLaz', @Register); 
 end.
Index: components/printers/Makefile
===================================================================
--- components/printers/Makefile        (revision 8470)
+++ components/printers/Makefile        (working copy)
@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/09/23]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/04]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd 
i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd 
i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux 
m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos 
powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos 
sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 
arm-linux arm-wince
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd 
i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd 
i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux 
m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos 
powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos 
sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 
arm-linux arm-wince powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -339,6 +339,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_UNITS+=printer4lazarus.pas
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=printer4lazarus.pas
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) 
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard 
$(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard *$(OEXT)) $(wildcard 
*$(PPUEXT)) $(wildcard *$(RSTEXT))
 endif
@@ -447,6 +450,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) 
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard 
$(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard *$(OEXT)) $(wildcard 
*$(PPUEXT)) $(wildcard *$(RSTEXT))
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) 
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard 
$(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard *$(OEXT)) $(wildcard 
*$(PPUEXT)) $(wildcard *$(RSTEXT))
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_OPTIONS+=-gl
 endif
@@ -555,6 +561,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_OPTIONS+=-gl
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_OPTIONS+=-gl
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_UNITDIR+=$(OS_TARGET)/ 
../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ ./
 endif
@@ -663,6 +672,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_UNITDIR+=$(OS_TARGET)/ 
../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ ./
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_UNITDIR+=$(OS_TARGET)/ 
../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ ./
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_UNITTARGETDIR+=lib/$(CPU_TARGET)-$(OS_TARGET)
 endif
@@ -771,6 +783,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_UNITTARGETDIR+=lib/$(CPU_TARGET)-$(OS_TARGET)
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_UNITTARGETDIR+=lib/$(CPU_TARGET)-$(OS_TARGET)
+endif
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
@@ -1608,6 +1623,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard 
$(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
@@ -1678,7 +1696,7 @@
 FPCCPUOPT:=-OG2p3
 else
 ifeq ($(CPU_TARGET),powerpc)
-FPCCPUOPT:=-O1
+FPCCPUOPT:=-O1r
 else
 FPCCPUOPT:=
 endif
@@ -1755,6 +1773,14 @@
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
Index: components/rtticontrols/runtimetypeinfocontrols.lpk
===================================================================
--- components/rtticontrols/runtimetypeinfocontrols.lpk (revision 8470)
+++ components/rtticontrols/runtimetypeinfocontrols.lpk (working copy)
@@ -19,7 +19,8 @@
     <Description Value="LCL controls using the FreePascal RTTI to access 
TPersistent properties.
 
 "/>
-    <License Value="LGPL"/>
+    <License Value="LGPL
+"/>
     <Version Minor="1"/>
     <Files Count="4">
       <Item1>
Index: components/rtticontrols/Makefile
===================================================================
--- components/rtticontrols/Makefile    (revision 8470)
+++ components/rtticontrols/Makefile    (working copy)
@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/09/23]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/04]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd 
i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd 
i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux 
m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos 
powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos 
sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 
arm-linux arm-wince
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd 
i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd 
i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux 
m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos 
powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos 
sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 
arm-linux arm-wince powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -339,6 +339,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_UNITS+=runtimetypeinfocontrols.pas
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=runtimetypeinfocontrols.pas
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) 
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard 
$(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard *$(OEXT)) $(wildcard 
*$(PPUEXT)) $(wildcard *$(RSTEXT))
 endif
@@ -447,6 +450,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) 
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard 
$(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard *$(OEXT)) $(wildcard 
*$(PPUEXT)) $(wildcard *$(RSTEXT))
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) 
$(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard 
$(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard *$(OEXT)) $(wildcard 
*$(PPUEXT)) $(wildcard *$(RSTEXT))
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_OPTIONS+=-gl
 endif
@@ -555,6 +561,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_OPTIONS+=-gl
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_OPTIONS+=-gl
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_UNITDIR+=../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ 
../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ ./
 endif
@@ -663,6 +672,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_UNITDIR+=../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ 
../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ ./
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_UNITDIR+=../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ 
../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/ ./
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_UNITTARGETDIR+=lib/$(CPU_TARGET)-$(OS_TARGET)/
 endif
@@ -771,6 +783,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_UNITTARGETDIR+=lib/$(CPU_TARGET)-$(OS_TARGET)/
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_UNITTARGETDIR+=lib/$(CPU_TARGET)-$(OS_TARGET)/
+endif
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
@@ -1608,6 +1623,9 @@
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard 
$(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
@@ -1678,7 +1696,7 @@
 FPCCPUOPT:=-OG2p3
 else
 ifeq ($(CPU_TARGET),powerpc)
-FPCCPUOPT:=-O1
+FPCCPUOPT:=-O1r
 else
 FPCCPUOPT:=
 endif
@@ -1755,6 +1773,14 @@
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
Index: ide/revision.inc
===================================================================
--- ide/revision.inc    (revision 8470)
+++ ide/revision.inc    (working copy)
@@ -1,2 +1,2 @@
 // Created by Svn2RevisionInc
-const RevisionStr = '8129M';
+const RevisionStr = '8470M';
Index: lcl/lclproc.pas
===================================================================
--- lcl/lclproc.pas     (revision 8470)
+++ lcl/lclproc.pas     (working copy)
@@ -61,6 +61,9 @@
 function ShortCutToText(ShortCut: TShortCut): string;
 function TextToShortCut(const ShortCutText: string): TShortCut;
 
+function GetCompleteText(sText: string; iSelStart: Integer; bCaseSensitive, 
bSearchAscending: Boolean; slTextList: TStrings): string;
+function IsEditableTextKey(Key: Word): Boolean;
+
 // Hooks used to prevent unit circles
 type
   TSendApplicationMessageFunction =
@@ -407,6 +410,50 @@
   end;
 end;
 
+function GetCompleteText(sText: string; iSelStart: Integer; bCaseSensitive, 
bSearchAscending: Boolean; slTextList: TStrings): string;
+
+ function IsSamePrefix(sCompareText, sPrefix: string; iStart: Integer; var 
ResultText: string): Boolean;
+ var sTempText: string;
+ begin
+  Result := False;
+  sTempText := LeftStr(sCompareText, iStart);
+  if not bCaseSensitive then sTempText := UpperCase(sTempText);
+  if (sTempText = sPrefix) then
+   begin
+    ResultText := sCompareText;
+    Result := True;
+   end;//End if (sTempText = sPrefix)
+ end;//End function IsSamePrefix
+
+var i: Integer;
+    sPrefixText: string;
+begin
+ Result := sText;//Default to return original text if no identical text are 
found
+ if (sText = '') then Exit;//Everything is compatible with nothing, Exit.
+ if (iSelStart = 0) then Exit;//Cursor at beginning
+ if (slTextList.Count = 0) then Exit;//No text list to search for idtenticals, 
Exit.
+ sPrefixText := LeftStr(sText, iSelStart);//Get text from beginning to cursor 
position.
+ if not bCaseSensitive then sPrefixText := UpperCase(sPrefixText);
+ if bSearchAscending then
+  begin
+   for i:=0 to slTextList.Count-1 do
+    if IsSamePrefix(slTextList[i], sPrefixText, iSelStart, Result) then Break;
+  end else
+  begin
+   for i:=slTextList.Count-1 downto 0 do
+    if IsSamePrefix(slTextList[i], sPrefixText, iSelStart, Result) then Break;
+  end;//End if bSearchAscending
+end;
+
+function IsEditableTextKey(Key: Word): Boolean;
+begin
+ Result := (((Key >= VK_A) and (Key <= VK_Z)) or
+            ((Key = VK_NUMPAD0) and (Key <= VK_DIVIDE)) or
+            ((Key >= 186) and (Key <= 188)) or
+            ((Key >= 190) and (Key <= 192)) or
+            ((Key >= 219) and (Key <= 222)));
+end;
+
 function SendApplicationMessage(Msg: Cardinal; WParam: WParam; LParam: LParam
   ): Longint;
 begin
Index: lcl/fpcadds.pas
===================================================================
--- lcl/fpcadds.pas     (revision 8470)
+++ lcl/fpcadds.pas     (working copy)
@@ -22,7 +22,7 @@
 unit FPCAdds;
 
 {$mode objfpc}{$H+}
-{$if defined(VER2_0_0) or defined(VER2_0_1) or defined(VER2_0_2)}
+{$if defined(VER2_0_0) or defined(VER2_0_1) or defined(VER2_0_2) or 
defined(VER2_1_1)}
 {$DEFINE FPC_HAS_NO_STRTOQWORD}
 {$ENDIF}
 
Index: lcl/include/customcombobox.inc
===================================================================
--- lcl/include/customcombobox.inc      (revision 8470)
+++ lcl/include/customcombobox.inc      (working copy)
@@ -430,6 +430,32 @@
     inherited KeyDown(Key, Shift);
 end;
 
+procedure TCustomComboBox.KeyUp(var Key: Word; Shift: TShiftState);
+var iSelStart: Integer;
+    sCompleteText: string;
+begin
+ inherited KeyUp(Key, Shift);
+ if ((cbactEnabled in FAutoCompleteText) and (Style = csDropDown)) then
+  begin
+   //Only happens with alpha-numeric keys and return key and csDropDown Style
+   if not (IsEditableTextKey(Key) or (Key = VK_RETURN)) then Exit;
+   if (Key = VK_RETURN) then
+    SelectAll else
+    begin
+     iSelStart := SelStart;//Capture original cursor position
+     sCompleteText := GetCompleteText(Text, iSelStart,
+                                      (cbactSearchCaseSensitive in 
FAutoCompleteText),
+                                      (cbactSearchAscending in 
FAutoCompleteText), Items);
+     if not (sCompleteText = Text) then
+      begin
+       Text := sCompleteText;
+       SelStart := iSelStart;
+       SelLength := Length(Text);
+      end;//End if not (sCompleteText = Text)
+    end;//End if (Key = VK_RETURN)
+  end;//End if ((cbactEnabled in FAutoCompleteText) and (Style = csDropDown))
+end;
+
 {------------------------------------------------------------------------------
   function TCustomComboBox.SelectItem(const AnItem: String): Boolean;
 
@@ -578,6 +604,7 @@
   ArrowKeysTraverseList := True;
   TabStop := true;
   ParentColor := false;
+  FAutoCompleteText := [cbactSearchAscending];
 end;
 
 {------------------------------------------------------------------------------
Index: lcl/stdctrls.pp
===================================================================
--- lcl/stdctrls.pp     (revision 8470)
+++ lcl/stdctrls.pp     (working copy)
@@ -211,6 +211,8 @@
 
 
   { TCustomComboBox }
+  TComboBoxAutoCompleteTextSet = (cbactEnabled, cbactSearchCaseSensitive, 
cbactSearchAscending);
+  TComboBoxAutoCompleteText = set of TComboBoxAutoCompleteTextSet;
 
   TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed,
                     csOwnerDrawVariable);
@@ -226,6 +228,7 @@
 
   TCustomComboBox = class(TWinControl)
   private
+    FAutoCompleteText: TComboBoxAutoCompleteText;
     FAutoDropDown: Boolean;
     FCanvas: TCanvas;
     FDropDownCount: Integer;
@@ -292,6 +295,7 @@
     procedure SetStyle(Val: TComboBoxStyle); virtual;
     procedure RealSetText(const AValue: TCaption); override;
     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
+    procedure KeyUp(var Key: Word; Shift: TShiftState); override;
     function SelectItem(const AnItem: String): Boolean;
 
     property DropDownCount: Integer read FDropDownCount write SetDropDownCount 
default 8;
@@ -319,7 +323,8 @@
     property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown;
     procedure MeasureItem(Index: Integer; var TheHeight: Integer); virtual;
     procedure SelectAll;
-
+    property AutoCompleteText: TComboBoxAutoCompleteText
+                           read FAutoCompleteText write FAutoCompleteText;
     property AutoDropDown: Boolean
                            read FAutoDropDown write FAutoDropDown default 
False;
     property ArrowKeysTraverseList: Boolean read FArrowKeysTraverseList
@@ -345,6 +350,7 @@
     property Align;
     property Anchors;
     property ArrowKeysTraverseList;
+    property AutoCompleteText;
     property AutoDropDown;
     property BorderSpacing;
     property Ctl3D;

Reply via email to