[Mono-winforms-list] ButtonBase.AutoSize Implementation

Jonathan Pobst monkey at jpobst.com
Sun Dec 17 15:36:53 EST 2006

Also, I believe you need to take Padding and TextImageRelation into 
account.  It's one of those things that you think is very simple when 
you first look at it, and then keep finding more and more things you 
have to take into account.  I think that covers everything that can 
affect the autosize.  Now you can see why it wasn't done yet, it's more 
difficult than it looks.  :)

Thanks very much for tackling this and your persistence.


Miguel de Icaza wrote:
> Hello,
>> thanks for the hint I've corrected the patch. It resizes now if the image, 
>> font or text has been changed. This should cover all cases, or am I missing 
>> something?
> My code review comments:
> Only a few comments, you code should follow the Mono naming conventions
> for fields, so the field 'autoSize' should become "auto_size".
> You do not need to use "this.Autosize" or "this.AutoCalculateNewSize",
> you can remove the "this" from that bit (it happens in a bunch of other
> places as well).
> There are two magic constants in there, that am confused about: 35 and
> 15.   What are those for, and why are they needed?  Shouldnt those be
> computed based on some font metric?
> Miguel.
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list

More information about the Mono-winforms-list mailing list