Designer problem with custom control based on TCustomForm
Original Reporter info from Mantis: Phil
-
Reporter name:
Original Reporter info from Mantis: Phil
- Reporter name:
Description:
If FormEditingHook.RegisterDesignerBaseClass is used to register a class based on TCustomForm, the IDE raises an exception in TCustomFormEditor.DeleteComponent because the component's designer form is not TCustomNonFormDesignerForm.
Yet TMainIDE.CreateDesignerForComponent uses the component itself as the designer form when the component is TCustomForm, so there's no way to associate a different designer.
I fixed it like this, in TCustomFormEditor.DeleteComponent:
if (AForm<>nil) and (not (AForm is TCustomNonFormDesignerForm)) and (not (AForm is TCustomForm)) then
This look like debug code that perhaps should be removed. The following lines check again:
if (AForm <> nil) and (AForm is TCustomNonFormDesignerForm) then
so there's no harm in AForm not being TCustomNonFormDesignerForm.
Thanks.
-Phil
Mantis conversion info:
- Mantis ID: 13694
- Platform: All
- Version: 0.9.26.2
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 21780 (#634d3996)
- Target version: 1.0.0
- LazTarget: 1.0