You've already forked lazarus-ccr
ExCtrls/TButtonEx: Fix wordwrapped custom-drawn caption not being centered.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7985 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -65,6 +65,9 @@
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
|
@ -42,6 +42,7 @@
|
||||
</Item5>
|
||||
</Files>
|
||||
<CompatibilityMode Value="True"/>
|
||||
<LazDoc Paths="fpdoc"/>
|
||||
<RequiredPkgs Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LazControls"/>
|
||||
|
@ -418,6 +418,7 @@ var
|
||||
i: integer;
|
||||
txtSize: TSize;
|
||||
txtPt: TPoint;
|
||||
ts: TTextStyle;
|
||||
begin
|
||||
if (csDestroying in ComponentState) or not HandleAllocated then
|
||||
exit;
|
||||
@ -526,7 +527,13 @@ begin
|
||||
end;
|
||||
txtPt.Y := (Height - txtSize.CY + 1) div 2;
|
||||
R := Rect(txtPt.X, txtPt.Y, txtPt.X + txtSize.CX, txtPt.Y + txtSize.CY);
|
||||
DrawText(lCanvas.Handle, PChar(Caption), -1, R, flags);
|
||||
|
||||
ts := lCanvas.TextStyle;
|
||||
ts.Alignment := lAlignment;
|
||||
ts.Layout := tlCenter;
|
||||
ts.SingleLine := not FWordWrap;
|
||||
ts.Wordbreak := FWordWrap;
|
||||
lCanvas.TextRect(R, txtPt.X, txtPt.Y, Caption, ts);
|
||||
|
||||
// Draw focus rectangle
|
||||
if FShowFocusRect and Focused then
|
||||
|
Reference in New Issue
Block a user