1
0
mirror of synced 2024-11-15 00:43:50 +00:00

Draw the active project Bold

This commit is contained in:
Mark van Renswoude 2011-01-14 09:58:03 +00:00
parent 6588aedb53
commit 9ac9fc34c6
6 changed files with 21 additions and 6 deletions

Binary file not shown.

View File

@ -29,12 +29,14 @@ uses
type type
TBaseSwStyleVisitor = class(TInterfacedPersistent, IBaseSwVisitor) TBaseSwStyleVisitor = class(TInterfacedPersistent, IBaseSwVisitor)
private private
FBold: Boolean;
FColor: TColor; FColor: TColor;
FImageIndex: Integer; FImageIndex: Integer;
FOverlayIndex: Integer; FOverlayIndex: Integer;
protected protected
procedure VisitItem(const AItem: TBaseSwItem); virtual; procedure VisitItem(const AItem: TBaseSwItem); virtual;
public public
property Bold: Boolean read FBold write FBold;
property Color: TColor read FColor write FColor; property Color: TColor read FColor write FColor;
property ImageIndex: Integer read FImageIndex write FImageIndex; property ImageIndex: Integer read FImageIndex write FImageIndex;
property OverlayIndex: Integer read FOverlayIndex write FOverlayIndex; property OverlayIndex: Integer read FOverlayIndex write FOverlayIndex;
@ -146,6 +148,7 @@ const
{ TBaseSwStyleVisitor } { TBaseSwStyleVisitor }
procedure TBaseSwStyleVisitor.VisitItem(const AItem: TBaseSwItem); procedure TBaseSwStyleVisitor.VisitItem(const AItem: TBaseSwItem);
begin begin
Bold := False;
Color := clDefault; Color := clDefault;
ImageIndex := -1; ImageIndex := -1;
OverlayIndex := -1; OverlayIndex := -1;
@ -631,6 +634,11 @@ begin
end; end;
Canvas.FillRect(Rect); Canvas.FillRect(Rect);
if FStyleVisitor.Bold then
Canvas.Font.Style := [fsBold]
else
Canvas.Font.Style := [];
textRect := Rect; textRect := Rect;
InflateRect(textRect, -2, -2); InflateRect(textRect, -2, -2);

View File

@ -98,9 +98,9 @@ begin
for projectIndex := Pred(moduleServices.MainProjectGroup.ProjectCount) downto 0 do for projectIndex := Pred(moduleServices.MainProjectGroup.ProjectCount) downto 0 do
begin begin
project := moduleServices.MainProjectGroup.Projects[projectIndex]; project := moduleServices.MainProjectGroup.Projects[projectIndex];
projectItem := TProjSwProject.Create(project); projectItem := TProjSwProject.Create(project, project = activeProject);
if project = activeProject then if projectItem.IsActive then
activeItem := projectItem; activeItem := projectItem;
projectList.Add(projectItem); projectList.Add(projectItem);

View File

@ -1,6 +1,6 @@
inherited frmProjSwDialog: TfrmProjSwDialog inherited frmProjSwDialog: TfrmProjSwDialog
Caption = 'ProjectSwitcher' Caption = 'ProjectSwitcher'
ExplicitHeight = 425 ExplicitHeight = 427
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
inherited pnlMain: TPanel inherited pnlMain: TPanel
@ -21,7 +21,7 @@ inherited frmProjSwDialog: TfrmProjSwDialog
end end
inherited ilsTypes: TImageList inherited ilsTypes: TImageList
Bitmap = { Bitmap = {
494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 494C010101000400080010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000001000000001002000000000000010 0000000000003600000028000000400000001000000001002000000000000010
000000000000000000000000000000000000000000000000000000000000A5A5 000000000000000000000000000000000000000000000000000000000000A5A5
A500636363006363630063636300636363006363630063636300A5A5A5000000 A500636363006363630063636300636363006363630063636300A5A5A5000000

View File

@ -57,6 +57,9 @@ uses
procedure TProjSwStyleVisitor.VisitItem(const AItem: TBaseSwItem); procedure TProjSwStyleVisitor.VisitItem(const AItem: TBaseSwItem);
begin begin
ImageIndex := 0; ImageIndex := 0;
if AItem is TProjSwProject then
Bold := TProjSwProject(AItem).IsActive;
end; end;

View File

@ -10,14 +10,17 @@ uses
type type
TProjSwProject = class(TBaseSwItem) TProjSwProject = class(TBaseSwItem)
private private
FIsActive: Boolean;
FProject: IOTAProject; FProject: IOTAProject;
FName: String; FName: String;
protected protected
function GetName: String; override; function GetName: String; override;
public public
constructor Create(AProject: IOTAProject); constructor Create(AProject: IOTAProject; AIsActive: Boolean);
procedure Activate(const AClearSelection: Boolean); procedure Activate(const AClearSelection: Boolean);
property IsActive: Boolean read FIsActive;
end; end;
@ -27,12 +30,13 @@ uses
{ TProjSwProject } { TProjSwProject }
constructor TProjSwProject.Create(AProject: IOTAProject); constructor TProjSwProject.Create(AProject: IOTAProject; AIsActive: Boolean);
begin begin
inherited Create; inherited Create;
FProject := AProject; FProject := AProject;
FName := ExtractFileName(FProject.ProjectOptions.TargetName); FName := ExtractFileName(FProject.ProjectOptions.TargetName);
FIsActive := AIsActive;
end; end;