mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Work around a magic automatic TAB key arriving the pulldown grid editor if the user got into this cell via TAB. Only seen for a TComboBox with style=csDropDown. Fixes issue #2809.
This commit is contained in:
@ -35,6 +35,7 @@ type
|
||||
FOldWindowProc: TWndMethod; // Temporary switched to TempWindowProc to be able to catch Tab key
|
||||
FFullDatatype: TDBDatatype;
|
||||
FModified: Boolean;
|
||||
FBeginEditTime: Cardinal;
|
||||
procedure TempWindowProc(var Message: TMessage);
|
||||
procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure DoEndEdit(Sender: TObject);
|
||||
@ -97,6 +98,7 @@ type
|
||||
TEnumEditorLink = class(TBaseGridEditorLink)
|
||||
private
|
||||
FCombo: TComboBox;
|
||||
procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
public
|
||||
ValueList, DisplayList: TStringList;
|
||||
AllowCustomText: Boolean;
|
||||
@ -305,6 +307,7 @@ end;
|
||||
function TBaseGridEditorLink.BeginEdit: Boolean;
|
||||
begin
|
||||
Result := not FStopping;
|
||||
FBeginEditTime := GetTickCount;
|
||||
end;
|
||||
|
||||
function TBaseGridEditorLink.CancelEdit: Boolean;
|
||||
@ -858,6 +861,15 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TEnumEditorLink.DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
// Work around a magic automatic TAB key arriving the editor if the user got
|
||||
// into this cell via TAB. Only seen for a TComboBox with style=csDropDown.
|
||||
// See issue #2809
|
||||
if not (AllowCustomText and (GetTickCount-FBeginEditTime < 200)) then
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{ SET editor }
|
||||
|
Reference in New Issue
Block a user