mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 05:40:24 +02:00
LCL: Use BitBtn in Calculator dialog on Windows. Allows colors. Issue #28413, patch from Alexey Torgashin.
git-svn-id: trunk@49696 -
This commit is contained in:
parent
b77c1d45bc
commit
d25b6c6317
@ -155,8 +155,18 @@ type
|
||||
cbAdd, cbSqrt, cbSquare, cbPcnt, cbRev, cbEql, cbBck, cbClr, cbMP,
|
||||
cbMS, cbMR, cbMC, cbOk, cbCancel);
|
||||
|
||||
{$IFDEF Windows}
|
||||
// Windows: use BitBtn to enable font color on button
|
||||
{$define CalcBitButtons}
|
||||
{$ENDIF}
|
||||
|
||||
type
|
||||
TCalcButton = class(TCustomSpeedButton)
|
||||
|
||||
{ TCalcButton }
|
||||
|
||||
TCalcButton = class(
|
||||
{$IFDEF CalcBitButtons} TCustomBitBtn {$ELSE} TCustomSpeedButton {$ENDIF}
|
||||
)
|
||||
private
|
||||
FKind: TCalcBtnKind;
|
||||
public
|
||||
@ -180,7 +190,7 @@ const
|
||||
CalcBtnSizes: array[TCalculatorLayout, 1..2] of Integer =
|
||||
((36,22), (25,21));
|
||||
CalcBtnCaptions: array[cbSgn..cbCancel] of String =
|
||||
('±', ',', '/', '*', '-', '+', '√', 'x²', '%', '1/x', '=', '«', 'C',
|
||||
('±', ',', '/', '*', '-', '+', '√ ', 'x²', '%', '1/x', '=', '«', 'C',
|
||||
'MP','MS','MR','MC', 'ok', 'x');
|
||||
CalcBtnPos: array[TCalculatorLayout, TCalcBtnKind] of TPoint =
|
||||
((
|
||||
@ -784,6 +794,9 @@ end;
|
||||
constructor TCalcButton.CreateKind(AOwner: TComponent; AKind: TCalcBtnKind);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
{$IFDEF CalcBitButtons}
|
||||
TabStop:=false;
|
||||
{$ENDIF}
|
||||
FKind:=AKind;
|
||||
if FKind in [cbNum0..cbClr] then
|
||||
Tag:=Ord(Kind) - 1
|
||||
@ -791,6 +804,5 @@ begin
|
||||
Tag:=-1;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user