mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 21:18:01 +02:00
DockedFormEditor Refactoring: Remove not needed code, rename a method
git-svn-id: trunk@64576 -
This commit is contained in:
parent
e32b62e6b4
commit
58c7171e6c
@ -84,7 +84,6 @@ type
|
||||
procedure BeginUpdate; override;
|
||||
procedure EndUpdate; override;
|
||||
procedure Invalidate; override;
|
||||
function IsFocused: Boolean; override;
|
||||
procedure Refresh; override;
|
||||
public
|
||||
property SelectedControl: TAnchorControl read FSelectedControl write SetSelectedControl;
|
||||
@ -921,14 +920,6 @@ begin
|
||||
FBackGround.Invalidate;
|
||||
end;
|
||||
|
||||
function TAnchorDesigner.IsFocused: Boolean;
|
||||
begin
|
||||
if Assigned(IsFocusedFunc) then
|
||||
Result := IsFocusedFunc()
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure TAnchorDesigner.Refresh;
|
||||
var
|
||||
i: Integer;
|
||||
|
@ -30,31 +30,20 @@ type
|
||||
|
||||
TBasicAnchorDesigner = class
|
||||
private
|
||||
FIsFocusedFunc: TBoolFunc;
|
||||
FOnDesignerSetFocus: TProcedureOfObject;
|
||||
FOnMouseWheel: TMouseWheelEvent;
|
||||
public
|
||||
constructor Create;
|
||||
function IsFocused: Boolean; virtual; abstract;
|
||||
procedure Abort; virtual; abstract;
|
||||
procedure BeginUpdate; virtual; abstract;
|
||||
procedure EndUpdate; virtual; abstract;
|
||||
procedure Invalidate; virtual; abstract;
|
||||
procedure Refresh; virtual; abstract;
|
||||
public
|
||||
property IsFocusedFunc: TBoolFunc read FIsFocusedFunc write FIsFocusedFunc;
|
||||
property OnDesignerSetFocus: TProcedureOfObject read FOnDesignerSetFocus write FOnDesignerSetFocus;
|
||||
property OnMouseWheel: TMouseWheelEvent read FOnMouseWheel write FOnMouseWheel;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TBasicAnchorDesigner }
|
||||
|
||||
constructor TBasicAnchorDesigner.Create;
|
||||
begin
|
||||
FIsFocusedFunc := nil;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -439,7 +439,7 @@ begin
|
||||
|
||||
LDesignForm := SourceEditorWindows.FindDesignForm(LPageCtrl);
|
||||
if LDesigner = nil then
|
||||
LPageCtrl.HideDesignPages
|
||||
LPageCtrl.RemoveDesignPages
|
||||
else begin
|
||||
if not Assigned(LPageCtrl.Resizer) then
|
||||
LPageCtrl.CreateResizer;
|
||||
|
@ -52,7 +52,7 @@ type
|
||||
procedure CreateTabSheetDesigner;
|
||||
procedure DesignerSetFocus;
|
||||
function DesignerFocused: Boolean;
|
||||
procedure HideDesignPages;
|
||||
procedure RemoveDesignPages;
|
||||
procedure InitPage;
|
||||
procedure RefreshResizer;
|
||||
procedure ShowCode;
|
||||
@ -159,7 +159,7 @@ begin
|
||||
(ActivePage = FTabSheetAnchors);
|
||||
end;
|
||||
|
||||
procedure TModulePageControl.HideDesignPages;
|
||||
procedure TModulePageControl.RemoveDesignPages;
|
||||
begin
|
||||
FreeAndNil(FTabSheetAnchors);
|
||||
FreeAndNil(FTabSheetDesigner);
|
||||
@ -182,7 +182,6 @@ begin
|
||||
if not Assigned(DesignForm.AnchorDesigner) then
|
||||
begin
|
||||
DesignForm.AnchorDesigner := TAnchorDesigner.Create(DesignForm, Resizer.ResizeFrame.PanelAnchorContainer);
|
||||
DesignForm.AnchorDesigner.IsFocusedFunc := @Resizer.ResizeFrame.IsFocused;
|
||||
DesignForm.AnchorDesigner.OnDesignerSetFocus := @DesignerSetFocus;
|
||||
end;
|
||||
DesignForm.AnchorDesigner.Refresh;
|
||||
|
@ -273,7 +273,7 @@ begin
|
||||
if (LWindow.SourceEditorWindowInterface.ActiveEditor = nil)
|
||||
or (LWindow.SourceEditorWindowInterface.ActiveEditor.GetDesigner(True) <> nil)
|
||||
then
|
||||
LPageCtrl.HideDesignPages
|
||||
LPageCtrl.RemoveDesignPages
|
||||
else begin
|
||||
LPageCtrl.CreateTabSheetDesigner;
|
||||
if not (LPageCtrl.DesignForm.Form is TNonControlProxyDesignerForm) then
|
||||
|
Loading…
Reference in New Issue
Block a user