tvplanit: More consistent use of TBorderStyle in NavBar.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4996 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-18 19:40:39 +00:00
parent 066ed681f4
commit 79a381a046
2 changed files with 12 additions and 8 deletions

View File

@ -8,6 +8,7 @@
<MainUnit Value="0"/> <MainUnit Value="0"/>
<Title Value="project1"/> <Title Value="project1"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/> <Icon Value="0"/>
</General> </General>
<VersionInfo> <VersionInfo>

View File

@ -188,7 +188,7 @@ type
FBackgroundColor: TColor; FBackgroundColor: TColor;
FBackgroundImage: TBitmap; FBackgroundImage: TBitmap;
FBackgroundMethod: TVpBackgroundMethod; FBackgroundMethod: TVpBackgroundMethod;
FBorderStyle: TBorderStyle; // FBorderStyle: TBorderStyle;
FButtonHeight: Integer; FButtonHeight: Integer;
FContainers: TVpContainerList; FContainers: TVpContainerList;
FDrawingStyle: TVpFolderDrawingStyle; FDrawingStyle: TVpFolderDrawingStyle;
@ -250,7 +250,7 @@ type
procedure SetBackgroundImage(Value: TBitmap); procedure SetBackgroundImage(Value: TBitmap);
procedure SetBackgroundMethod(Value: TVpBackgroundMethod); procedure SetBackgroundMethod(Value: TVpBackgroundMethod);
procedure SetDrawingStyle(Value: TVpFolderDrawingStyle); procedure SetDrawingStyle(Value: TVpFolderDrawingStyle);
procedure SetBorderStyle(const Value: TBorderStyle); // procedure SetBorderStyle(const Value: TBorderStyle);
procedure SetButtonHeight(Value: Integer); procedure SetButtonHeight(Value: Integer);
procedure SetImages(Value: TImageList); procedure SetImages(Value: TImageList);
procedure SetItemFont(Value: TFont); procedure SetItemFont(Value: TFont);
@ -324,7 +324,6 @@ type
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor; property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor;
property BackgroundImage: TBitmap read FBackgroundImage write SetBackgroundImage; property BackgroundImage: TBitmap read FBackgroundImage write SetBackgroundImage;
property BackgroundMethod: TVpBackgroundMethod read FBackgroundMethod write SetBackgroundMethod; property BackgroundMethod: TVpBackgroundMethod read FBackgroundMethod write SetBackgroundMethod;
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle;
property ButtonHeight: Integer read FButtonHeight write SetButtonHeight; property ButtonHeight: Integer read FButtonHeight write SetButtonHeight;
property DrawingStyle: TVpFolderDrawingStyle read FDrawingStyle write SetDrawingStyle; property DrawingStyle: TVpFolderDrawingStyle read FDrawingStyle write SetDrawingStyle;
property FolderCollection: TVpCollection read FFolders write FFolders; property FolderCollection: TVpCollection read FFolders write FFolders;
@ -392,7 +391,7 @@ type
property BackgroundColor; property BackgroundColor;
property BackgroundImage; property BackgroundImage;
property BackgroundMethod; property BackgroundMethod;
property BorderStyle; property BorderStyle default bsNone;
property ButtonHeight; property ButtonHeight;
property DrawingStyle; property DrawingStyle;
property FolderCollection; property FolderCollection;
@ -969,6 +968,7 @@ constructor TVpCustomNavBar.Create(AOwner: TComponent);
HSnd: THandle; } HSnd: THandle; }
begin begin
inherited Create(AOwner); inherited Create(AOwner);
BorderStyle := bsNone;
FContainers := TVpContainerList.Create(Self); FContainers := TVpContainerList.Create(Self);
@ -1047,7 +1047,7 @@ begin
FBackgroundColor := clInactiveCaption; FBackgroundColor := clInactiveCaption;
FBackgroundImage := TBitmap.Create; FBackgroundImage := TBitmap.Create;
FBackgroundMethod := bmNormal; FBackgroundMethod := bmNormal;
FBorderStyle := bsSingle; // FBorderStyle := bsSingle;
FButtonHeight := 20; FButtonHeight := 20;
FActiveFolder := -1; FActiveFolder := -1;
FActiveItem := -1; FActiveItem := -1;
@ -1149,8 +1149,8 @@ procedure TVpCustomNavBar.CreateParams(var Params: TCreateParams);
begin begin
inherited CreateParams(Params); inherited CreateParams(Params);
with Params do with Params do
Style := LongInt(Style) or BorderStyles[FBorderStyle]; Style := LongInt(Style) or BorderStyles[BorderStyle];
if NewStyleControls {and Ctl3D }and (FBorderStyle = bsSingle) then begin if NewStyleControls {and Ctl3D }and (BorderStyle = bsSingle) then begin
Params.Style := Params.Style and not WS_BORDER; Params.Style := Params.Style and not WS_BORDER;
Params.ExStyle := Params.ExStyle or WS_EX_CLIENTEDGE; Params.ExStyle := Params.ExStyle or WS_EX_CLIENTEDGE;
end; end;
@ -1168,8 +1168,10 @@ end;
procedure TVpCustomNavBar.Loaded; procedure TVpCustomNavBar.Loaded;
begin begin
inherited Loaded; inherited Loaded;
{
if DrawingStyle = dsEtchedButton then if DrawingStyle = dsEtchedButton then
BorderStyle := bsNone; BorderStyle := bsNone;
}
if FolderCollection.Count > 0 then if FolderCollection.Count > 0 then
FActiveFolder := 0 FActiveFolder := 0
else else
@ -2772,7 +2774,7 @@ begin
end; end;
end; end;
{=====} {=====}
(*
procedure TVpCustomNavBar.SetBorderStyle(const Value: TBorderStyle); procedure TVpCustomNavBar.SetBorderStyle(const Value: TBorderStyle);
begin begin
if Value <> FBorderStyle then begin if Value <> FBorderStyle then begin
@ -2781,6 +2783,7 @@ begin
end; end;
end; end;
{=====} {=====}
*)
procedure TVpCustomNavBar.SetButtonHeight(Value: Integer); procedure TVpCustomNavBar.SetButtonHeight(Value: Integer);
begin begin