mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Override VirtualTree's incremental search event, make it case insensitive, and apply that event in FixVT to various lists and grids, which have IncrementalSearch enabled. Fixes issue #1605.
This commit is contained in:
@ -1240,6 +1240,7 @@ begin
|
|||||||
FTreeSelect.OnHotChange := DoTreeSelectHotChange;
|
FTreeSelect.OnHotChange := DoTreeSelectHotChange;
|
||||||
FTreeSelect.OnPaintText := DoTreeSelectPaintText;
|
FTreeSelect.OnPaintText := DoTreeSelectPaintText;
|
||||||
FTreeSelect.OnExit := DoEndEdit;
|
FTreeSelect.OnExit := DoEndEdit;
|
||||||
|
FixVT(FTreeSelect);
|
||||||
FMainControl := FTreeSelect;
|
FMainControl := FTreeSelect;
|
||||||
|
|
||||||
FMemoHelp := TMemo.Create(FParentForm);
|
FMemoHelp := TMemo.Create(FParentForm);
|
||||||
|
@ -2515,6 +2515,9 @@ begin
|
|||||||
VT.OnGetHint := MainForm.vstGetHint;
|
VT.OnGetHint := MainForm.vstGetHint;
|
||||||
VT.ShowHint := True;
|
VT.ShowHint := True;
|
||||||
VT.HintMode := hmToolTip;
|
VT.HintMode := hmToolTip;
|
||||||
|
// Apply case insensitive incremental search event
|
||||||
|
if VT.IncrementalSearch <> isNone then
|
||||||
|
VT.OnIncrementalSearch := Mainform.vstIncrementalSearch;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -613,6 +613,8 @@ type
|
|||||||
PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
procedure vstHeaderDraggedOut(Sender: TVTHeader; Column: TColumnIndex;
|
procedure vstHeaderDraggedOut(Sender: TVTHeader; Column: TColumnIndex;
|
||||||
DropPosition: TPoint);
|
DropPosition: TPoint);
|
||||||
|
procedure vstIncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; const SearchText: String;
|
||||||
|
var Result: Integer);
|
||||||
procedure DBtreeFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
procedure DBtreeFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||||
Column: TColumnIndex);
|
Column: TColumnIndex);
|
||||||
procedure DBtreeDblClick(Sender: TObject);
|
procedure DBtreeDblClick(Sender: TObject);
|
||||||
@ -5648,6 +5650,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.vstIncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||||
|
const SearchText: String; var Result: Integer);
|
||||||
|
var
|
||||||
|
CellText: String;
|
||||||
|
VT: TVirtualStringTree;
|
||||||
|
begin
|
||||||
|
// Override VT's default incremental search behaviour. Make it case insensitive.
|
||||||
|
VT := Sender as TVirtualStringTree;
|
||||||
|
if VT.FocusedColumn = NoColumn then
|
||||||
|
Exit;
|
||||||
|
CellText := VT.Text[Node, VT.FocusedColumn];
|
||||||
|
Result := StrLIComp(PChar(CellText), PChar(SearchText), Length(SearchText));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{**
|
{**
|
||||||
A cell in ListCommandStats gets painted.
|
A cell in ListCommandStats gets painted.
|
||||||
Draw a progress bar on it to visualize its percentage value.
|
Draw a progress bar on it to visualize its percentage value.
|
||||||
|
@ -75,6 +75,7 @@ object frmTableEditor: TfrmTableEditor
|
|||||||
Header.Font.Style = []
|
Header.Font.Style = []
|
||||||
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoVisible]
|
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoVisible]
|
||||||
Images = MainForm.PngImageListMain
|
Images = MainForm.PngImageListMain
|
||||||
|
IncrementalSearch = isAll
|
||||||
PopupMenu = popupColumns
|
PopupMenu = popupColumns
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoTristateTracking]
|
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoTristateTracking]
|
||||||
|
Reference in New Issue
Block a user