mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 11:39:19 +02:00
IDE: Bug fix for copy\paste of components for designed form for Qt and Gtk2. From Maciej.
git-svn-id: trunk@50419 -
This commit is contained in:
parent
79dcb7831b
commit
a1667bc145
48
ide/main.pp
48
ide/main.pp
@ -2423,19 +2423,51 @@ function TMainIDE.GetActiveDesignerSkipMainBar: TComponentEditorDesigner;
|
|||||||
// returns the designer that is currently active
|
// returns the designer that is currently active
|
||||||
// the MainIDEBar is ignored
|
// the MainIDEBar is ignored
|
||||||
var
|
var
|
||||||
ActForm: TCustomForm;
|
ActForm, ActParentForm: TCustomForm;
|
||||||
ActControl: TWinControl;
|
ActControl: TWinControl;
|
||||||
|
|
||||||
|
function TryGetDesignerFromForm(AForm: TCustomForm;
|
||||||
|
out ADesigner: TComponentEditorDesigner): Boolean;
|
||||||
|
begin
|
||||||
|
if Assigned(IDETabMaster) and (AForm is TSourceEditorWindowInterface)
|
||||||
|
and (IDETabMaster.TabDisplayState=tdsDesign)
|
||||||
|
then
|
||||||
|
ADesigner := TComponentEditorDesigner(TSourceEditorWindowInterface(AForm).
|
||||||
|
ActiveEditor.GetDesigner(True))
|
||||||
|
else
|
||||||
|
ADesigner := nil;
|
||||||
|
|
||||||
|
Result := ADesigner <> nil;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ActForm:=Screen.ActiveCustomForm;
|
ActForm:=Screen.ActiveCustomForm;
|
||||||
if ActForm=MainIDEBar then
|
|
||||||
|
if ActForm = nil then
|
||||||
|
Exit(nil);
|
||||||
|
|
||||||
|
if TryGetDesignerFromForm(ActForm, Result) then
|
||||||
|
Exit; // docked design form has focus (inside SourceEditorWindow)
|
||||||
|
|
||||||
|
ActControl:=ActForm.ActiveControl;
|
||||||
|
if ActControl<>nil then
|
||||||
begin
|
begin
|
||||||
ActControl:=ActForm.ActiveControl;
|
ActParentForm := GetFirstParentForm(ActControl);
|
||||||
if (ActControl<>nil) and (GetFirstParentForm(ActControl)<>MainIDEBar) then
|
if TryGetDesignerFromForm(ActParentForm, Result) then
|
||||||
exit(nil); // a docked form has focus
|
Exit; // docked design form has focus (inside docked SourceEditorWindow)
|
||||||
if Screen.CustomFormZOrderCount < 2 then exit(nil);
|
|
||||||
ActForm:=Screen.CustomFormsZOrdered[1];
|
if ActForm=MainIDEBar then
|
||||||
|
if (ActParentForm<>MainIDEBar) then
|
||||||
|
Exit(nil); // a docked form has focus
|
||||||
end;
|
end;
|
||||||
if (ActForm<>nil) and (ActForm.Designer is TComponentEditorDesigner) then
|
|
||||||
|
if ActForm=MainIDEBar then
|
||||||
|
if Screen.CustomFormZOrderCount < 2 then
|
||||||
|
Exit(nil)
|
||||||
|
else
|
||||||
|
ActForm:=Screen.CustomFormsZOrdered[1];
|
||||||
|
|
||||||
|
if (ActForm.Designer is TComponentEditorDesigner) then
|
||||||
Result := TComponentEditorDesigner(ActForm.Designer)
|
Result := TComponentEditorDesigner(ActForm.Designer)
|
||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user