mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 08:20:25 +02:00
MG: image support, TScrollBox, and many other things from Andrew
git-svn-id: trunk@2676 -
This commit is contained in:
parent
7c8126d01e
commit
0bbff5ef59
@ -33,7 +33,20 @@ end;
|
|||||||
{-----------------------------------------------}
|
{-----------------------------------------------}
|
||||||
Procedure TCanvas.Draw(X,Y : Integer; Graphic : TGraphic);
|
Procedure TCanvas.Draw(X,Y : Integer; Graphic : TGraphic);
|
||||||
begin
|
begin
|
||||||
|
If Assigned(Graphic) then
|
||||||
|
StretchDraw(Rect(X, Y, Graphic.Width + X,Graphic.Height + Y), Graphic);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-----------------------------------------------}
|
||||||
|
{-- TCanvas.StretchDraw --}
|
||||||
|
{-----------------------------------------------}
|
||||||
|
procedure TCanvas.StretchDraw(const Rect: TRect; Graphic: TGraphic);
|
||||||
|
begin
|
||||||
|
if Assigned(Graphic) then
|
||||||
|
begin
|
||||||
|
RequiredState([csHandleValid, csPenValid]);
|
||||||
|
Graphic.Draw(Self, Rect);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{-----------------------------------------------}
|
{-----------------------------------------------}
|
||||||
@ -586,8 +599,15 @@ begin
|
|||||||
If not Style.ShowPrefix then
|
If not Style.ShowPrefix then
|
||||||
Options := Options or DT_NOPREFIX;
|
Options := Options or DT_NOPREFIX;
|
||||||
|
|
||||||
|
If Style.SystemFont then begin
|
||||||
|
Options := Options or DT_INTERNAL;
|
||||||
|
RequiredState([csHandleValid]);
|
||||||
|
SelectObject(Self.Handle, GetStockObject(SYSTEM_FONT));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
RequiredState([csHandleValid, csFontValid]);
|
||||||
|
|
||||||
fRect := Rect;
|
fRect := Rect;
|
||||||
RequiredState([csHandleValid, csFontValid]);
|
|
||||||
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, DT_CALCRECT or Options);
|
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, DT_CALCRECT or Options);
|
||||||
case Style.Alignment of
|
case Style.Alignment of
|
||||||
taRightJustify : OffsetRect(fRect, Rect.Right - fRect.Right, 0);
|
taRightJustify : OffsetRect(fRect, Rect.Right - fRect.Right, 0);
|
||||||
@ -601,7 +621,12 @@ begin
|
|||||||
RequiredState([csHandleValid, csBrushValid]);
|
RequiredState([csHandleValid, csBrushValid]);
|
||||||
FillRect(fRect);
|
FillRect(fRect);
|
||||||
end;
|
end;
|
||||||
RequiredState([csHandleValid, csFontValid]);
|
If Style.SystemFont then begin
|
||||||
|
RequiredState([csHandleValid]);
|
||||||
|
SelectObject(Self.Handle, GetStockObject(SYSTEM_FONT));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
RequiredState([csHandleValid, csFontValid]);
|
||||||
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, Options)
|
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, Options)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1015,6 +1040,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.25 2002/09/03 08:07:19 lazarus
|
||||||
|
MG: image support, TScrollBox, and many other things from Andrew
|
||||||
|
|
||||||
Revision 1.24 2002/08/30 13:43:37 lazarus
|
Revision 1.24 2002/08/30 13:43:37 lazarus
|
||||||
MG: fixed drawing of non visual components in designer
|
MG: fixed drawing of non visual components in designer
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user