[Lazarus] Detect that component selected in OI.

Vojtěch Čihák vojtech.cihak at atlas.cz
Sun May 22 17:37:48 CEST 2016


Separating Component Editors is quiet easy but how can I separate the Hook (SelectionHook method) when I need "self"?
 
Thanks, V.
 
______________________________________________________________
> Od: Ondrej Pokorny <lazarus at kluug.net>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 22.05.2016 16:10
> Předmět: Re: [Lazarus] Detect that component selected in OI.
>
On 22.05.2016 15:45, Vojtěch Čihák wrote:With a small correction: it must be hooked only in design time.
 
constructor TMyTabSheet.Create(TheOwner: TComponent);
begin
  ...
  if csDesigning in ComponentState then
    GlobalDesignHook.AddHandlerSetSelection(@HookSelection);
end;

 You should separate the hook completely from your run-time code. Use the hook (and include IDEIntf) only in your design-time package and unit.
 
 Ondrej
 
 
 ----------
 
 --
 _______________________________________________
 Lazarus mailing list
 Lazarus at lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160522/dd3d1fa6/attachment-0004.html>


More information about the Lazarus mailing list