mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-16 20:11:48 +08:00
Bugfix: fix regression; up-key and mousewheel-up were broken in r1512 for the data type dropdown.
This commit is contained in:
@ -113,6 +113,8 @@ object FieldEditForm: TFieldEditForm
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
OnChange = ComboBoxTypeChange
|
OnChange = ComboBoxTypeChange
|
||||||
OnDrawItem = ComboBoxTypeDrawItem
|
OnDrawItem = ComboBoxTypeDrawItem
|
||||||
|
OnKeyDown = ComboBoxTypeKeyDown
|
||||||
|
OnKeyUp = ComboBoxTypeKeyUp
|
||||||
end
|
end
|
||||||
object EditFieldname: TEdit
|
object EditFieldname: TEdit
|
||||||
Left = 88
|
Left = 88
|
||||||
|
@ -81,6 +81,9 @@ type
|
|||||||
procedure CheckBoxZerofillClick(Sender: TObject);
|
procedure CheckBoxZerofillClick(Sender: TObject);
|
||||||
procedure ComboBoxTypeDrawItem(Control: TWinControl; Index: Integer; Rect:
|
procedure ComboBoxTypeDrawItem(Control: TWinControl; Index: Integer; Rect:
|
||||||
TRect; State: TOwnerDrawState);
|
TRect; State: TOwnerDrawState);
|
||||||
|
procedure ComboBoxTypeKeyDown(Sender: TObject; var Key: Word; Shift:
|
||||||
|
TShiftState);
|
||||||
|
procedure ComboBoxTypeKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure listClick(Sender: TObject);
|
procedure listClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
@ -88,6 +91,7 @@ type
|
|||||||
FMode : TFieldEditorMode;
|
FMode : TFieldEditorMode;
|
||||||
FModeWhenCalled : TFieldEditorMode;
|
FModeWhenCalled : TFieldEditorMode;
|
||||||
FFieldName : String;
|
FFieldName : String;
|
||||||
|
FLastKey: Word;
|
||||||
procedure ValidateControls;
|
procedure ValidateControls;
|
||||||
function IsCategory(index: Integer): Boolean;
|
function IsCategory(index: Integer): Boolean;
|
||||||
function IndexToType(index: Integer): Integer;
|
function IndexToType(index: Integer): Integer;
|
||||||
@ -352,12 +356,18 @@ end;
|
|||||||
procedure TFieldEditForm.ComboBoxTypeChange(Sender: TObject);
|
procedure TFieldEditForm.ComboBoxTypeChange(Sender: TObject);
|
||||||
var
|
var
|
||||||
FieldType : TMysqlDataTypeRecord;
|
FieldType : TMysqlDataTypeRecord;
|
||||||
|
idx: Integer;
|
||||||
begin
|
begin
|
||||||
// Attributes
|
// Attributes
|
||||||
|
|
||||||
// Skip column type categories
|
// Skip column type categories
|
||||||
if IsCategory(ComboBoxType.ItemIndex) then begin
|
if IsCategory(ComboBoxType.ItemIndex) then begin
|
||||||
ComboBoxType.ItemIndex := ComboBoxType.ItemIndex + 1;
|
idx := ComboBoxType.ItemIndex;
|
||||||
|
if FLastKey = VK_UP then idx := idx - 1
|
||||||
|
else idx := idx + 1;
|
||||||
|
if idx < 0 then idx := idx + 2;
|
||||||
|
if idx >= ComboBoxType.Items.Count then idx := idx - 2;
|
||||||
|
ComboBoxType.ItemIndex := idx;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Detect column-type
|
// Detect column-type
|
||||||
@ -1120,6 +1130,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFieldEditForm.ComboBoxTypeKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
FLastKey := Key;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFieldEditForm.ComboBoxTypeKeyUp(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
FLastKey := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user