summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@users.sourceforge.net>2007-03-07 13:19:47 +0000
committerGraeme Geldenhuys <graemeg@users.sourceforge.net>2007-03-07 13:19:47 +0000
commit7e5581b378b48ff731f2d3ea078ff8978f25e8aa (patch)
tree9b1161d1f263499da7c74d060f59ef05c8cd7f58 /gui
parenta78f65fa1c1dc35922205e7cf88ac431aee59bb6 (diff)
downloadfpGUI-7e5581b378b48ff731f2d3ea078ff8978f25e8aa.tar.xz
* Popupu menus now close on item selection.
Diffstat (limited to 'gui')
-rw-r--r--gui/menus.inc8
-rw-r--r--gui/widget.inc4
2 files changed, 5 insertions, 7 deletions
diff --git a/gui/menus.inc b/gui/menus.inc
index cad0f3c9..202b7e27 100644
--- a/gui/menus.inc
+++ b/gui/menus.inc
@@ -137,11 +137,6 @@ begin
else if Event.InheritsFrom(TMouseLeaveEventObj) then
begin
Exclude(WidgetState, wsMouseInside);
-// if Assigned(FSubMenu) and (FSubMenu.Visible) then
-// begin
-// writeln('1111111111111');
-// FSubMenu.Close;
-// end;
Redraw;
result := True;
end
@@ -157,6 +152,9 @@ begin
end
else
inherited Click;
+
+ if FindForm is TPopupMenu then
+ TPopupMenu(FindForm).Close;
end;
constructor TMenuItem.Create(const pText: string; pOwner: TComponent);
diff --git a/gui/widget.inc b/gui/widget.inc
index df671640..b00b3f8e 100644
--- a/gui/widget.inc
+++ b/gui/widget.inc
@@ -1353,8 +1353,8 @@ begin
begin
if wsMouseInside in WidgetState then
SendEvent(TMouseLeaveEventObj.Create(Self))
- end else if (FindForm.MouseCaptureWidget = Self) and
- not (wsMouseInside in WidgetState) then
+ end
+ else if (FindForm.MouseCaptureWidget = Self) and not (wsMouseInside in WidgetState) then
SendEvent(TMouseEnterEventObj.Create(Self, Event.Shift, Event.Position));
if (wsMouseInside in WidgetState) and (Event.NewCursor = crDefault) and