You've already forked lazarus-ccr
spktoolbar: Support accelerator in TSpkPopupMenu items
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8729 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -356,7 +356,8 @@ type
|
||||
x, y : integer;
|
||||
const AText : string;
|
||||
TextColor : TColor;
|
||||
ClipRect : T2DIntRect); overload;
|
||||
ClipRect : T2DIntRect;
|
||||
Accel: Boolean = false); overload;
|
||||
class procedure DrawFitWText(ABitmap : TBitmap;
|
||||
x1, x2 : integer;
|
||||
y : integer;
|
||||
@ -2276,16 +2277,20 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TGUITools.DrawText(ACanvas: TCanvas; x, y: integer;
|
||||
const AText: string; TextColor: TColor; ClipRect: T2DIntRect);
|
||||
const AText: string; TextColor: TColor; ClipRect: T2DIntRect;
|
||||
Accel: Boolean = false);
|
||||
var
|
||||
WinAPIClipRect: TRect;
|
||||
ts: TTextStyle;
|
||||
begin
|
||||
WinAPIClipRect := ClipRect.ForWinAPI;
|
||||
with ACanvas do
|
||||
begin
|
||||
Brush.Style := bsClear;
|
||||
Font.Color := TextColor;
|
||||
TextRect(WinAPIClipRect, x, y, AText);
|
||||
ts := TextStyle;
|
||||
ts.ShowPrefix := Accel;
|
||||
TextRect(WinAPIClipRect, x, y, AText, ts);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -226,7 +226,7 @@ begin
|
||||
wText := 0;
|
||||
|
||||
R.Right := ARect.Right - wText; // ClipRect
|
||||
TGUITools.DrawText(ACanvas, x, y, menuItem.Caption, TextColor, R);
|
||||
TGUITools.DrawText(ACanvas, x, y, menuItem.Caption, TextColor, R, true);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Reference in New Issue
Block a user