summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Marc <jmarc.levecque@dbmail.com>2014-01-19 17:07:01 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2014-01-23 05:27:00 +0000
commitb12b0b58d216926c1bae99e3315d074e522371ea (patch)
tree941c88452f9e9339b730ff0f2d96b8d3b84d2ef1 /src
parent1d2227deda30f5d3c12d98c951f758c65de2aae0 (diff)
downloadfpGUI-b12b0b58d216926c1bae99e3315d074e522371ea.tar.xz
Avoid last item selection when mouse points over last item
Diffstat (limited to 'src')
-rw-r--r--src/gui/fpg_menu.pas7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas
index 91db5992..ee345927 100644
--- a/src/gui/fpg_menu.pas
+++ b/src/gui/fpg_menu.pas
@@ -417,6 +417,8 @@ begin
inherited HandleMouseMove(x, y, btnstate, shiftstate);
newf := CalcMouseCol(x);
+ if newf = VisibleCount then
+ Exit; //mouse points over the last item
// process menu options
if mnuo_nofollowingmouse in FMenuOptions then
@@ -467,6 +469,9 @@ begin
Exit; // We have no menu items in MainMenu.
newf := CalcMouseCol(x);
+ if newf = VisibleCount then
+ Exit; //mouse points over the last item
+
if (FLastItemClicked <> -1) and (FLastItemClicked <> newf) then
begin
// do nothing
@@ -660,6 +665,8 @@ begin
inc(w, ItemWidth(VisibleItem(n)));
inc(n);
end;
+ if x > w then
+ Result := n;
end;
function TfpgMenuBar.GetItemPosX(index: integer): integer;