[Mono-bugs] [Bug 437683] ToolStripSplitButton issues
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Oct 24 18:46:47 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=437683
User johnm at hlaustralia.com.au added comment
https://bugzilla.novell.com/show_bug.cgi?id=437683#c5
--- Comment #5 from John Mortlock <johnm at hlaustralia.com.au> 2008-10-24 16:46:46 MDT ---
One thing i found when testing this is that mono does not pass the correct
Mouse Location in the Mouse events, and this is why the bounds checking is
actually failing.
If you look at .NET it will pass the mouse location relative to the button
being pressed, in MONO it is relative to the ToolStrip itself.. Hence the first
button drop down button bounds check X coordinate is out by the GripMargin and
subsequent buttons have no hope..
Adding the folowing to ToolStripItem gives the correct mouse location and is
used in the OnMouseDown, etc events.
internal MouseEventArgs TranslateMouseEventArgs (MouseEventArgs mea)
{
return new MouseEventArgs (mea.Button, mea.Clicks, mea.X -
mouse_currently_over.Left, mea.Y, mea.Delta);
}
In ToolStripSplitButton.cs I also modified HandleClick
to use the translated mouse events.
MouseEventArgs mea = this.Owner.TranslateMouseEventArgs (e as MouseEventArgs);
Basically these changes fix the original problem in the task and also more
closely matches .NETs behaviour.
Thanks for your time!
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list