diff --git a/ide/customformeditor.pp b/ide/customformeditor.pp index 26e18eae3d..cc9be24644 100644 --- a/ide/customformeditor.pp +++ b/ide/customformeditor.pp @@ -389,6 +389,8 @@ begin exit(pfcbcFrame) else if CompareText(AClassName,'TForm')=0 then exit(pfcbcForm) + else if CompareText(AClassName,'TCustomForm')=0 then + exit(pfcbcCustomForm) else if CompareText(AClassName,'TDataModule')=0 then exit(pfcbcDataModule); end; diff --git a/ide/frames/project_forms_options.pas b/ide/frames/project_forms_options.pas index 740cc84294..5d634777c4 100644 --- a/ide/frames/project_forms_options.pas +++ b/ide/frames/project_forms_options.pas @@ -250,7 +250,7 @@ var for i := 0 to Project.UnitCount - 1 do if (Project.Units[i].IsPartOfProject) and (Project.Units[i].ComponentName <> '') and - (Project.Units[i].ResourceBaseClass in [pfcbcForm, pfcbcDataModule]) and + (Project.Units[i].ResourceBaseClass in [pfcbcForm, pfcbcCustomForm,pfcbcDataModule]) and (IndexOfAutoCreateForm(Project.Units[i].ComponentName) < 0) then sl.Add(Project.Units[i].ComponentName); sl.Sort; diff --git a/ide/sourcefilemanager.pas b/ide/sourcefilemanager.pas index f487b7f058..b038723bd8 100644 --- a/ide/sourcefilemanager.pas +++ b/ide/sourcefilemanager.pas @@ -1876,7 +1876,7 @@ begin and FilenameIsPascalUnit(ActiveUnitInfo.Filename) then begin UpdateUnitInfoResourceBaseClass(ActiveUnitInfo,true); - if ActiveUnitInfo.ResourceBaseClass in [pfcbcForm,pfcbcDataModule] then + if ActiveUnitInfo.ResourceBaseClass in [pfcbcForm,pfcbcCustomForm,pfcbcDataModule] then begin LFMFilename:=ActiveUnitInfo.UnitResourceFileformat.GetUnitResourceFilename(ActiveUnitInfo.Filename,true); if LoadCodeBuffer(LFMCode,LFMFilename,[lbfUpdateFromDisk],false)=mrOk then @@ -6068,12 +6068,7 @@ begin end; {$ENDIF} - if NewComponent is TFrame then - AnUnitInfo.ResourceBaseClass:=pfcbcFrame - else if NewComponent is TDataModule then - AnUnitInfo.ResourceBaseClass:=pfcbcDataModule - else if NewComponent is TForm then - AnUnitInfo.ResourceBaseClass:=pfcbcForm; + AnUnitInfo.ResourceBaseClass:=GetComponentBaseClass(NewComponent.ClassType); Project1.InvalidateUnitComponentDesignerDependencies; AnUnitInfo.Component:=NewComponent; @@ -6334,9 +6329,12 @@ begin for i:=0 to ListOfPFindContext.Count-1 do begin Context:=PFindContext(ListOfPFindContext[i]); Ancestor:=UpperCase(Context^.Tool.ExtractClassName(Context^.Node,false)); - if (Ancestor='TFORM') or (Ancestor='TCUSTOMFORM') then begin + if (Ancestor='TFORM') then begin AnUnitInfo.ResourceBaseClass:=pfcbcForm; exit(true); + end else if (Ancestor='TCUSTOMFORM') then begin + AnUnitInfo.ResourceBaseClass:=pfcbcCustomForm; + exit(true); end else if Ancestor='TDATAMODULE' then begin AnUnitInfo.ResourceBaseClass:=pfcbcDataModule; exit(true); diff --git a/packager/packagedefs.pas b/packager/packagedefs.pas index 3ac5888e48..b61fe0f385 100644 --- a/packager/packagedefs.pas +++ b/packager/packagedefs.pas @@ -110,7 +110,8 @@ type pfcbcNone, // unknown pfcbcForm, // is TForm pfcbcFrame, // is TFrame - pfcbcDataModule // is TDataModule + pfcbcDataModule,// is TDataModule + pfcbcCustomForm // is TCustomForm (not TForm) ); const @@ -118,7 +119,8 @@ const 'None', 'Form', 'Frame', - 'DataModule' + 'DataModule', + 'CustomForm' ); function StrToComponentBaseClass(const s: string): TPFComponentBaseClass; @@ -1093,7 +1095,9 @@ begin else if aClass.InheritsFrom(TFrame) then Result:=pfcbcFrame else if aClass.InheritsFrom(TDataModule) then - Result:=pfcbcDataModule; + Result:=pfcbcDataModule + else if aClass.InheritsFrom(TCustomForm) then + Result:=pfcbcCustomForm; end; function CompareLazPackageID(Data1, Data2: Pointer): integer;