You've already forked lazarus-ccr
SpkToolbar: Fix crash when a popupmenu used by a button is destroyed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8962 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -15,7 +15,7 @@ unit spkt_Buttons;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
uses LazLoggerBase,
|
||||
Graphics, Classes, Types, Controls, Menus, ActnList, Math,
|
||||
Dialogs, ImgList, Forms,
|
||||
SpkGUITools, SpkGraphTools, SpkMath,
|
||||
@@ -127,6 +127,7 @@ type
|
||||
|
||||
function GetRootComponent: TComponent;
|
||||
function IsRightToLeft: Boolean;
|
||||
procedure Notify(Item: TComponent; Operation: TOperation); override;
|
||||
|
||||
property ActionLink: TSpkButtonActionLink read FActionLink;
|
||||
property Checked: Boolean read GetChecked write SetChecked default false;
|
||||
@@ -528,6 +529,15 @@ begin
|
||||
Result := (GetRootComponent as TControl).IsRightToLeft;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseButton.Notify(Item: TComponent; Operation: TOperation);
|
||||
begin
|
||||
if (Operation = opRemove) and (Item = FDropDownMenu) then
|
||||
begin
|
||||
DropDownMenu := nil;
|
||||
DebugLn('[TSpkBaseButton.Notify] Button "' + caption + '" removed ' + Item.ClassName);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseButton.MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer);
|
||||
begin
|
||||
|
Reference in New Issue
Block a user