mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 14:29:14 +02:00
* small changes for tbutton.draw
This commit is contained in:
parent
5bf4a7f9fc
commit
d5197088df
@ -1286,7 +1286,7 @@ END;
|
|||||||
{ DrawFocus -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 30Apr98 LdB }
|
{ DrawFocus -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 30Apr98 LdB }
|
||||||
{---------------------------------------------------------------------------}
|
{---------------------------------------------------------------------------}
|
||||||
PROCEDURE TButton.DrawFocus;
|
PROCEDURE TButton.DrawFocus;
|
||||||
VAR B: Byte; I: Integer;
|
VAR B: Byte; I, Pos: Integer;
|
||||||
Bc: Word; Db: TDrawBuffer;
|
Bc: Word; Db: TDrawBuffer;
|
||||||
C : char;
|
C : char;
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -1318,10 +1318,14 @@ BEGIN
|
|||||||
I := TextWidth(Title^); { Fetch title width }
|
I := TextWidth(Title^); { Fetch title width }
|
||||||
I := (RawSize.X - I) DIV 2; { Centre in button }
|
I := (RawSize.X - I) DIV 2; { Centre in button }
|
||||||
End Else I := FontWidth; { Left edge of button }
|
End Else I := FontWidth; { Left edge of button }
|
||||||
MoveCStr(Db, Title^, Bc); { Move title to buffer }
|
If TextModeGFV and DownFlag then Begin
|
||||||
|
MoveChar(Db,' ',Bc,1);
|
||||||
|
Pos:=1;
|
||||||
|
end else Pos:=0;
|
||||||
|
MoveCStr(Db[Pos], Title^, Bc); { Move title to buffer }
|
||||||
If not TextModeGFV then Begin
|
If not TextModeGFV then Begin
|
||||||
GOptions := GOptions OR goGraphView; { Graphics co-ords mode }
|
GOptions := GOptions OR goGraphView; { Graphics co-ords mode }
|
||||||
WriteLine(I, FontHeight DIV 2, CStrLen(Title^),
|
WriteLine(I, FontHeight DIV 2, CStrLen(Title^)+Pos,
|
||||||
1, Db); { Write the title }
|
1, Db); { Write the title }
|
||||||
GOptions := GOptions AND NOT goGraphView; { Return to normal mode }
|
GOptions := GOptions AND NOT goGraphView; { Return to normal mode }
|
||||||
End Else Begin
|
End Else Begin
|
||||||
@ -2726,7 +2730,10 @@ END;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 2001-05-31 12:14:50 pierre
|
Revision 1.10 2001-06-01 16:00:00 pierre
|
||||||
|
* small changes for tbutton.draw
|
||||||
|
|
||||||
|
Revision 1.9 2001/05/31 12:14:50 pierre
|
||||||
Better button draw
|
Better button draw
|
||||||
|
|
||||||
Revision 1.8 2001/05/10 16:46:27 pierre
|
Revision 1.8 2001/05/10 16:46:27 pierre
|
||||||
|
@ -1286,7 +1286,7 @@ END;
|
|||||||
{ DrawFocus -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 30Apr98 LdB }
|
{ DrawFocus -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 30Apr98 LdB }
|
||||||
{---------------------------------------------------------------------------}
|
{---------------------------------------------------------------------------}
|
||||||
PROCEDURE TButton.DrawFocus;
|
PROCEDURE TButton.DrawFocus;
|
||||||
VAR B: Byte; I: Integer;
|
VAR B: Byte; I, Pos: Integer;
|
||||||
Bc: Word; Db: TDrawBuffer;
|
Bc: Word; Db: TDrawBuffer;
|
||||||
C : char;
|
C : char;
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -1318,10 +1318,14 @@ BEGIN
|
|||||||
I := TextWidth(Title^); { Fetch title width }
|
I := TextWidth(Title^); { Fetch title width }
|
||||||
I := (RawSize.X - I) DIV 2; { Centre in button }
|
I := (RawSize.X - I) DIV 2; { Centre in button }
|
||||||
End Else I := FontWidth; { Left edge of button }
|
End Else I := FontWidth; { Left edge of button }
|
||||||
MoveCStr(Db, Title^, Bc); { Move title to buffer }
|
If TextModeGFV and DownFlag then Begin
|
||||||
|
MoveChar(Db,' ',Bc,1);
|
||||||
|
Pos:=1;
|
||||||
|
end else Pos:=0;
|
||||||
|
MoveCStr(Db[Pos], Title^, Bc); { Move title to buffer }
|
||||||
If not TextModeGFV then Begin
|
If not TextModeGFV then Begin
|
||||||
GOptions := GOptions OR goGraphView; { Graphics co-ords mode }
|
GOptions := GOptions OR goGraphView; { Graphics co-ords mode }
|
||||||
WriteLine(I, FontHeight DIV 2, CStrLen(Title^),
|
WriteLine(I, FontHeight DIV 2, CStrLen(Title^)+Pos,
|
||||||
1, Db); { Write the title }
|
1, Db); { Write the title }
|
||||||
GOptions := GOptions AND NOT goGraphView; { Return to normal mode }
|
GOptions := GOptions AND NOT goGraphView; { Return to normal mode }
|
||||||
End Else Begin
|
End Else Begin
|
||||||
@ -2726,7 +2730,10 @@ END;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 2001-05-31 12:14:50 pierre
|
Revision 1.10 2001-06-01 16:00:00 pierre
|
||||||
|
* small changes for tbutton.draw
|
||||||
|
|
||||||
|
Revision 1.9 2001/05/31 12:14:50 pierre
|
||||||
Better button draw
|
Better button draw
|
||||||
|
|
||||||
Revision 1.8 2001/05/10 16:46:27 pierre
|
Revision 1.8 2001/05/10 16:46:27 pierre
|
||||||
|
Loading…
Reference in New Issue
Block a user