fixed popupmenu for component palette

git-svn-id: trunk@4125 -
This commit is contained in:
mattias 2003-05-03 09:53:33 +00:00
parent 6eac8cd3b3
commit 7b321b0a5a

View File

@ -39,7 +39,7 @@ interface
uses uses
Classes, SysUtils, Dialogs, Graphics, ExtCtrls, Buttons, Menus, LResources, Classes, SysUtils, Dialogs, Graphics, ExtCtrls, Buttons, Menus, LResources,
AVL_Tree, ComponentReg, PackageDefs, LazarusIDEStrConsts; AVL_Tree, ComponentReg, IDEProcs, PackageDefs, LazarusIDEStrConsts;
const const
ComponentPaletteBtnWidth = 25; ComponentPaletteBtnWidth = 25;
@ -251,6 +251,8 @@ begin
fUnregisteredIcon.Free; fUnregisteredIcon.Free;
fUnregisteredIcon:=nil; fUnregisteredIcon:=nil;
end; end;
PopupMenu.Free;
PopupMenu:=nil;
inherited Destroy; inherited Destroy;
end; end;
@ -350,6 +352,7 @@ begin
CurPage:=Pages[i]; CurPage:=Pages[i];
if not CurPage.Visible then continue; if not CurPage.Visible then continue;
CurNoteBookPage:=TPage(CurPage.PageComponent); CurNoteBookPage:=TPage(CurPage.PageComponent);
if not (CurNoteBookPage is TPage) then RaiseException('CurNoteBookPage');
ButtonX:=0; ButtonX:=0;
// create selection button // create selection button
if CurPage.SelectButton=nil then begin if CurPage.SelectButton=nil then begin
@ -389,7 +392,7 @@ begin
Hint := CurComponent.ComponentClass.ClassName; Hint := CurComponent.ComponentClass.ClassName;
SetBounds(ButtonX,0,ComponentPaletteBtnWidth,ComponentPaletteBtnHeight); SetBounds(ButtonX,0,ComponentPaletteBtnWidth,ComponentPaletteBtnHeight);
inc(ButtonX,ComponentPaletteBtnWidth+2); inc(ButtonX,ComponentPaletteBtnWidth+2);
PopupMenu:=Self.PopupMenu; CurBtn.PopupMenu:=Self.PopupMenu;
end; end;
end; end;
end else if CurComponent.Button<>nil then begin end else if CurComponent.Button<>nil then begin