[Fatal Error] Analyser.dpr(13): File not found: 'Label3d.dcu'请知道这个东西哪儿有的朋友说声? 或者提供个地址,搞不懂这个是什么
解决方案 »
- 关于Hook Api的问题
- 帮忙搞软件测试. (高分回收BUG, 建议, BUG分析)
- 各位高手有解决内存泻漏的方法和工具吗!
- 控件NMHTTP的用法
- 关于Midas中多线程序客户端从远程数据模块获取数据的问题?
- 一个男人的眼泪........ 撒分咯
- 如何改变DBGrid网格颜色,用到什么事件??那一种方法是最快的??急!!
- Delphi,如何用XMLDocument解析XML,得到节点信息。
- 重贴:(版主别骂我, 我已经找过了, 但是没找着答案,另外下面的那个打不开又删不掉)怎样用{$define}定义一个几个单元都能用{$ifdef}来使用
- 有谁懂压缩的原理啊,给我讲讲,知道zip 的 和 rar最好
- 如何将byte转换成string型
- 大家好!过程中的参数前加上var字样是什么意思啊?
unit Label3D;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, ExtCtrls, Buttons;
type
TTextStyle = ( tsNone, tsRaised, tsLowered );
TLabel3D = class(TLabel)
private
FTextStyle: TTextStyle;
FBevel: Integer;
procedure DrawLabel3D(var TextRect: TRect; SpecialFlags: Word);
protected
procedure Paint; override;
procedure SetTextStyle( Value : TTextStyle );
procedure SetBevel( Value: Integer);
public
constructor Create(AOwner: TComponent); override;
published
{ Style of the 3-D label }
property TextStyle: TTextStyle read FTextStyle write SetTextStyle
default tsRaised;
property Bevel: Integer read FBevel write SetBevel default 1;
end;
procedure Register;
implementation
{ TLabel3D }
{ Override the constructor to initialize variables }
constructor TLabel3D.Create(AOwner: TComponent);
begin
{ Inherit original constructor }
inherited Create(AOwner);
{ Add new initializations }
FTextStyle := tsRaised;
FBevel := 1;
end;
{ Set the 3-D style of the label }
procedure TLabel3D.SetTextStyle( Value : TTextStyle );
begin
if Value <> FTextStyle then
begin
FTextStyle := Value;
Invalidate;
end;
end;
procedure TLabel3D.SetBevel( Value : Integer);
begin
if(Value<>FBevel) and (Value>0) then
begin
FBevel := Value;
Invalidate;
end;
end;
{ Draw the text and the 3-D bevel }
procedure TLabel3D.DrawLabel3D( var TextRect : TRect; SpecialFlags : Word );
var
Text : array[ 0..255 ] of Char;
WorkRect : TRect;
TopColor : TColor;
BottomColor : TColor;
tmpCount : Integer;
begin
{ Copy the text to a buffer }
GetTextBuf(Text, SizeOf(Text));
{ Process special characters }
if (SpecialFlags and DT_CALCRECT <> 0) and
((Text[0] = #0) or ShowAccelChar and
(Text[0] = '&') and
(Text[1] = #0)) then
StrCopy(Text, ' ');
if not ShowAccelChar then
SpecialFlags := SpecialFlags or DT_NOPREFIX;
{ Set the font }
Canvas.Font := Font;
{ Set highlight and shadow colors }
TopColor := clBtnHighlight;
BottomColor := clBtnShadow;
{ If the text style is lowered then reverse the highlight and shadow colors }
if FTextStyle = tsLowered then
begin
TopColor := clBtnShadow;
BottomColor := clBtnHighlight;
end;
{ If the text style is lowered or raised then draw it with its bevel }
if FTextStyle in [ tsLowered, tsRaised ] then
begin
OffsetRect( TextRect, FBevel, FBevel);
{if (FBevel=1) or (FTextStyle=tsLowered) then}
begin
Canvas.Font.Color := BottomColor;
for tmpCount:=1 to FBevel do
begin
WorkRect := TextRect;
OffsetRect( WorkRect, tmpCount, tmpCount );
DrawText(Canvas.Handle, Text, StrLen(Text), WorkRect, SpecialFlags);
end;
end;
{if (FBevel=1) or (FTextStyle=tsRaised) then}
begin
Canvas.Font.Color := TopColor;
for tmpCount:=-1 downto -FBevel do
begin
WorkRect := TextRect;
OffsetRect( WorkRect, tmpCount, tmpCount);
DrawText(Canvas.Handle, Text, StrLen(Text), WorkRect, SpecialFlags);
end;
end;
end;
{ Set the actual font color }
Canvas.Font.Color := Font.Color;
{ If it is disabled then set the font color to gray }
if not Enabled then
Canvas.Font.Color := clGrayText;
{ Draw the text }
DrawText(Canvas.Handle, Text, StrLen(Text), TextRect, SpecialFlags);
end;
{ Paint 3-D Label }
procedure TLabel3D.Paint;
const
Alignments: array[TAlignment] of Word = (DT_LEFT, DT_RIGHT, DT_CENTER);
var
Rect: TRect;
begin
with Canvas do
begin
{ If transparent property is off then draw background }
if not Transparent then
begin
{ Set brush color and style then paint the background }
Brush.Color := Self.Color;
Brush.Style := bsSolid;
FillRect(ClientRect);
end;
{ Set the brush style and text rectangle coordinates then paint the text }
Brush.Style := bsClear;
Rect := ClientRect;
DrawLabel3D(Rect, (DT_EXPANDTABS or DT_WORDBREAK ) or
Alignments[Alignment]);
end;
end;
{ ----------------------------------------------------------------------------}
{ Register the components }
procedure Register;
begin
RegisterComponents('Standard', [TLabel3D]);
end;
end.
请问一下,你给的代码我是创建个工程来使用吗?