From: Erik B. <eb...@us...> - 2007-03-18 16:13:29
|
Update of /cvsroot/gexperts/gexperts/unstable/Src/Utils In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15248/Src/Utils Modified Files: GX_GenericUtils.pas GX_OtaUtils.pas Log Message: Minor Delphi 2007 changes Index: GX_OtaUtils.pas =================================================================== RCS file: /cvsroot/gexperts/gexperts/unstable/Src/Utils/GX_OtaUtils.pas,v retrieving revision 1.198 retrieving revision 1.199 diff -u -d -r1.198 -r1.199 --- GX_OtaUtils.pas 26 Feb 2007 06:20:13 -0000 1.198 +++ GX_OtaUtils.pas 17 Mar 2007 07:26:30 -0000 1.199 @@ -292,7 +292,7 @@ // Returns file name of the project; returns // an empty string if there is no (active) project. -// Use NormalizeBdsProj to get the dpr instead of the bdsproj for Delphi projects +// Use NormalizeBdsProj to get the dpr instead of the bdsproj/dproj for Delphi projects function GxOtaGetProjectFileName(Project: IOTAProject; NormalizeBdsProj: Boolean = False): string; function GxOtaGetCurrentProjectFileName(NormalizeBdsProj: Boolean = False): string; @@ -1060,7 +1060,7 @@ Result := ''; if Assigned(Project) then begin Result := Project.FileName; - if NormalizeBdsProj and IsBdsproj(Result) then begin + if NormalizeBdsProj and IsBdsprojOrDproj(Result) then begin if GxOtaProjectIsEitherDelphi(Project) then begin Result := ChangeFileExt(Result, '.dpr'); if (not FileExists(Result)) and FileExists(ChangeFileExt(Result, '.dpk')) then @@ -2417,7 +2417,7 @@ shSQL: Result := gxpSQL; else begin Ext := ExtractUpperFileExt(FileName); - if StringInArray(Ext, ['XML', 'BDSGROUP', 'BDSPROJ']) then + if StringInArray(Ext, ['XML', 'BDSGROUP', 'BDSPROJ', 'DPROJ']) then Result := gxpXML else if StringInArray(Ext, ['HTM', 'HTML', 'ASP']) then Result := gxpHTML @@ -3649,7 +3649,7 @@ SourceEditor := GxOtaGetSourceEditorFromModule(Module, FileName); // If there is no source editor for the file name, we can't load it // We might be trying to load a .pas with the .dfm open as text - if (not (IsBdsgroup(FileName) or IsBdsproj(FileName))) and (not Assigned(SourceEditor)) then + if (not (IsBdsgroup(FileName) or IsBdsprojOrDproj(FileName))) and (not Assigned(SourceEditor)) then Exit; end; FileReader := TEditReader.Create(FileName); @@ -3766,7 +3766,7 @@ SourceEditor := GxOtaGetSourceEditorFromModule(Module, FileName); // If there is no source editor for the file name, we can't load it // We might be trying to load a .pas with the .dfm open as text - if (not (IsBdsgroup(FileName) or IsBdsproj(FileName))) and (not Assigned(SourceEditor)) then + if (not (IsBdsgroup(FileName) or IsBdsprojOrDproj(FileName))) and (not Assigned(SourceEditor)) then Exit; end; FileReader := TEditReader.Create(FileName); Index: GX_GenericUtils.pas =================================================================== RCS file: /cvsroot/gexperts/gexperts/unstable/Src/Utils/GX_GenericUtils.pas,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- GX_GenericUtils.pas 26 Feb 2007 06:18:49 -0000 1.152 +++ GX_GenericUtils.pas 17 Mar 2007 07:26:30 -0000 1.153 @@ -265,7 +265,8 @@ // Sets the ParentBackground property, if supported by the current VCL version // This needs to be false for colored TPanels that can appear in a themed app -procedure SetParentBackgroundValue(Panel: TCustomPanel; Value: Boolean); +procedure SetParentBackgroundValue(Panel: TCustomPanel; Value: Boolean); overload; +procedure SetParentBackgroundValue(GroupBox: TGroupBox; Value: Boolean); overload; // Determine if the passed in class inherits from ClassName without // linking in the units that contain ClassName @@ -319,6 +320,8 @@ function IsDcp(const FileName: string): Boolean; function IsBdsgroup(const FileName: string): Boolean; function IsBdsproj(const FileName: string): Boolean; +function IsDproj(const FileName: string): Boolean; +function IsBdsprojOrDproj(const FileName: string): Boolean; function IsPackage(const FileName: string): Boolean; function IsDelphiPackage(const FileName: string): Boolean; function IsCsproj(const FileName: string): Boolean; @@ -1800,10 +1803,19 @@ procedure SetParentBackgroundValue(Panel: TCustomPanel; Value: Boolean); begin {$IFDEF GX_VER150_up} // Delphi 7+ + Assert(Assigned(Panel)); Panel.ParentBackground := Value; {$ENDIF} end; +procedure SetParentBackgroundValue(GroupBox: TGroupBox; Value: Boolean); +begin + {$IFDEF GX_VER150_up} // Delphi 7+ + Assert(Assigned(GroupBox)); + GroupBox.ParentBackground := Value; + {$ENDIF} +end; + function InheritsFromClass(ClassType: TClass; const ClassName: string): Boolean; begin Result := True; @@ -2078,6 +2090,7 @@ or IsBpr(FileName) or IsBdsgroup(FileName) or IsBdsproj(FileName) + or IsDproj(FileName) or IsPackage(FileName) or IsCsproj(FileName); end; @@ -2163,6 +2176,16 @@ Result := FileMatchesExtension(FileName, '.bdsproj'); end; +function IsDproj(const FileName: string): Boolean; +begin + Result := FileMatchesExtension(FileName, '.dproj'); +end; + +function IsBdsprojOrDproj(const FileName: string): Boolean; +begin + Result := IsBdsproj(FileName) or IsDproj(FileName); +end; + function IsPackage(const FileName: string): Boolean; begin Result := FileMatchesExtensions(FileName, ['.dpk', '.dpkw', '.bpk']); |