mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:09:21 +02:00
IDE: component palette: release buttons instead of free
git-svn-id: trunk@31602 -
This commit is contained in:
parent
9ce6c166e2
commit
f2fdce8015
@ -37,8 +37,8 @@ unit ComponentPalette;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLProc, Controls, Dialogs, Graphics, ExtCtrls, ComCtrls,
|
Classes, SysUtils, LCLProc, Controls, Forms, Dialogs, Graphics, ExtCtrls,
|
||||||
Buttons, FileUtil, Menus, LResources, AVL_Tree,
|
ComCtrls, Buttons, FileUtil, Menus, LResources, AVL_Tree,
|
||||||
PropEdits, FormEditingIntf, LazIDEIntf, MacroIntf,
|
PropEdits, FormEditingIntf, LazIDEIntf, MacroIntf,
|
||||||
{$IFDEF CustomIDEComps}
|
{$IFDEF CustomIDEComps}
|
||||||
CustomIDEComps,
|
CustomIDEComps,
|
||||||
@ -496,6 +496,7 @@ begin
|
|||||||
for j:= 1 to Page.ControlCount-1 do begin
|
for j:= 1 to Page.ControlCount-1 do begin
|
||||||
CurButton:=TSpeedbutton(Page.Controls[j]);
|
CurButton:=TSpeedbutton(Page.Controls[j]);
|
||||||
if not (CurButton is TSpeedButton) then continue;
|
if not (CurButton is TSpeedButton) then continue;
|
||||||
|
if not CurButton.Visible then continue;
|
||||||
ButtonTree.Add(CurButton);
|
ButtonTree.Add(CurButton);
|
||||||
end;
|
end;
|
||||||
if ButtonTree.Count=0 then exit;
|
if ButtonTree.Count=0 then exit;
|
||||||
@ -572,12 +573,13 @@ begin
|
|||||||
CurPage:=Pages[PageIndex];
|
CurPage:=Pages[PageIndex];
|
||||||
CurBtn:=TSpeedButton(CurPage.SelectButton);
|
CurBtn:=TSpeedButton(CurPage.SelectButton);
|
||||||
CurPage.SelectButton:=nil;
|
CurPage.SelectButton:=nil;
|
||||||
CurBtn.Free;
|
Application.ReleaseComponent(CurBtn);
|
||||||
Pages[PageIndex].PageComponent:=nil;
|
Pages[PageIndex].PageComponent:=nil;
|
||||||
end;
|
end;
|
||||||
if FPageControl.Pages[i]=OldActivePage then
|
if FPageControl.Pages[i]=OldActivePage then
|
||||||
OldActivePage:=nil;
|
OldActivePage:=nil;
|
||||||
FPageControl.Pages[i].Free;
|
FPageControl.Pages[i].Visible:=false;
|
||||||
|
Application.ReleaseComponent(FPageControl.Pages[i]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -689,7 +691,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else if CurComponent.Button<>nil then begin
|
end else if CurComponent.Button<>nil then begin
|
||||||
//debugln(['TComponentPalette.UpdateNoteBookButtons Destroy Button: ',CurComponent.ComponentClass.ClassName,' ',CurComponent.Button.Name]);
|
//debugln(['TComponentPalette.UpdateNoteBookButtons Destroy Button: ',CurComponent.ComponentClass.ClassName,' ',CurComponent.Button.Name]);
|
||||||
CurComponent.Button.Free;
|
TControl(CurComponent.Button).Visible:=false;
|
||||||
|
Application.ReleaseComponent(CurComponent.Button);
|
||||||
CurComponent.Button:=nil;
|
CurComponent.Button:=nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -711,7 +714,7 @@ begin
|
|||||||
SortedCompList.Free;
|
SortedCompList.Free;
|
||||||
SortedPageList.Free;
|
SortedPageList.Free;
|
||||||
end;
|
end;
|
||||||
//writeln('TComponentPalette.UpdateNoteBookButtons END');
|
//debugln('TComponentPalette.UpdateNoteBookButtons END');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TComponentPalette.OnGetNonVisualCompIcon(Sender: TObject;
|
procedure TComponentPalette.OnGetNonVisualCompIcon(Sender: TObject;
|
||||||
|
@ -16229,7 +16229,7 @@ begin
|
|||||||
FDisplayState:= dsSource;
|
FDisplayState:= dsSource;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.OnDesignerActivated(Sender: TObject);
|
procedure TMainIDE.OnDesignerActivated(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FDisplayState:= dsForm;
|
FDisplayState:= dsForm;
|
||||||
FLastFormActivated := (Sender as TDesigner).Form;
|
FLastFormActivated := (Sender as TDesigner).Form;
|
||||||
|
Loading…
Reference in New Issue
Block a user