mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 21:41:35 +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)
|
exit(pfcbcFrame)
|
||||||
else if CompareText(AClassName,'TForm')=0 then
|
else if CompareText(AClassName,'TForm')=0 then
|
||||||
exit(pfcbcForm)
|
exit(pfcbcForm)
|
||||||
|
else if CompareText(AClassName,'TCustomForm')=0 then
|
||||||
|
exit(pfcbcCustomForm)
|
||||||
else if CompareText(AClassName,'TDataModule')=0 then
|
else if CompareText(AClassName,'TDataModule')=0 then
|
||||||
exit(pfcbcDataModule);
|
exit(pfcbcDataModule);
|
||||||
end;
|
end;
|
||||||
|
@ -250,7 +250,7 @@ var
|
|||||||
for i := 0 to Project.UnitCount - 1 do
|
for i := 0 to Project.UnitCount - 1 do
|
||||||
if (Project.Units[i].IsPartOfProject) and
|
if (Project.Units[i].IsPartOfProject) and
|
||||||
(Project.Units[i].ComponentName <> '') 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
|
(IndexOfAutoCreateForm(Project.Units[i].ComponentName) < 0) then
|
||||||
sl.Add(Project.Units[i].ComponentName);
|
sl.Add(Project.Units[i].ComponentName);
|
||||||
sl.Sort;
|
sl.Sort;
|
||||||
|
@ -1875,7 +1875,7 @@ begin
|
|||||||
and FilenameIsPascalUnit(ActiveUnitInfo.Filename) then
|
and FilenameIsPascalUnit(ActiveUnitInfo.Filename) then
|
||||||
begin
|
begin
|
||||||
UpdateUnitInfoResourceBaseClass(ActiveUnitInfo,true);
|
UpdateUnitInfoResourceBaseClass(ActiveUnitInfo,true);
|
||||||
if ActiveUnitInfo.ResourceBaseClass in [pfcbcForm,pfcbcDataModule] then
|
if ActiveUnitInfo.ResourceBaseClass in [pfcbcForm,pfcbcCustomForm,pfcbcDataModule] then
|
||||||
begin
|
begin
|
||||||
LFMFilename:=ActiveUnitInfo.UnitResourceFileformat.GetUnitResourceFilename(ActiveUnitInfo.Filename,true);
|
LFMFilename:=ActiveUnitInfo.UnitResourceFileformat.GetUnitResourceFilename(ActiveUnitInfo.Filename,true);
|
||||||
if LoadCodeBuffer(LFMCode,LFMFilename,[lbfUpdateFromDisk],false)=mrOk then
|
if LoadCodeBuffer(LFMCode,LFMFilename,[lbfUpdateFromDisk],false)=mrOk then
|
||||||
@ -6073,12 +6073,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
if NewComponent is TFrame then
|
AnUnitInfo.ResourceBaseClass:=GetComponentBaseClass(NewComponent.ClassType);
|
||||||
AnUnitInfo.ResourceBaseClass:=pfcbcFrame
|
|
||||||
else if NewComponent is TDataModule then
|
|
||||||
AnUnitInfo.ResourceBaseClass:=pfcbcDataModule
|
|
||||||
else if NewComponent is TForm then
|
|
||||||
AnUnitInfo.ResourceBaseClass:=pfcbcForm;
|
|
||||||
|
|
||||||
Project1.InvalidateUnitComponentDesignerDependencies;
|
Project1.InvalidateUnitComponentDesignerDependencies;
|
||||||
AnUnitInfo.Component:=NewComponent;
|
AnUnitInfo.Component:=NewComponent;
|
||||||
@ -6339,9 +6334,12 @@ begin
|
|||||||
for i:=0 to ListOfPFindContext.Count-1 do begin
|
for i:=0 to ListOfPFindContext.Count-1 do begin
|
||||||
Context:=PFindContext(ListOfPFindContext[i]);
|
Context:=PFindContext(ListOfPFindContext[i]);
|
||||||
Ancestor:=UpperCase(Context^.Tool.ExtractClassName(Context^.Node,false));
|
Ancestor:=UpperCase(Context^.Tool.ExtractClassName(Context^.Node,false));
|
||||||
if (Ancestor='TFORM') or (Ancestor='TCUSTOMFORM') then begin
|
if (Ancestor='TFORM') then begin
|
||||||
AnUnitInfo.ResourceBaseClass:=pfcbcForm;
|
AnUnitInfo.ResourceBaseClass:=pfcbcForm;
|
||||||
exit(true);
|
exit(true);
|
||||||
|
end else if (Ancestor='TCUSTOMFORM') then begin
|
||||||
|
AnUnitInfo.ResourceBaseClass:=pfcbcCustomForm;
|
||||||
|
exit(true);
|
||||||
end else if Ancestor='TDATAMODULE' then begin
|
end else if Ancestor='TDATAMODULE' then begin
|
||||||
AnUnitInfo.ResourceBaseClass:=pfcbcDataModule;
|
AnUnitInfo.ResourceBaseClass:=pfcbcDataModule;
|
||||||
exit(true);
|
exit(true);
|
||||||
|
@ -110,7 +110,8 @@ type
|
|||||||
pfcbcNone, // unknown
|
pfcbcNone, // unknown
|
||||||
pfcbcForm, // is TForm
|
pfcbcForm, // is TForm
|
||||||
pfcbcFrame, // is TFrame
|
pfcbcFrame, // is TFrame
|
||||||
pfcbcDataModule // is TDataModule
|
pfcbcDataModule,// is TDataModule
|
||||||
|
pfcbcCustomForm // is TCustomForm (not TForm)
|
||||||
);
|
);
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -118,7 +119,8 @@ const
|
|||||||
'None',
|
'None',
|
||||||
'Form',
|
'Form',
|
||||||
'Frame',
|
'Frame',
|
||||||
'DataModule'
|
'DataModule',
|
||||||
|
'CustomForm'
|
||||||
);
|
);
|
||||||
|
|
||||||
function StrToComponentBaseClass(const s: string): TPFComponentBaseClass;
|
function StrToComponentBaseClass(const s: string): TPFComponentBaseClass;
|
||||||
@ -1098,7 +1100,9 @@ begin
|
|||||||
else if aClass.InheritsFrom(TFrame) then
|
else if aClass.InheritsFrom(TFrame) then
|
||||||
Result:=pfcbcFrame
|
Result:=pfcbcFrame
|
||||||
else if aClass.InheritsFrom(TDataModule) then
|
else if aClass.InheritsFrom(TDataModule) then
|
||||||
Result:=pfcbcDataModule;
|
Result:=pfcbcDataModule
|
||||||
|
else if aClass.InheritsFrom(TCustomForm) then
|
||||||
|
Result:=pfcbcCustomForm;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CompareLazPackageID(Data1, Data2: Pointer): integer;
|
function CompareLazPackageID(Data1, Data2: Pointer): integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user