onFormChanged event lazarus / 10-Designer ---------------------------------------------------------------------- warleyalex · 2018-08-12 22:18 The plan would be to implement an IDE notifier to the Lazarus plugin IDE project event onFormChanged. For instance, whenever a form designer has been changed I would like to fire a method. e.g. You drag 'n drop a TLabel widget into designer, set the Caption to 'abcd' and then fire the event "onFormChanged". So, I am stuck on this plan. Any idea is very welcome. ---------------------------------------------------------------------- warleyalex · 2018-08-13 14:53 Every designed LCL form has a Designer of type TIDesigner. The IDE creates designers of type TComponentEditorDesigner defined in the IDEIntf unit componenteditors. You get notified when a designer form is modified with this piece of code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GlobalDesignHook.AddHandlerModified(@Extension.OnDesignerModified); ...but there is an issue here: the designer is notified using only the Object Inspector! Important note: when you resize a component at design-time, you resize with the mouse, dragging the component, the designer is not notified! Any idea? ---------------------------------------------------------------------- warleyalex · 2018-08-13 17:13 I'll share you guys the solution. ...the problem of the method AddHandlerModified is triggered after little change, for instance, if I set the WebLabel caption to 'abc' the method is fired 3 times. This is unwanted. I only want to trigger on form save. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GlobalDesignHook.AddHandlerModified(@Extension.OnDesignerModified);  I found the undocumented method AddHandlerOnSaveEditorFile. We can fire the method LFM-TO-PAS "on before save" the form unit. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i LazarusIDE. AddHandlerOnSaveEditorFile(@Extension.BeforeSaveCallLFM2PAS); Do not forget to use RemoveHandlerOnSaveEditorFile on the add-on the destructor. This is the trick!