mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Fix issue #1161: Enum editor pops up in the upper left corner
This commit is contained in:
@ -538,6 +538,7 @@ end;
|
|||||||
function TEnumEditorLink.PrepareEdit(Tree: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex): Boolean; stdcall;
|
function TEnumEditorLink.PrepareEdit(Tree: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex): Boolean; stdcall;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
CellRect: TRect;
|
||||||
begin
|
begin
|
||||||
Result := Tree is TCustomVirtualStringTree;
|
Result := Tree is TCustomVirtualStringTree;
|
||||||
if not Result then
|
if not Result then
|
||||||
@ -545,8 +546,12 @@ begin
|
|||||||
Ftree := Tree as TCustomVirtualStringTree;
|
Ftree := Tree as TCustomVirtualStringTree;
|
||||||
FNode := Node;
|
FNode := Node;
|
||||||
FColumn := Column;
|
FColumn := Column;
|
||||||
FCombo := TTnTComboBox.Create(Tree);
|
FCombo := TTnTComboBox.Create(FTree);
|
||||||
FCombo.Parent := FTree;
|
FCombo.Parent := FTree;
|
||||||
|
|
||||||
|
CellRect := Ftree.GetDisplayRect(FNode, FColumn, False);
|
||||||
|
FCombo.BoundsRect := CellRect;
|
||||||
|
FCombo.ItemHeight := CellRect.Bottom - CellRect.Top - 4;
|
||||||
for i := 0 to ValueList.Count - 1 do
|
for i := 0 to ValueList.Count - 1 do
|
||||||
FCombo.Items.Add(ValueList[i]);
|
FCombo.Items.Add(ValueList[i]);
|
||||||
if AllowCustomText then begin
|
if AllowCustomText then begin
|
||||||
@ -569,8 +574,8 @@ end;
|
|||||||
|
|
||||||
procedure TEnumEditorLink.SetBounds(R: TRect); stdcall;
|
procedure TEnumEditorLink.SetBounds(R: TRect); stdcall;
|
||||||
begin
|
begin
|
||||||
FCombo.BoundsRect := R;
|
FCombo.BoundsRect := Ftree.GetDisplayRect(FNode, FColumn, False);
|
||||||
FCombo.ItemHeight := R.Bottom - R.Top - 4;
|
FCombo.ItemHeight := FCombo.BoundsRect.Bottom - FCombo.BoundsRect.Top - 4;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user