[lazarus] CVS Committed

Michael A. Hess mhess at miraclec.com
Sun Dec 31 13:59:29 EST 2000

Shane Miller wrote:
> How does TButtonGlyph determine the # of glyphs?  Should it be width
> divided be height?

Glyphs images are generally horizontal. If they are for buttons or for
different states of an object then they would always be of the same
size. You could make it vertical in orientation but horizontal is common
and make more sense to me.

> So if it's 50 pixels wide and 25 high then there would be 2?  We
> would then be assuming the images are always square then.  Is that a
> solution?

I don't think you get it.

You point the object to an image as a resource or whatever. The object
determines the dimensions of the image. Let's say it determines that the
image is 60 high by 180 wide.

Next it looks at the glyph count parameter. If it sees that this value
is 2 then it knows that each glyph is 60 x 90. If this value is 3 then
each glyph is 60 x 60.

This way you are in complete control as to how many glyphs are supplied
and the dimensions of each glyph. In the case where the glyphs are used
with a button to indicate state you would make a fixed determination
that the 1st glyph is 'on' then 2nd glyph is 'off', etc., etc.

==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com

More information about the Lazarus mailing list