mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 22:03:08 +02:00
Menu designer: Add/remove OnDesignerSetSelection handler when window is shown/hidden. Issue #30712, inspired by a patch from Michl.
git-svn-id: trunk@53087 -
This commit is contained in:
parent
738cf3bc30
commit
61e72dabdc
@ -11,6 +11,8 @@ object MenuDesignerForm: TMenuDesignerForm
|
|||||||
KeyPreview = True
|
KeyPreview = True
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
|
OnHide = FormHide
|
||||||
|
OnShow = FormShow
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '1.7'
|
LCLVersion = '1.7'
|
||||||
|
@ -62,6 +62,8 @@ type
|
|||||||
SubmenuGroupBox: TGroupBox;
|
SubmenuGroupBox: TGroupBox;
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormHide(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
procedure HelpButtonClick(Sender: TObject);
|
procedure HelpButtonClick(Sender: TObject);
|
||||||
strict private
|
strict private
|
||||||
FDesigner: TMenuDesignerBase;
|
FDesigner: TMenuDesignerBase;
|
||||||
@ -244,7 +246,6 @@ begin
|
|||||||
LoadFixedButtonGlyphs;
|
LoadFixedButtonGlyphs;
|
||||||
LoadVariableButtonGlyphs(True);
|
LoadVariableButtonGlyphs(True);
|
||||||
KeyPreview:=True;
|
KeyPreview:=True;
|
||||||
GlobalDesignHook.AddHandlerSetSelection(@OnDesignerSetSelection);
|
|
||||||
InitializeStatisticVars;
|
InitializeStatisticVars;
|
||||||
SetupPopupAssignmentsDisplay;
|
SetupPopupAssignmentsDisplay;
|
||||||
end;
|
end;
|
||||||
@ -254,6 +255,16 @@ begin
|
|||||||
FreeAndNil(FPopupAssignments);
|
FreeAndNil(FPopupAssignments);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMenuDesignerForm.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
GlobalDesignHook.AddHandlerSetSelection(@OnDesignerSetSelection);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMenuDesignerForm.FormHide(Sender: TObject);
|
||||||
|
begin
|
||||||
|
GlobalDesignHook.RemoveHandlerSetSelection(@OnDesignerSetSelection);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMenuDesignerForm.HelpButtonClick(Sender: TObject);
|
procedure TMenuDesignerForm.HelpButtonClick(Sender: TObject);
|
||||||
const
|
const
|
||||||
helpPath = 'http://wiki.lazarus.freepascal.org/IDE_Window:_Menu_Editor';
|
helpPath = 'http://wiki.lazarus.freepascal.org/IDE_Window:_Menu_Editor';
|
||||||
|
Loading…
Reference in New Issue
Block a user