painting toolbuttons left/right aligned from Martin Smat

git-svn-id: trunk@8208 -
This commit is contained in:
mattias 2005-11-22 10:24:01 +00:00
parent 4b0db5cd88
commit 62b04cf2b6

View File

@ -140,7 +140,7 @@ procedure TToolButton.Paint;
begin
ArrowRect:=DropDownButtonRect;
ArrowRect.Left:=DropDownButtonRect.Left+2;
ArrowRect.Right:=Max(DropDownButtonRect.Right-2,ArrowRect.Left);
ArrowRect.Right:=Max(DropDownButtonRect.Right-3,ArrowRect.Left);
ArrowRect.Top:=(DropDownButtonRect.Top+DropDownButtonRect.Bottom
+ArrowRect.Left-ArrowRect.Right) div 2;
ArrowRect.Bottom:=ArrowRect.Top-ArrowRect.Left+ArrowRect.Right;
@ -171,6 +171,9 @@ begin
// calculate button area(s)
ButtonRect:=PaintRect;
FLastButtonDrawFlags:=GetButtonDrawFlags;
if (FLastButtonDrawFlags and DFCS_PUSHED) <> 0 then
OffsetRect(ButtonRect, 1, 1);
if Style=tbsDropDown then begin
DropDownButtonRect:=ButtonRect;
DropDownButtonRect.Left:=
@ -226,7 +229,6 @@ begin
end;
// draw button
FLastButtonDrawFlags:=GetButtonDrawFlags;
if Style in [tbsButton,tbsDropDown,tbsCheck] then begin
DrawFrameControl(Canvas.GetUpdatedHandle([csBrushValid,csPenValid]),
PaintRect{ButtonRect}, DFC_BUTTON, FLastButtonDrawFlags);
@ -247,8 +249,8 @@ begin
// draw text
if (TextSize.cx>0) then begin
TS := Canvas.TextStyle;
TS.Alignment:= taCenter;
TS.Layout:= tlCenter;
TS.Alignment:= taLeftJustify;
TS.Layout:= tlTop;
TS.Opaque:= false;
TS.Clipping:= false;
TS.SystemFont:=Canvas.Font.IsDefault;