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

Alex Shulgin alexander.shulgin at yessoftware.com
Thu Mar 5 12:37:56 EST 2009


Jonathan Pobst wrote:
> Patch committed.

Thanks a lot!

> It looks like the arrow is not painted when your sample is run on .Net. 
>  I don't see any property or anything that controls that.  I guess it 
> simply looks at its parent and only draws it if it is on a 
> ToolStripDropDownMenu and not a ToolStripDropDown.

Yes, I've noticed this too.

Now, I think I finally come up with a correct version which behaves 
pretty similar to .Net implementation.

Please review a patch (use -p1 if in System.Windows.Forms dir) and 
screenshots.

There are still some magic numbers in the code, but I believe they are 
distributed better than earlier, i.e. less magic in containers and base 
classes. :)

--
Regards,
Alex

> Jonathan
> 
> Alex Shulgin wrote:
>> Jonathan Pobst wrote:
>>> 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.
>>
>> Many thanks, lets commit this. :)
>>
>> Apparently, ToolStripMenuItem needs fixing next: the arrow is painted 
>> over the text as seen on my previous screenshot.
>>
>> -- 
>> Cheers,
>> Alex
>>
>>
>>
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tsddm-calcprefsize-dotnet.png
Type: image/png
Size: 8360 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090305/b9d134c2/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tsddm-calcprefsize-mono.png
Type: image/png
Size: 8176 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090305/b9d134c2/attachment-0003.png 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tsi-calcprefsize.patch
Url: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090305/b9d134c2/attachment-0001.pl 


More information about the Mono-winforms-list mailing list