summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-05-12 16:45:59 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-05-12 16:45:59 +0200
commite7dae27c2123f27053454b5a5cb1acc661f4e91c (patch)
tree0d7193a16227d37a4669f64e2e5ddd543d99a558
parent7c4d9ec9910d4afd38ee9c22d8add2e7f411e3f2 (diff)
downloadfpGUI-e7dae27c2123f27053454b5a5cb1acc661f4e91c.tar.xz
TfpgPopupMenu's DrawItem() and DrawRow() now as AItemFocused property
This allows us more flexibility in how to draw menu items.
-rw-r--r--src/gui/fpg_menu.pas12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas
index 3d972756..75ac75a2 100644
--- a/src/gui/fpg_menu.pas
+++ b/src/gui/fpg_menu.pas
@@ -123,8 +123,8 @@ type
procedure HandlePaint; override;
procedure HandleShow; override;
procedure HandleClose; override;
- procedure DrawItem(mi: TfpgMenuItem; rect: TfpgRect); virtual;
- procedure DrawRow(line: integer; focus: boolean); virtual;
+ procedure DrawItem(mi: TfpgMenuItem; rect: TfpgRect; const AItemFocused: boolean); virtual;
+ procedure DrawRow(line: integer; const AItemFocused: boolean); virtual;
function ItemHeight(mi: TfpgMenuItem): integer; virtual;
procedure PrepareToShow;
public
@@ -1022,7 +1022,7 @@ begin
Result := TfpgMenuItem(FItems.Items[ind]);
end;
-procedure TfpgPopupMenu.DrawItem(mi: TfpgMenuItem; rect: TfpgRect);
+procedure TfpgPopupMenu.DrawItem(mi: TfpgMenuItem; rect: TfpgRect; const AItemFocused: boolean);
var
s: string;
x: integer;
@@ -1056,7 +1056,7 @@ begin
end;
end;
-procedure TfpgPopupMenu.DrawRow(line: integer; focus: boolean);
+procedure TfpgPopupMenu.DrawRow(line: integer; const AItemFocused: boolean);
var
n: integer;
r: TfpgRect;
@@ -1073,7 +1073,7 @@ begin
if line = n then
begin
- if focus and (not mi.Separator) then
+ if AItemFocused and (not mi.Separator) then
begin
if MenuFocused then
begin
@@ -1103,7 +1103,7 @@ begin
end;
end;
Canvas.FillRectangle(r);
- DrawItem(mi, r);
+ DrawItem(mi, r, AItemFocused);
Canvas.EndDraw(r.Left, r.Top, r.Width, r.Height);
Exit; //==>
end;