published properties lazarus / 10-Designer ---------------------------------------------------------------------- JimKueneman · 2015-01-31 18:34 I have some custom components I have created.  I have a few published events that use setters.  The events that use setters will not read back the events.  The event and handlers are in the *.lfm file but when I go back to the object inspector and reopen the form the events are disconnected from the handlers.... Jim ---------------------------------------------------------------------- howardpc · 2015-01-31 18:53 How did you override the DefineProperties procedure? ---------------------------------------------------------------------- Blaazen · 2015-01-31 19:18 You should show us the code. Usually, events are defined like: Code: [Select]property OnChange: TNotifyEvent read FOnChange write FOnChange;If you use setter "SetOnChange", it should have code like: Code: [Select]  if FOnChange=AValue then exit;   FOnChange:=AValue;   ...your code... ---------------------------------------------------------------------- JimKueneman · 2015-01-31 19:35 Code: [Select]type     TOnMessageEvent = procedure(Sender: TObject; OlcbMessage: TOlcbMessage) of object; Code: [Select]  TMustangpeakComConnection = class(TComponent)   private     FOnSendMessage: TOnMessageEvent;     procedure SetOnSendMessage(AValue: TOnMessageEvent); published     property OnSendMessage: TOnMessageEvent read FOnSendMessage write SetOnSendMessage;                      Code: [Select]procedure TMustangpeakComConnection.SetOnSendMessage(AValue: TOnMessageEvent); begin   if FOnSendMessage <> AValue then   begin     FOnSendMessage:=AValue;     if not (csDesigning in ComponentState) then       UpdateThreadsEvents;   end; end; I have not overridden DefineProperty ---------------------------------------------------------------------- Blaazen · 2015-01-31 19:59 I can't see anything wrong although I never used setters for events. ---------------------------------------------------------------------- Basile B. · 2015-01-31 23:59 Check/Verify you register procedure. Code: [Select]procedure Register; begin   RegisterComponents('MyCategory', [TMustangpeakComConnection]); end; and also initialization   RegisterClasses([TMustangpeakComConnection]); end. Have you changed the classes after having setup the component ? Since the components are statically linked maybe you also have to reinstall (not just compile) your package after each modification. ---------------------------------------------------------------------- JimKueneman · 2015-02-01 01:53 QuoteCheck/Verify you register procedure. Code: [Select] procedure Register; begin   RegisterComponents('MyCategory', [TMustangpeakComConnection]); end; and also initialization   RegisterClasses([TMustangpeakComConnection]); end. First one was already done.  The second did not change anything QuoteHave you changed the classes after having setup the component ? Since the components are statically linked maybe you also have to reinstall (not just compile) your package after each modification. No effect. Jim ---------------------------------------------------------------------- engkin · 2015-02-01 16:57 I accuse UpdateThreadsEvents and that you are not checking for csLoading in ComponentState in the setter. You can check that the setter is being called. ---------------------------------------------------------------------- Martin_fr · 2015-02-01 17:20 Debug the IDE (open ide/lazarus.lpi and F9), when you open the form. Set a breakpoint on your setter, and see if it is called. Maybe it is, but it is undone later? Also: QuoteCode: [Select] if not (csDesigning in ComponentState) then You should probably also check for csLoading (You may need to check this in the parent object). Unless the code should be run during loading.But even then, it should probably be deferred to OnLoaded. ---------------------------------------------------------------------- JimKueneman · 2015-02-26 14:02 Finally back to this.  When I try to compile lazarus and run the debugger I get this dialog? Nothing to do   The project's compiler options has no compile command   See Project/Compiler Options.../Compilation I am not understanding what this means.  Nothing in the Compilation tab looks any different than any of my projects. Jim