[Mono-winforms-list] [BUMP] ToolStripDropDown + UserControl

Jonathan Pobst monkey at jpobst.com
Wed Mar 4 14:42:22 EST 2009


Alex Shulgin wrote:
> Jonathan Pobst wrote:
>> How about this one?
> 
> Yes, this patch fixes my issue.
> 
> Unfortunately, it breaks things elsewhere: see attached screenshot for 
> the sample.
> 
> I'm now trying to properly override CalcPreferredSize method in 
> ToolStripItem-derived classes to fix the whole issue.  My progress on 
> this is, well... fair. ;)
> 
> BTW, lets not forget about ToolStripDropDownMenu--it has it's own 
> copy-pasted implementation of OnLayout method with minor changes.
> 

Ok, this will get out of hand pretty quickly, so lets take little steps. 
  Attached is the same patch, except it moves your label1 back to the 
left.  If this one is ok with you, I'd like to go ahead and commit it.

I've been intentionally not touching ToolStripDropDownMenu because it 
currently works, even though its not really done right.  I was hoping if 
I could get your stuff fixed, I could just leave it the way it is.

The issue is that we don't handle correctly is that setting 
ShowCheckMargin or ShowImageMargin on ToolStripDropDownMenu updates the 
Padding, which we don't do.  Because I never knew where these values 
came from, I have those hardcoded values all over the place.  Fixing the 
Padding issue causes just about every menustrip thing to break.  (See 
the attached patch: padding.patch.)

It is relatively safe to touch ToolStripDropDown.OnLayout because the 
only thing that uses it is ToolStripOverflow, and of course anyone using 
it directly.

Jonathan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tsdd.patch
Url: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090304/770e2a11/attachment-0002.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: padding.patch
Url: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090304/770e2a11/attachment-0003.pl 


More information about the Mono-winforms-list mailing list