DockedFormEditor: Fixed flickering at anchoring control

git-svn-id: trunk@64624 -
This commit is contained in:
michl 2021-02-19 21:09:36 +00:00
parent 0c46287ea3
commit 89deb31d9e
3 changed files with 18 additions and 7 deletions

View File

@ -413,7 +413,8 @@ end;
procedure TAnchorDesigner.CreateAnchorGrips; procedure TAnchorDesigner.CreateAnchorGrips;
begin begin
FAnchorGrips := TAnchorGrips.Create(FBackGround); FAnchorGrips := TAnchorGrips.Create;
FAnchorGrips.Parent := Parent;
FAnchorGrips.BackGround := FBackGround; FAnchorGrips.BackGround := FBackGround;
FAnchorGrips.OnMouseDown := @AnchorGripMouseDown; FAnchorGrips.OnMouseDown := @AnchorGripMouseDown;
FAnchorGrips.OnMouseMove := @AnchorGripMouseMove; FAnchorGrips.OnMouseMove := @AnchorGripMouseMove;
@ -949,8 +950,8 @@ end;
procedure TAnchorDesigner.SetParent(AValue: TWinControl); procedure TAnchorDesigner.SetParent(AValue: TWinControl);
begin begin
inherited SetParent(AValue); inherited SetParent(AValue);
if Assigned(FBackGround) then if Assigned(FBackGround) then FBackGround.Parent := Parent;
FBackGround.Parent := Parent; if Assigned(FAnchorGrips) then FAnchorGrips.Parent := Parent;
end; end;
end. end.

View File

@ -58,9 +58,10 @@ type
procedure SetOnMouseDown(AValue: TMouseEvent); procedure SetOnMouseDown(AValue: TMouseEvent);
procedure SetOnMouseMove(AValue: TMouseMoveEvent); procedure SetOnMouseMove(AValue: TMouseMoveEvent);
procedure SetOnMouseUp(AValue: TMouseEvent); procedure SetOnMouseUp(AValue: TMouseEvent);
procedure SetParent(AValue: TWinControl);
procedure SetPopupMenu(AValue: TPopupMenu); procedure SetPopupMenu(AValue: TPopupMenu);
public public
constructor Create(AParent: TWinControl); constructor Create;
destructor Destroy; override; destructor Destroy; override;
procedure AdjustGrips(AControl: TControl); procedure AdjustGrips(AControl: TControl);
procedure BringToFront; procedure BringToFront;
@ -80,6 +81,7 @@ type
property OnMouseDown: TMouseEvent read FOnMouseDown write SetOnMouseDown; property OnMouseDown: TMouseEvent read FOnMouseDown write SetOnMouseDown;
property OnMouseMove: TMouseMoveEvent read FOnMouseMove write SetOnMouseMove; property OnMouseMove: TMouseMoveEvent read FOnMouseMove write SetOnMouseMove;
property OnMouseUp: TMouseEvent read FOnMouseUp write SetOnMouseUp; property OnMouseUp: TMouseEvent read FOnMouseUp write SetOnMouseUp;
property Parent: TWinControl read FParent write SetParent;
property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu; property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu;
end; end;
@ -176,6 +178,16 @@ begin
FGrip[i].OnMouseUp := AValue; FGrip[i].OnMouseUp := AValue;
end; end;
procedure TAnchorGrips.SetParent(AValue: TWinControl);
var
i: Integer;
begin
if FParent = AValue then Exit;
FParent := AValue;
for i := 0 to 7 do
FGrip[i].Parent := AValue;
end;
procedure TAnchorGrips.SetPopupMenu(AValue: TPopupMenu); procedure TAnchorGrips.SetPopupMenu(AValue: TPopupMenu);
var var
i: Integer; i: Integer;
@ -185,11 +197,10 @@ begin
FGrip[i].PopupMenu := AValue; FGrip[i].PopupMenu := AValue;
end; end;
constructor TAnchorGrips.Create(AParent: TWinControl); constructor TAnchorGrips.Create;
var var
i: Integer; i: Integer;
begin begin
FParent := AParent;
FGripSize := ScaleX(GRIP_SIZE, 96); FGripSize := ScaleX(GRIP_SIZE, 96);
for i := 0 to 7 do for i := 0 to 7 do

View File

@ -336,7 +336,6 @@ end;
procedure TSourceEditorWindows.RefreshAllPageControls; procedure TSourceEditorWindows.RefreshAllPageControls;
var var
LWindow: TSourceEditorWindow; LWindow: TSourceEditorWindow;
LPageCtrl: TModulePageControl;
LSourceEditorPageControl: TSourceEditorPageControl; LSourceEditorPageControl: TSourceEditorPageControl;
begin begin
for LWindow in SourceEditorWindows do for LWindow in SourceEditorWindows do