Branch: refs/heads/master
Home: https://github.com/mono/mono
Compare: https://github.com/mono/mono/compare/e946a6cdebde...0b3c3126ea20
Commit: 2f04977242194cbc10b3a802bc9515136b6952be
Author: Peter Collingbourne <[email protected]> (pcc)
Date: 2012-04-02 04:52:21 GMT
URL: https://github.com/mono/mono/commit/2f04977242194cbc10b3a802bc9515136b6952be
Cause MenuDeactivate event to be delivered when appropriate
This is achieved by moving the FireMenuDeactivate call to
MenuStrip.Dismiss and causing it to be called in a couple of places
where it ought to be.
Changed paths:
M mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
M mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
M mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs
Modified: mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
===================================================================
@@ -173,6 +173,8 @@ internal override void Dismiss (ToolStripDropDownCloseReason reason)
this.MenuDroppedDown = false;
base.Dismiss (reason);
+
+ this.FireMenuDeactivate ();
}
internal void FireMenuActivate ()
Modified: mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
===================================================================
@@ -892,7 +892,7 @@ protected override void OnMouseDown (MouseEventArgs mea)
if (this is MenuStrip && mouse_currently_over is ToolStripMenuItem && !(mouse_currently_over as ToolStripMenuItem).HasDropDownItems)
return;
} else {
- this.HideMenus (true, ToolStripDropDownCloseReason.AppClicked);
+ this.Dismiss (ToolStripDropDownCloseReason.AppClicked);
}
if (this is MenuStrip)
@@ -1501,17 +1501,6 @@ internal virtual void HandleItemClick (ToolStripItem dismissingItem)
this.GetTopLevelToolStrip ().Dismiss (ToolStripDropDownCloseReason.ItemClicked);
}
- internal void HideMenus (bool release, ToolStripDropDownCloseReason reason)
- {
- if (this is MenuStrip && release && menu_selected)
- (this as MenuStrip).FireMenuDeactivate ();
-
- if (release)
- menu_selected = false;
-
- NotifySelectedChanged (null);
- }
-
internal void NotifySelectedChanged (ToolStripItem tsi)
{
foreach (ToolStripItem tsi2 in this.DisplayedItems)
Modified: mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs
===================================================================
@@ -315,12 +315,9 @@ protected override void OnMouseLeave (EventArgs e)
protected override void OnMouseUp (MouseEventArgs e)
{
if (this.close_on_mouse_release) {
- this.DropDown.Dismiss (ToolStripDropDownCloseReason.ItemClicked);
+ this.Parent.Dismiss (ToolStripDropDownCloseReason.ItemClicked);
this.Invalidate ();
this.close_on_mouse_release = false;
-
- if (!this.IsOnDropDown && this.Parent is MenuStrip)
- (this.Parent as MenuStrip).MenuDroppedDown = false;
}
if (!this.HasDropDownItems && Enabled)
Commit: 0b3c3126ea203240ba9864ab9082c44935f32f4f
Author: Alex Rønne Petersen <[email protected]> (alexrp)
Date: 2013-10-21 18:21:06 GMT
URL: https://github.com/mono/mono/commit/0b3c3126ea203240ba9864ab9082c44935f32f4f
Merge pull request #268 from pcc/menudeactivate
Cause MenuDeactivate event to be delivered when appropriate
Changed paths:
M mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
M mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
M mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs
Modified: mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
===================================================================
@@ -173,6 +173,8 @@ internal override void Dismiss (ToolStripDropDownCloseReason reason)
this.MenuDroppedDown = false;
base.Dismiss (reason);
+
+ this.FireMenuDeactivate ();
}
internal void FireMenuActivate ()
Modified: mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
===================================================================
@@ -894,7 +894,7 @@ protected override void OnMouseDown (MouseEventArgs mea)
if (this is MenuStrip && mouse_currently_over is ToolStripMenuItem && !(mouse_currently_over as ToolStripMenuItem).HasDropDownItems)
return;
} else {
- this.HideMenus (true, ToolStripDropDownCloseReason.AppClicked);
+ this.Dismiss (ToolStripDropDownCloseReason.AppClicked);
}
if (this is MenuStrip)
@@ -1503,17 +1503,6 @@ internal virtual void HandleItemClick (ToolStripItem dismissingItem)
this.GetTopLevelToolStrip ().Dismiss (ToolStripDropDownCloseReason.ItemClicked);
}
- internal void HideMenus (bool release, ToolStripDropDownCloseReason reason)
- {
- if (this is MenuStrip && release && menu_selected)
- (this as MenuStrip).FireMenuDeactivate ();
-
- if (release)
- menu_selected = false;
-
- NotifySelectedChanged (null);
- }
-
internal void NotifySelectedChanged (ToolStripItem tsi)
{
foreach (ToolStripItem tsi2 in this.DisplayedItems)
Modified: mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs
===================================================================
@@ -315,12 +315,9 @@ protected override void OnMouseLeave (EventArgs e)
protected override void OnMouseUp (MouseEventArgs e)
{
if (this.close_on_mouse_release) {
- this.DropDown.Dismiss (ToolStripDropDownCloseReason.ItemClicked);
+ this.Parent.Dismiss (ToolStripDropDownCloseReason.ItemClicked);
this.Invalidate ();
this.close_on_mouse_release = false;
-
- if (!this.IsOnDropDown && this.Parent is MenuStrip)
- (this.Parent as MenuStrip).MenuDroppedDown = false;
}
if (!this.HasDropDownItems && Enabled)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.