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;
|
x, y : integer;
|
||||||
const AText : string;
|
const AText : string;
|
||||||
TextColor : TColor;
|
TextColor : TColor;
|
||||||
ClipRect : T2DIntRect); overload;
|
ClipRect : T2DIntRect;
|
||||||
|
Accel: Boolean = false); overload;
|
||||||
class procedure DrawFitWText(ABitmap : TBitmap;
|
class procedure DrawFitWText(ABitmap : TBitmap;
|
||||||
x1, x2 : integer;
|
x1, x2 : integer;
|
||||||
y : integer;
|
y : integer;
|
||||||
@ -2276,16 +2277,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TGUITools.DrawText(ACanvas: TCanvas; x, y: integer;
|
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
|
var
|
||||||
WinAPIClipRect: TRect;
|
WinAPIClipRect: TRect;
|
||||||
|
ts: TTextStyle;
|
||||||
begin
|
begin
|
||||||
WinAPIClipRect := ClipRect.ForWinAPI;
|
WinAPIClipRect := ClipRect.ForWinAPI;
|
||||||
with ACanvas do
|
with ACanvas do
|
||||||
begin
|
begin
|
||||||
Brush.Style := bsClear;
|
Brush.Style := bsClear;
|
||||||
Font.Color := TextColor;
|
Font.Color := TextColor;
|
||||||
TextRect(WinAPIClipRect, x, y, AText);
|
ts := TextStyle;
|
||||||
|
ts.ShowPrefix := Accel;
|
||||||
|
TextRect(WinAPIClipRect, x, y, AText, ts);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ begin
|
|||||||
wText := 0;
|
wText := 0;
|
||||||
|
|
||||||
R.Right := ARect.Right - wText; // ClipRect
|
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;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user