mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Fix bug #696 Problem with popup editor editing the last record.
Solution: Always center the memo editor within the grid.
This commit is contained in:
@@ -171,9 +171,7 @@ end;
|
||||
|
||||
procedure TMemoEditorLink.SetBounds(R: TRect); stdcall;
|
||||
begin
|
||||
// Sets the top left corner of the edit control
|
||||
if not FStopping then
|
||||
FForm.TopLeft := R.TopLeft;
|
||||
// See OnFormShow in the form object itself
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ type
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
TopLeft: TPoint; // Used to position this form on the top left corner of the edited cell
|
||||
end;
|
||||
|
||||
|
||||
@@ -55,15 +54,18 @@ end;
|
||||
|
||||
|
||||
procedure TfrmMemoEditor.FormShow(Sender: TObject);
|
||||
var
|
||||
Tree: TCustomVirtualStringTree;
|
||||
begin
|
||||
Tree := TCustomVirtualStringTree(Parent);
|
||||
// Hide window caption
|
||||
SetWindowLong(Handle, GWL_STYLE, GetWindowLong( Handle, GWL_STYLE ) and not WS_CAPTION );
|
||||
// Restore form dimensions
|
||||
Width := Mainform.GetRegValue(REGNAME_MEMOEDITOR_WIDTH, DEFAULT_MEMOEDITOR_WIDTH);
|
||||
Height := Mainform.GetRegValue(REGNAME_MEMOEDITOR_HEIGHT, DEFAULT_MEMOEDITOR_HEIGHT);
|
||||
// Set top left corner to match the edited cell
|
||||
Left := TopLeft.X;
|
||||
Top := TopLeft.Y;
|
||||
// Center the form in the grid
|
||||
Left := (Tree.Width - Width) div 2;
|
||||
Top := (Tree.Height - Height) div 2;
|
||||
// Fix label position:
|
||||
lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2;
|
||||
SetWindowSizeGrip(Handle, True);
|
||||
|
||||
Reference in New Issue
Block a user