jvcllaz: Add new properties ThumbBevelInner/Outer, ThumbBorderStyle, ThumbTitleBevelInner/Outer, ThumbTitleBorderStyle.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6277 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-03-25 00:04:05 +00:00
parent ac080dc35d
commit 49f7cf4793
2 changed files with 141 additions and 8 deletions

View File

@ -78,10 +78,16 @@ type
FShadowColor: TColor; FShadowColor: TColor;
FShowShadow: Boolean; FShowShadow: Boolean;
FSorted: Boolean; FSorted: Boolean;
FThumbBevelInner: TPanelBevel;
FThumbBevelOuter: TPanelBevel;
FThumbBorderStyle: TBorderStyle;
FThumbColor: TColor; FThumbColor: TColor;
FThumbGap: Byte; FThumbGap: Byte;
FThumbList: TJvThumbList; FThumbList: TJvThumbList;
FThumbSize: TPoint; FThumbSize: TPoint;
FThumbTitleBevelInner: TPanelBevel;
FThumbTitleBevelOuter: TPanelBevel;
FThumbTitleBorderStyle: TBorderStyle;
FThumbTitleColor: TColor; FThumbTitleColor: TColor;
FTitlePlacement: TTitlePos; FTitlePlacement: TTitlePos;
FWaitUntilFull: Boolean; FWaitUntilFull: Boolean;
@ -120,9 +126,15 @@ type
procedure SetPercent(P: TPercent); procedure SetPercent(P: TPercent);
procedure SetScrollMode(AMode: TScrollMode); procedure SetScrollMode(AMode: TScrollMode);
procedure SetSorted(const Value: Boolean); procedure SetSorted(const Value: Boolean);
procedure SetThumbBevelInner(const AValue: TPanelBevel);
procedure SetThumbBevelOuter(const AValue: TPanelBevel);
procedure SetThumbBorderStyle(const AValue: TBorderStyle);
procedure SetThumbColor(const AValue: TColor); procedure SetThumbColor(const AValue: TColor);
procedure SetThumbGap(Sp: Byte); procedure SetThumbGap(Sp: Byte);
procedure SetThumbTitleColor(const AValue: TColor); procedure SetThumbTitleColor(const AValue: TColor);
procedure SetThumbTitleBevelInner(const AValue: TPanelBevel);
procedure SetThumbTitleBevelOuter(const AValue: TPanelBevel);
procedure SetThumbTitleBorderStyle(const AValue: TBorderStyle);
procedure SetTitlePos(const NewVal: TTitlePos); procedure SetTitlePos(const NewVal: TTitlePos);
procedure WMPaint(var Msg: TLMPaint); message LM_PAINT; procedure WMPaint(var Msg: TLMPaint); message LM_PAINT;
//function GetBufferName(AName: string): string; //function GetBufferName(AName: string): string;
@ -180,10 +192,26 @@ type
property ShowShadow: Boolean read FShowShadow write FShowShadow; property ShowShadow: Boolean read FShowShadow write FShowShadow;
property Size: TPercent read FPercent write SetPercent; property Size: TPercent read FPercent write SetPercent;
property Sorted: Boolean read FSorted write SetSorted; property Sorted: Boolean read FSorted write SetSorted;
property ThumbColor: TColor read FThumbColor write SetThumbColor default clDefault; property ThumbBevelInner: TPanelBevel
property ThumbGap: Byte read FThumbGap write SetThumbGap; read FThumbBevelInner write SetThumbBevelInner default bvNone;
property ThumbTitleColor: TColor read FThumbTitleColor write SetThumbTitleColor default clDefault; property ThumbBevelOuter: TPanelBevel
property TitlePlacement: TTitlePos read FTitlePlacement write SetTitlePos default tpUp; read FThumbBevelOuter write SetThumbBevelOuter default bvRaised;
property ThumbBorderStyle: TBorderStyle
read FThumbBorderStyle write SetThumbBorderStyle default bsNone;
property ThumbColor: TColor
read FThumbColor write SetThumbColor default clDefault;
property ThumbGap: Byte
read FThumbGap write SetThumbGap default 4;
property ThumbTitleBevelInner: TPanelBevel
read FThumbTitleBevelInner write SetThumbTitleBevelInner default bvNone;
property ThumbTitleBevelOuter: TPanelBevel
read FThumbTitleBevelOuter write SetThumbTitleBevelOuter default bvLowered;
property ThumbTitleBorderStyle: TBorderStyle
read FThumbTitleBorderStyle write SetThumbTitleBorderStyle default bsNone;
property ThumbTitleColor: TColor
read FThumbTitleColor write SetThumbTitleColor default clDefault;
property TitlePlacement: TTitlePos
read FTitlePlacement write SetTitlePos default tpUp;
property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnChanging: TNotifyEvent read FOnChanging write FOnChanging; property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
@ -253,8 +281,14 @@ begin
FFileList.Clear; FFileList.Clear;
FFileListSorted := TStringList.Create; FFileListSorted := TStringList.Create;
FFileListSorted.Clear; FFileListSorted.Clear;
FThumbBevelInner := bvNone;
FThumbBevelOuter := bvRaised;
FThumbBorderStyle := bsNone;
FThumbColor := clDefault; FThumbColor := clDefault;
FThumbTitlecolor := clDefault; FThumbTitleColor := clDefault;
FThumbTitleBevelInner := bvNone;
FThumbTitleBevelOuter := bvLowered;
FThumbTitleBorderStyle := bsNone;
end; end;
destructor TJvThumbView.Destroy; destructor TJvThumbView.Destroy;
@ -1170,6 +1204,36 @@ begin
end; end;
end; end;
procedure TJvThumbView.SetThumbBevelInner(const AValue: TPanelBevel);
var
i: Integer;
begin
if AValue = FThumbBevelInner then exit;
FThumbBevelInner := AValue;
for i:=0 to FThumbList.Count-1 do
FThumbList.Thumbnail[i].BevelInner := FThumbBevelInner;
end;
procedure TJvThumbView.SetThumbBevelOuter(const AValue: TPanelBevel);
var
i: Integer;
begin
if AValue = FThumbBevelOuter then exit;
FThumbBevelOuter := AValue;
for i:=0 to FThumbList.Count-1 do
FThumbList.Thumbnail[i].BevelOuter := FThumbBevelOuter;
end;
procedure TJvThumbView.SetThumbBorderStyle(const AValue: TBorderStyle);
var
i: Integer;
begin
if AValue = FThumbBorderStyle then exit;
FThumbBorderStyle := AValue;
for i:=0 to FThumbList.Count-1 do
FThumbList.Thumbnail[i].BorderStyle := FThumbBorderStyle;
end;
procedure TJvThumbView.SetThumbColor(const AValue: TColor); procedure TJvThumbView.SetThumbColor(const AValue: TColor);
var var
i: Integer; i: Integer;
@ -1194,6 +1258,36 @@ begin
end; end;
end; end;
procedure TJvThumbView.SetThumbTitleBevelInner(const AValue: TPanelBevel);
var
i: Integer;
begin
if AValue = FThumbTitleBevelInner then exit;
FThumbTitleBevelInner := AValue;
for i:=0 to FThumbList.Count-1 do
FThumbList.Thumbnail[i].TitleBevelInner := FThumbTitleBevelInner;
end;
procedure TJvThumbView.SetThumbTitleBevelOuter(const AValue: TPanelBevel);
var
i: Integer;
begin
if AValue = FThumbTitleBevelOuter then exit;
FThumbTitleBevelOuter := AValue;
for i:=0 to FThumbList.Count-1 do
FThumbList.Thumbnail[i].TitleBevelOuter := FThumbTitleBevelOuter;
end;
procedure TJvThumbView.SetThumbTitleBorderStyle(const AValue: TBorderStyle);
var
i: Integer;
begin
if AValue = FThumbTitleBorderStyle then exit;
FThumbTitleBorderStyle := AValue;
for i:=0 to FThumbList.Count-1 do
FThumbList.Thumbnail[i].TitleBorderStyle := FThumbTitleBorderStyle;
end;
procedure TJvThumbView.SetThumbTitleColor(const AValue: TColor); procedure TJvThumbView.SetThumbTitleColor(const AValue: TColor);
var var
i: Integer; i: Integer;

View File

@ -98,12 +98,14 @@ type
FHShadowOffset: Word; FHShadowOffset: Word;
FVShadowOffset: Word; FVShadowOffset: Word;
FMargin: Integer; FMargin: Integer;
procedure WMPaint(var Msg: TLMPaint); message LM_PAINT;
(************** NOT CONVERTED *** (************** NOT CONVERTED ***
procedure PhotoOnProgress(Sender: TObject; Stage: TProgressStage; procedure PhotoOnProgress(Sender: TObject; Stage: TProgressStage;
PercentDone: Byte; RedrawNow: Boolean; PercentDone: Byte; RedrawNow: Boolean;
const R: TRect; const Msg: string); const R: TRect; const Msg: string);
*******************************) *******************************)
function GetTitleBevelInner: TPanelBevel;
function GetTitleBevelOuter: TPanelBevel;
function GetTitleBorderStyle: TBorderStyle;
procedure RefreshFont(Sender: TObject); procedure RefreshFont(Sender: TObject);
procedure SetFileName(const AFile: string); procedure SetFileName(const AFile: string);
function LoadFile(AFile: string): string; function LoadFile(AFile: string): string;
@ -115,6 +117,9 @@ type
procedure SetShowTitle(const AState: Boolean); procedure SetShowTitle(const AState: Boolean);
procedure SetTitlePlacement(const AState: TTitlePos); procedure SetTitlePlacement(const AState: TTitlePos);
procedure SetTitle(const Value: string); procedure SetTitle(const Value: string);
procedure SetTitleBevelInner(const Value: TPanelBevel);
procedure SetTitleBevelOuter(const Value: TPanelBevel);
procedure SetTitleBorderStyle(const Value: TBorderStyle);
procedure SetTitleColor(const Value: TColor); procedure SetTitleColor(const Value: TColor);
procedure SetStream(const AStream: TStream); procedure SetStream(const AStream: TStream);
procedure SetTitleFont(const Value: TFont); procedure SetTitleFont(const Value: TFont);
@ -127,6 +132,8 @@ type
procedure UpdateThumbWidth; procedure UpdateThumbWidth;
procedure UpdateTitlePanelHeight; procedure UpdateTitlePanelHeight;
function IsTitleFontStored: Boolean; function IsTitleFontStored: Boolean;
procedure WMPaint(var Msg: TLMPaint); message LM_PAINT;
protected protected
procedure CreateHandle; override; procedure CreateHandle; override;
procedure THSizeChanged(var Msg: TLMessage); message TH_IMAGESIZECHANGED; procedure THSizeChanged(var Msg: TLMessage); message TH_IMAGESIZECHANGED;
@ -146,6 +153,9 @@ type
published published
property FileName: string read GetFileName write SetFileName; property FileName: string read GetFileName write SetFileName;
property Title: string read FTitle write SetTitle; property Title: string read FTitle write SetTitle;
property TitleBevelInner: TPanelBevel read GetTitleBevelInner write SetTitleBevelInner default bvNone;
property TitleBevelOuter: TPanelBevel read GetTitleBevelOuter write SetTitleBevelOuter default bvLowered;
property TitleBorderStyle: TBorderStyle read GetTitleBorderStyle write SetTitleBorderStyle default bsNone;
property TitleColor: TColor read FTitleColor write SetTitleColor default clDefault; property TitleColor: TColor read FTitleColor write SetTitleColor default clDefault;
property TitleFont: TFont read FTitleFont write SetTitleFont stored IsTitleFontStored; property TitleFont: TFont read FTitleFont write SetTitleFont stored IsTitleFontStored;
property ImageReady: Boolean read FImageReady; property ImageReady: Boolean read FImageReady;
@ -231,8 +241,7 @@ begin
begin begin
Width := TJvThumbView(Owner).MaxWidth; Width := TJvThumbView(Owner).MaxWidth;
Height := TJvThumbView(Owner).MaxHeight; Height := TJvThumbView(Owner).MaxHeight;
end end else
else
begin begin
Width := 120; Width := 120;
Height := 120; Height := 120;
@ -259,6 +268,21 @@ begin
inherited Destroy; inherited Destroy;
end; end;
function TJvThumbnail.GetTitleBevelInner: TPanelBevel;
begin
Result := FTitlePanel.BevelInner;
end;
function TJvThumbnail.GetTitleBevelOuter: TPanelBevel;
begin
Result := FTitlePanel.BevelOuter;
end;
function TJvThumbnail.GetTitleBorderStyle: TBorderStyle;
begin
Result := FTitlePanel.BorderStyle;
end;
procedure TJvThumbnail.SetShowTitle(const AState: Boolean); procedure TJvThumbnail.SetShowTitle(const AState: Boolean);
begin begin
if AState <> FShowTitle then if AState <> FShowTitle then
@ -268,6 +292,21 @@ begin
end end
end; end;
procedure TJvThumbnail.SetTitleBevelInner(const Value: TPanelBevel);
begin
FTitlePanel.BevelInner := Value;
end;
procedure TJvThumbnail.SetTitleBevelOuter(const Value: TPanelBevel);
begin
FTitlePanel.BevelOuter := Value;
end;
procedure TJvThumbnail.SetTitleBorderStyle(const Value: TBorderStyle);
begin
FTitlePanel.BorderStyle := Value;
end;
procedure TJvThumbnail.BoundsChanged; procedure TJvThumbnail.BoundsChanged;
begin begin
CalculateImageSize; CalculateImageSize;