mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 01:56:36 +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
|
||||
OnChange = ComboBoxTypeChange
|
||||
OnDrawItem = ComboBoxTypeDrawItem
|
||||
OnKeyDown = ComboBoxTypeKeyDown
|
||||
OnKeyUp = ComboBoxTypeKeyUp
|
||||
end
|
||||
object EditFieldname: TEdit
|
||||
Left = 88
|
||||
|
@ -81,6 +81,9 @@ type
|
||||
procedure CheckBoxZerofillClick(Sender: TObject);
|
||||
procedure ComboBoxTypeDrawItem(Control: TWinControl; Index: Integer; Rect:
|
||||
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);
|
||||
private
|
||||
{ Private declarations }
|
||||
@ -88,6 +91,7 @@ type
|
||||
FMode : TFieldEditorMode;
|
||||
FModeWhenCalled : TFieldEditorMode;
|
||||
FFieldName : String;
|
||||
FLastKey: Word;
|
||||
procedure ValidateControls;
|
||||
function IsCategory(index: Integer): Boolean;
|
||||
function IndexToType(index: Integer): Integer;
|
||||
@ -352,12 +356,18 @@ end;
|
||||
procedure TFieldEditForm.ComboBoxTypeChange(Sender: TObject);
|
||||
var
|
||||
FieldType : TMysqlDataTypeRecord;
|
||||
idx: Integer;
|
||||
begin
|
||||
// Attributes
|
||||
|
||||
// Skip column type categories
|
||||
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;
|
||||
|
||||
// Detect column-type
|
||||
@ -1120,6 +1130,18 @@ begin
|
||||
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.
|
||||
|
||||
|
Reference in New Issue
Block a user