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
|
FOldWindowProc: TWndMethod; // Temporary switched to TempWindowProc to be able to catch Tab key
|
||||||
FFullDatatype: TDBDatatype;
|
FFullDatatype: TDBDatatype;
|
||||||
FModified: Boolean;
|
FModified: Boolean;
|
||||||
|
FBeginEditTime: Cardinal;
|
||||||
procedure TempWindowProc(var Message: TMessage);
|
procedure TempWindowProc(var Message: TMessage);
|
||||||
procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure DoEndEdit(Sender: TObject);
|
procedure DoEndEdit(Sender: TObject);
|
||||||
@ -97,6 +98,7 @@ type
|
|||||||
TEnumEditorLink = class(TBaseGridEditorLink)
|
TEnumEditorLink = class(TBaseGridEditorLink)
|
||||||
private
|
private
|
||||||
FCombo: TComboBox;
|
FCombo: TComboBox;
|
||||||
|
procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
public
|
public
|
||||||
ValueList, DisplayList: TStringList;
|
ValueList, DisplayList: TStringList;
|
||||||
AllowCustomText: Boolean;
|
AllowCustomText: Boolean;
|
||||||
@ -305,6 +307,7 @@ end;
|
|||||||
function TBaseGridEditorLink.BeginEdit: Boolean;
|
function TBaseGridEditorLink.BeginEdit: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := not FStopping;
|
Result := not FStopping;
|
||||||
|
FBeginEditTime := GetTickCount;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBaseGridEditorLink.CancelEdit: Boolean;
|
function TBaseGridEditorLink.CancelEdit: Boolean;
|
||||||
@ -858,6 +861,15 @@ begin
|
|||||||
end;
|
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 }
|
{ SET editor }
|
||||||
|
Reference in New Issue
Block a user