mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-22 23:01:35 +02:00
IDE: component list: select and close
git-svn-id: trunk@35064 -
This commit is contained in:
parent
e384b4c266
commit
d273b4fcd8
@ -8,6 +8,7 @@ object ComponentListForm: TComponentListForm
|
||||
ClientHeight = 556
|
||||
ClientWidth = 338
|
||||
KeyPreview = True
|
||||
OnClose = FormClose
|
||||
OnKeyDown = FormKeyDown
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.31'
|
||||
|
@ -62,6 +62,7 @@ type
|
||||
procedure ComponentsListboxDblClick(Sender: TObject);
|
||||
procedure ComponentsListboxDrawItem(Control: TWinControl; Index: Integer;
|
||||
ARect: TRect; State: TOwnerDrawState);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure TreeCustomDrawItem(Sender: TCustomTreeView;
|
||||
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
|
||||
procedure ComponentsListboxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
@ -360,6 +361,25 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TComponentListForm.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
// Using a dock manager...
|
||||
if Parent<>nil then
|
||||
begin
|
||||
CloseAction := caNone;
|
||||
//todo: helper function in DockManager or IDEDockMaster for closing forms.
|
||||
// Only close the window if it's floating.
|
||||
// AnchorDocking doesn't seem to initialize 'FloatingDockSiteClass' so we can't just check 'Floating'.
|
||||
// Also, AnchorDocking use nested forms, so the check for HostDockSite.Parent.
|
||||
if Assigned(HostDockSite) and (HostDockSite.DockClientCount <= 1)
|
||||
and (HostDockSite is TCustomForm) and (HostDockSite.Parent = nil) then
|
||||
begin
|
||||
TCustomForm(HostDockSite).Close;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TComponentListForm.TreeCustomDrawItem(Sender: TCustomTreeView;
|
||||
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user