mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:47:58 +02:00
IDE: added resourcebaseclass customform
git-svn-id: trunk@61911 -
This commit is contained in:
parent
028edb1573
commit
ca832657cf
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1875,7 +1875,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
|
||||
@ -6073,12 +6073,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;
|
||||
@ -6339,9 +6334,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);
|
||||
|
@ -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;
|
||||
@ -1098,7 +1100,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;
|
||||
|
Loading…
Reference in New Issue
Block a user