Synchronization of dfm variables with source files lazarus / 10-Designer ---------------------------------------------------------------------- vfclists · 2014-07-30 07:01 After changing the class of a control in the IDE, the type of the object in the source was not changed and this resulted in EClassNotFound errors when I run the program, which raises these questions. Does changing the class of an object only affect the .dfm? Doesn't it automatically warn and change about the object type in the source file? Does it mean that adding code directly to the dfm will not automatically create a variable for it in the source, or that if the dfm variable already exists in the source it will not be updated? ---------------------------------------------------------------------- taazz · 2014-07-30 13:49 Quote from: vfclists on July 30, 2014, 09:01:09 am After changing the class of a control in the IDE, How? as far as I know there is no such think in the IDE, you have to delete the existing object and place the new one. Changing the name of the new object to the old one might solve all compile problems or it might not. Quote from: vfclists on July 30, 2014, 09:01:09 am the type of the object in the source was not changed and this resulted in EClassNotFound errors when I run the program, which raises these questions. Does changing the class of an object only affect the .dfm? Doesn't it automatically warn and change about the object type in the source file? Does it mean that adding code directly to the dfm will not automatically create a variable for it in the source, or that if the dfm variable already exists in the source it will not be updated? Yeah that is what happens if you edit the lfm directly, no lfm does not support two way editing if you make any change to the lfm then you are required to make the appropriate chances to the pas file as well manually. ---------------------------------------------------------------------- vfclists · 2014-07-30 16:27 Quote from: taazz on July 30, 2014, 03:49:59 pmQuote from: vfclists on July 30, 2014, 09:01:09 am After changing the class of a control in the IDE, How? as far as I know there is no such think in the IDE, you have to delete the existing object and place the new one. Changing the name of the new object to the old one might solve all compile problems or it might not. The IDE has the ability to change the class of an object. Right click on it and from the menu you select 'Change Class...' . After you change the class you will get  a dialog that warns you if the new class doesn't have some of the properties of the previous class, and gives you the chance to delete them. If you don't know about it then welcome to Lazarus. There are lots of changes but because Lazarus developers don't blog, no one gets to know about them. When you are struggling with an existing project the last thing on your mind is looking for new IDE features.