diff --git a/components/tvplanit/examples/navbar/project1.lpi b/components/tvplanit/examples/navbar/project1.lpi
index 348ee942b..632cd117c 100644
--- a/components/tvplanit/examples/navbar/project1.lpi
+++ b/components/tvplanit/examples/navbar/project1.lpi
@@ -8,7 +8,6 @@
-
diff --git a/components/tvplanit/examples/navbar/unit1.lfm b/components/tvplanit/examples/navbar/unit1.lfm
index f79de7218..c857e0a55 100644
--- a/components/tvplanit/examples/navbar/unit1.lfm
+++ b/components/tvplanit/examples/navbar/unit1.lfm
@@ -17,7 +17,7 @@ object Form1: TForm1
AllowRearrange = True
BackgroundColor = clInactiveCaption
BackgroundMethod = bmTile
- BorderStyle = bsNone
+ BorderStyle = bsSingle
ButtonHeight = 20
DrawingStyle = dsEtchedButton
FolderCollection = <
@@ -256,7 +256,7 @@ object Form1: TForm1
TabOrder = 6
object BkColor: TColorBox
Left = 88
- Height = 24
+ Height = 22
Top = 3
Width = 272
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbCustomColors]
@@ -348,6 +348,30 @@ object Form1: TForm1
TabOrder = 5
end
end
+ object RgBorderStyle: TRadioGroup
+ Left = 141
+ Height = 66
+ Top = 288
+ Width = 139
+ AutoFill = True
+ Caption = 'Border style'
+ ChildSizing.LeftRightSpacing = 6
+ ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+ ChildSizing.EnlargeVertical = crsHomogenousChildResize
+ ChildSizing.ShrinkHorizontal = crsScaleChilds
+ ChildSizing.ShrinkVertical = crsScaleChilds
+ ChildSizing.Layout = cclLeftToRightThenTopToBottom
+ ChildSizing.ControlsPerLine = 1
+ ClientHeight = 46
+ ClientWidth = 135
+ ItemIndex = 1
+ Items.Strings = (
+ 'bsNone'
+ 'bsSingle'
+ )
+ OnClick = RgBorderStyleClick
+ TabOrder = 7
+ end
object Images: TImageList
Height = 32
Width = 32
diff --git a/components/tvplanit/examples/navbar/unit1.pas b/components/tvplanit/examples/navbar/unit1.pas
index c33bb3e9a..26f39dc06 100644
--- a/components/tvplanit/examples/navbar/unit1.pas
+++ b/components/tvplanit/examples/navbar/unit1.pas
@@ -23,6 +23,7 @@ type
IconsLbl: TLabel;
IconsLink: TLabel;
Panel2: TPanel;
+ RgBorderStyle: TRadioGroup;
RbBkColor: TRadioButton;
RbBkImage: TRadioButton;
RbBkImageTile: TRadioButton;
@@ -42,6 +43,7 @@ type
procedure IconsLinkClick(Sender: TObject);
procedure IconsLinkMouseEnter(Sender: TObject);
procedure IconsLinkMouseLeave(Sender: TObject);
+ procedure RgBorderStyleClick(Sender: TObject);
procedure RgDrawingStyleClick(Sender: TObject);
procedure RgIconSizeClick(Sender: TObject);
procedure RbBkColorChange(Sender: TObject);
@@ -153,6 +155,7 @@ begin
RandSeed := 1;
IconsLink.Left := IconsLbl.Left + IconsLbl.Width;
RgDrawingStyle.ItemIndex := ord(VpNavBar1.DrawingStyle);
+ RgBorderStyle.ItemIndex := ord(VpNavBar1.BorderStyle);
BkColor.Selected := VpNavBar1.BackgroundColor;
case VpNavBar1.BackgroundMethod of
bmNone:
@@ -225,6 +228,11 @@ begin
VpNavBar1.Invalidate;
end;
+procedure TForm1.RgBorderStyleClick(Sender: TObject);
+begin
+ VpNavBar1.BorderStyle := TBorderStyle(RgBorderStyle.ItemIndex);
+end;
+
procedure TForm1.VpNavBar1FolderChanged(Sender: TObject; Index: Integer);
var
folder: TVpNavFolder;
diff --git a/components/tvplanit/source/vpnavbar.pas b/components/tvplanit/source/vpnavbar.pas
index da71d8362..92334e918 100644
--- a/components/tvplanit/source/vpnavbar.pas
+++ b/components/tvplanit/source/vpnavbar.pas
@@ -2805,11 +2805,12 @@ procedure TVpCustomNavBar.SetDrawingStyle(Value: TVpFolderDrawingStyle);
begin
if Value <> FDrawingStyle then begin
FDrawingStyle := Value;
+ {
if FDrawingStyle = dsEtchedButton then
BorderStyle := bsNone
else
BorderStyle := bsSingle;
-
+ }
{Minimum ButtonHeight for CoolTabs is 17}
if (FDrawingStyle = dsCoolTab) and (FButtonHeight < 17) then
FButtonHeight := 17;
diff --git a/components/tvplanit/source/vpnavbarpainter.pas b/components/tvplanit/source/vpnavbarpainter.pas
index 2d1780d77..a4c2dd779 100644
--- a/components/tvplanit/source/vpnavbarpainter.pas
+++ b/components/tvplanit/source/vpnavbarpainter.pas
@@ -143,13 +143,14 @@ begin
if folder.ItemCount = 0 then
exit;
+ // Distance of top-most icon to the last upper button
Inc(CurPos, 8);
with nabItemsRect^ do begin
Top := CurPos;
Left := 0;
Right := FNavBar.ClientWidth;
- Bottom := FNavBar.ClientHeight - (FNavBar.FolderCount - FActiveFolder - 1) * FButtonHeight + 1;
+ Bottom := FNavBar.ClientHeight - (FNavBar.FolderCount - FActiveFolder - 1) * FButtonHeight;
end;
for J := 0 to folder.ItemCount-1 do begin
@@ -213,9 +214,8 @@ var
begin
if FBackgroundImage.Empty or (FBackgroundMethod = bmNone) then
begin
- Canvas.Pen.Color := FBackgroundColor;
Canvas.Brush.Color := FBackgroundColor;
- Canvas.Rectangle(R.Left, R.Top, R.Right, R.Bottom);
+ Canvas.FillRect(R.Left, R.Top, R.Right, R.Bottom);
end else
begin
case FBackgroundMethod of
@@ -224,7 +224,7 @@ begin
if (FBackgroundImage.Width < WidthOf(R)) or (FBackgroundImage.Height < HeightOf(R))
then begin
Canvas.Brush.Color := FBackgroundColor;
- Canvas.FillRect(R.Left, R.Top, R.Right, R.Bottom);
+ Canvas.Rectangle(R.Left, R.Top, R.Right, R.Bottom);
end;
Canvas.Draw(R.Left, R.Top, FBackgroundImage);
end;
@@ -285,6 +285,7 @@ var
Points: array[1..5] of TPoint;
begin
Result := R;
+
with Canvas do begin
{Fill the tab area}
Brush.Style := bsSolid;
@@ -294,6 +295,9 @@ begin
Brush.Color := ATabColor;
FillRect(R);
+ if IsMouseOverFolder(ATabIndex) then
+ ; // do what?
+
{Draw the bottom, left line}
Pen.Color := clBlack;
MoveTo(R.Left, R.Bottom - 1);
@@ -392,6 +396,7 @@ begin
Result := R;
if ThemeServices.ThemesEnabled then begin
+ // themed button
if IsMouseOverFolder(ATabIndex) and nabMouseDown then
tb := tbPushButtonPressed
else
@@ -402,9 +407,47 @@ begin
details := ThemeServices.GetElementDetails(tb);
InflateRect(R, 1, 1);
ThemeServices.DrawElement(Canvas.Handle, details, R);
+ end else
+ begin
+ // non-themed button
+ Canvas.Brush.Color := clBtnFace;
+ Canvas.FillRect(R);
+ if nabMouseDown and IsMouseOverFolder(ATabIndex) then
+ begin
+ if R.Top = 0 then R.Top := 1;
+
+ Canvas.Pen.Color := clBtnHighlight; // bright at bottom/right
+ Canvas.MoveTo(R.Left, R.Bottom-1);
+ Canvas.LineTo(R.Right-1, R.Bottom-1);
+ Canvas.LineTo(R.Right-1, R.Top-1);
+
+ Canvas.Pen.Color := clGray; // dark at top/left
+ Canvas.MoveTo(R.Left, R.Bottom-2);
+ Canvas.LineTo(R.Left, R.Top);
+ Canvas.LineTo(R.Right-1, R.Top);
+
+ Canvas.Pen.Color := clBtnShadow; // shadow at top/left
+ Canvas.MoveTo(R.Left+1, R.Bottom-2);
+ Canvas.LineTo(R.Left+1, R.Top);
+ Canvas.LineTo(R.Right-2, R.Top);
+ end else
+ begin
+ Canvas.Pen.Color := clGray; // bottom/right
+ Canvas.MoveTo(R.Left, R.Bottom-1);
+ Canvas.LineTo(R.Right-1, R.Bottom-1);
+ Canvas.LineTo(R.Right-1, R.Top-1);
+
+ Canvas.Pen.Color := clBtnHighlight; // top/left
+ Canvas.MoveTo(R.Left, R.Bottom-2);
+ Canvas.LineTo(R.Left, R.Top);
+ Canvas.LineTo(R.Right-1, R.Top);
+
+ Canvas.Pen.Color := clBtnShadow; // bottom/right shadow
+ Canvas.MoveTo(R.Left+1, R.Bottom-2);
+ Canvas.LineTo(R.Right-2, R.Bottom-2);
+ Canvas.LineTo(R.Right-2, R.Top);
+ end;
end;
-//TODO: TR := DrawButtonFace(DrawBmp.Canvas, MyRect, 1, bsNew, False,
-// (I = FHotFolder) and nabMouseDown, False);
end;
{ Draw regular etched (Win98 style) buttons
@@ -415,10 +458,16 @@ begin
with Canvas do begin
Brush.Color := clBtnFace;
FillRect(R);
+
+ Frame3D(R, 1, bvLowered);
+ if not IsMouseOverFolder(aTabIndex) then
+ Frame3D(R, 1, bvRaised);
+ {
// InflateRect(R, -1, -1);
if IsMouseOverFolder(ATabIndex) then
Frame3D(R, 1, bvLowered) else
Frame3D(r, 1, bvRaised);
+ }
end;
Result := R;
end;
@@ -842,11 +891,11 @@ begin
{ Draw the folder buttons at the bottom }
DrawBottomFolderButtons(DrawBmp.Canvas, MyRect, CurPos);
+ finally
{ Copy the buffer bitmap to the control }
FNavBar.Canvas.CopyMode := cmSrcCopy;
- FNavBar.Canvas.CopyRect(MyRect, DrawBmp.Canvas, MyRect);
+ FNavBar.Canvas.CopyRect(MyRect, DrawBmp.Canvas, Rect(0, 0, DrawBmp.Width,DrawBmp.Height));
- finally
DrawBmp.Free;
end;
end;