summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/gui/widgettest/widgettest.lpi2
-rw-r--r--examples/gui/widgettest/widgettest.pas4
-rw-r--r--gui/menus.inc8
-rw-r--r--gui/widget.inc4
4 files changed, 8 insertions, 10 deletions
diff --git a/examples/gui/widgettest/widgettest.lpi b/examples/gui/widgettest/widgettest.lpi
index 19413c4a..efbb9314 100644
--- a/examples/gui/widgettest/widgettest.lpi
+++ b/examples/gui/widgettest/widgettest.lpi
@@ -52,7 +52,7 @@
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
- <CustomOptions Value="-FUunits -dTraceEventsX -dDebug
+ <CustomOptions Value="-FUunits -dTraceEventsX -dDebugX
"/>
<CompilerPath Value="$(CompPath)"/>
</Other>
diff --git a/examples/gui/widgettest/widgettest.pas b/examples/gui/widgettest/widgettest.pas
index 4c4f4a32..b70b20a4 100644
--- a/examples/gui/widgettest/widgettest.pas
+++ b/examples/gui/widgettest/widgettest.pas
@@ -267,9 +267,9 @@ end;
procedure TMenuForm.AboutMenuClicked(Sender: TObject);
begin
- writeln('...About menu clicked from <' + Sender.ClassName + '>');
+ writeln(' About menu clicked from <' + Sender.ClassName + '>');
if Sender is TMenuItem then
- writeln('From: ' + TMenuItem(Sender).Text);
+ writeln(' from: ' + TMenuItem(Sender).Text);
end;
constructor TMenuForm.Create(AOwner: TComponent);
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