2010-02-16 12:39:29 +00:00
|
|
|
unit ProjSwObjects;
|
|
|
|
|
|
|
|
interface
|
|
|
|
uses
|
|
|
|
ToolsAPI,
|
|
|
|
|
|
|
|
BaseSwObjects;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
TProjSwProject = class(TBaseSwItem)
|
|
|
|
private
|
2011-01-14 09:58:03 +00:00
|
|
|
FIsActive: Boolean;
|
2010-02-16 12:39:29 +00:00
|
|
|
FProject: IOTAProject;
|
|
|
|
FName: String;
|
|
|
|
protected
|
|
|
|
function GetName: String; override;
|
|
|
|
public
|
2011-01-14 09:58:03 +00:00
|
|
|
constructor Create(AProject: IOTAProject; AIsActive: Boolean);
|
2010-02-16 12:39:29 +00:00
|
|
|
|
|
|
|
procedure Activate(const AClearSelection: Boolean);
|
2011-01-14 09:58:03 +00:00
|
|
|
|
|
|
|
property IsActive: Boolean read FIsActive;
|
2010-02-16 12:39:29 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
uses
|
|
|
|
SysUtils, Dialogs;
|
|
|
|
|
|
|
|
|
|
|
|
{ TProjSwProject }
|
2011-01-14 09:58:03 +00:00
|
|
|
constructor TProjSwProject.Create(AProject: IOTAProject; AIsActive: Boolean);
|
2010-02-16 12:39:29 +00:00
|
|
|
begin
|
|
|
|
inherited Create;
|
|
|
|
|
|
|
|
FProject := AProject;
|
|
|
|
FName := ExtractFileName(FProject.ProjectOptions.TargetName);
|
2011-01-14 09:58:03 +00:00
|
|
|
FIsActive := AIsActive;
|
2010-02-16 12:39:29 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TProjSwProject.Activate(const AClearSelection: Boolean);
|
|
|
|
var
|
|
|
|
moduleServices: IOTAModuleServices;
|
|
|
|
projectGroup: IOTAProjectGroup;
|
|
|
|
|
|
|
|
begin
|
|
|
|
moduleServices := (BorlandIDEServices as IOTAModuleServices);
|
|
|
|
projectGroup := moduleServices.MainProjectGroup;
|
|
|
|
|
|
|
|
if Assigned(projectGroup) then
|
|
|
|
projectGroup.ActiveProject := FProject;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TProjSwProject.GetName: String;
|
|
|
|
begin
|
|
|
|
Result := FName;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|