summaryrefslogtreecommitdiff
path: root/src/gui/fpg_menu.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2015-04-09 08:12:22 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2015-04-09 08:12:22 +0100
commitdb31f06d5e7adf28fad60e36fd9e5d2cf0519e84 (patch)
treebc7782a4a174ce57836947cec194281651b642e7 /src/gui/fpg_menu.pas
parentc8acc2c1666015daeb3038c838e5018c0ecd8903 (diff)
parentf37cd9b2a08a41b8d877f64f9d5d5402105ee74a (diff)
downloadfpGUI-db31f06d5e7adf28fad60e36fd9e5d2cf0519e84.tar.xz
Merge branch 'release-1.4'
Diffstat (limited to 'src/gui/fpg_menu.pas')
-rw-r--r--src/gui/fpg_menu.pas20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas
index 3f634c02..4779fe40 100644
--- a/src/gui/fpg_menu.pas
+++ b/src/gui/fpg_menu.pas
@@ -108,9 +108,6 @@ type
function MenuFocused: boolean;
function SearchItemByAccel(s: string): integer;
protected
- FMenuFont: TfpgFont;
- FMenuAccelFont: TfpgFont;
- FMenuDisabledFont: TfpgFont;
FSymbolWidth: integer;
FItems: TList;
FFocusItem: integer;
@@ -1100,7 +1097,7 @@ begin
if mi.HotKeyDef <> '' then
begin
s := mi.HotKeyDef;
- fpgStyle.DrawString(Canvas, rect.Right-FMenuFont.TextWidth(s)-FTextMargin, rect.Top, s, mi.Enabled);
+ fpgStyle.DrawString(Canvas, rect.Right-fpgStyle.MenuFont.TextWidth(s)-FTextMargin, rect.Top, s, mi.Enabled);
end;
// process menu item submenu arrow image
@@ -1182,7 +1179,7 @@ begin
if mi.Separator then
Result := 5
else
- Result := FMenuFont.Height + 2;
+ Result := fpgStyle.MenuFont.Height + 2;
end;
function TfpgPopupMenu.MenuFocused: boolean;
@@ -1263,14 +1260,14 @@ begin
mi := VisibleItem(n);
x := ItemHeight(mi);
inc(h, x);
- x := FMenuFont.TextWidth(mi.Text);
+ x := fpgStyle.MenuFont.TextWidth(mi.Text);
if tw < x then
tw := x;
if mi.SubMenu <> nil then
- x := FMenuFont.Height
+ x := fpgStyle.MenuFont.Height
else
- x := FMenuFont.TextWidth(mi.HotKeyDef);
+ x := fpgStyle.MenuFont.TextWidth(mi.HotKeyDef);
if hkw < x then
hkw := x;
end;
@@ -1342,16 +1339,13 @@ end;
constructor TfpgPopupMenu.Create(AOwner: TComponent);
begin
+ FWindowType:=wtPopup;
inherited Create(AOwner);
FMargin := 3;
FTextMargin := 3;
FItems := TList.Create;
- // fonts
- FMenuFont := fpgStyle.MenuFont;
- FMenuAccelFont := fpgStyle.MenuAccelFont;
- FMenuDisabledFont := fpgStyle.MenuDisabledFont;
- FSymbolWidth := FMenuFont.Height+2;
+ FSymbolWidth := fpgStyle.MenuFont.Height+2;
FBeforeShow := nil;
FFocusItem := -1;