diff --git a/Lib/D6/UnitSwitcherD6.bpl b/Lib/D6/UnitSwitcherD6.bpl new file mode 100644 index 0000000..2114e0b Binary files /dev/null and b/Lib/D6/UnitSwitcherD6.bpl differ diff --git a/Lib/D6/placeholder.txt b/Lib/D6/placeholder.txt new file mode 100644 index 0000000..e69de29 diff --git a/Source/UnSwClient.pas b/Source/UnSwClient.pas index 429e4ca..8183e26 100644 --- a/Source/UnSwClient.pas +++ b/Source/UnSwClient.pas @@ -30,7 +30,7 @@ type FViewFormAction: TContainedAction; protected function ActiveFileName(): String; - {$IFDEF DELPHI7} + {$IFDEF DELPHI7ORLOWER} function ActiveGroup(): IOTAProjectGroup; {$ENDIF} function ActiveProject(): IOTAProject; @@ -58,7 +58,7 @@ begin Assert(Supports(BorlandIDEServices, IOTAModuleServices), 'BorlandIDEServices does not support the ' + 'IOTAModuleServices interface.'); - {$IFDEF DELPHI7} + {$IFDEF DELPHI7ORLOWER} Assert(Supports(BorlandIDEServices, IOTAActionServices), 'BorlandIDEServices does not support the ' + 'IOTAActionServices interface.'); @@ -116,7 +116,7 @@ begin end; end; -{$IFDEF DELPHI7} +{$IFDEF DELPHI7ORLOWER} function TUnitSwitcherHook.ActiveGroup(): IOTAProjectGroup; var module: IOTAModule; @@ -136,7 +136,7 @@ end; {$ENDIF} function TUnitSwitcherHook.ActiveProject(): IOTAProject; -{$IFDEF DELPHI7} +{$IFDEF DELPHI7ORLOWER} var projectGroup: IOTAProjectGroup; module: IOTAModule; @@ -145,7 +145,7 @@ var {$ENDIF} begin - {$IFDEF DELPHI7} + {$IFDEF DELPHI7ORLOWER} Result := nil; projectGroup := ActiveGroup(); if not Assigned(projectGroup) then diff --git a/Source/UnSwDefines.inc b/Source/UnSwDefines.inc index acc8ef2..d8c850c 100644 --- a/Source/UnSwDefines.inc +++ b/Source/UnSwDefines.inc @@ -1,7 +1,16 @@ -// Lowest supprted version is Delphi 7. It lacks some OTA functionality +// Lowest supprted version is Delphi 6. It lacks some OTA functionality // in comparison to Delphi 2006. Note that UnitSwitcher has not been tested // on any other Delphi version! +{$UNDEF DELPHI6} {$UNDEF DELPHI7} +{$UNDEF DELPHI7ORLOWER} + +{$IFDEF VER140} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7ORLOWER} +{$ENDIF} + {$IFDEF VER150} {$DEFINE DELPHI7} + {$DEFINE DELPHI7ORLOWER} {$ENDIF} diff --git a/Source/UnSwObjects.pas b/Source/UnSwObjects.pas index f88d48e..a552104 100644 --- a/Source/UnSwObjects.pas +++ b/Source/UnSwObjects.pas @@ -145,7 +145,7 @@ type implementation uses - {$IFDEF DELPHI7} + {$IFDEF DELPHI7ORLOWER} ActnList, {$ENDIF} SysUtils; @@ -271,7 +271,7 @@ begin end; procedure TUnSwProjectUnit.Activate(const ASource: Boolean); -{$IFDEF DELPHI7} +{$IFDEF DELPHI7ORLOWER} var actionIndex: Integer; ntaServices: INTAServices; @@ -279,7 +279,7 @@ var {$ENDIF} begin - {$IFDEF DELPHI7} + {$IFDEF DELPHI7ORLOWER} // Bit of a hack, but opening the file itself will result in Delphi 7 // reloading the project... ntaServices := (BorlandIDEServices as INTAServices);