mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Reposition default value editor so it's not outside the main form. Fixes issue #2868.
This commit is contained in:
@ -1298,10 +1298,22 @@ end;
|
|||||||
procedure TColumnDefaultEditorLink.SetBounds(R: TRect); stdcall;
|
procedure TColumnDefaultEditorLink.SetBounds(R: TRect); stdcall;
|
||||||
var
|
var
|
||||||
CellRect: TRect;
|
CellRect: TRect;
|
||||||
|
P: TPoint;
|
||||||
|
Room: Integer;
|
||||||
begin
|
begin
|
||||||
CellRect := GetCellRect(False);
|
CellRect := GetCellRect(False);
|
||||||
FPanel.Left := CellRect.Left;
|
FPanel.Left := CellRect.Left;
|
||||||
FPanel.Top := CellRect.Top;
|
FPanel.Top := CellRect.Top;
|
||||||
|
|
||||||
|
// Reposition editor so it's not outside the main form
|
||||||
|
P := FParentForm.ClientToScreen(FPanel.BoundsRect.TopLeft);
|
||||||
|
Room := FParentForm.BoundsRect.Bottom - 8 {Borderwidth} - (P.Y + FPanel.Height);
|
||||||
|
if Room < 0 then
|
||||||
|
FPanel.Top := CellRect.Top + Room;
|
||||||
|
P := FParentForm.ClientToScreen(FPanel.BoundsRect.BottomRight);
|
||||||
|
Room := FParentForm.BoundsRect.Right - 8 {Borderwidth} - P.X;
|
||||||
|
if Room < 0 then
|
||||||
|
FPanel.Left := CellRect.Left + Room;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user