[Lazarus] Graphics changes (r15472)

Marc Weustink marc.weustink at cuperus.nl
Mon Jun 23 11:49:08 CEST 2008


Kostas Michalopoulos wrote:
>> Yes, you cannot change the size of an Icon, since an icon contains on or
>> more images of different sizes/depths
>>
>> Use Icon.Add() to add a new image with given size and depth, then use
>> TIcon.Current to select the wanted image.
>>
>> Marc
> 
> Cannot this be done transparently so it won't break the code? Even with a 
> boolean property to enable/disable this, it would be nice. 

How would this work. We have a SetSize method, but moth users woud set 
Width and Height separately. Imagine the next scenario:
Current Icon is 16x16, size is changed to 32x32 by setting width first 
so it becomes a 32x16 icon. Should this one be added, or should an Icon 
looked up with this width ?

I don't think they should automagically be added, but what maybe 
possible is to select based on width or height

> Or if not, make 
> width and size read-only. IMHO it is a bad surprise for the user to get this 
> exception when the object allows the assignment of width and height fields.

Width and Height can be made protected properties, the SetSize method not.

> Of course this isn't a high priority thing or anything, but it looks more 
> "polished" i think :-)


Marc




More information about the Lazarus mailing list