I could like to have a button that does double duty as a progress bar.
+
= ……..
E.g. a button that fills up with a green background as the task progresses.
I know I can create my own, but if there’s something ready made I’d love to use that.
Does anyone know of a free or commercial component that fits the bill?
I would prefer it to work in Delphi-2007, but if it’s only available in XE2 that would be OK as well.
Update
TMS has a glassbutton that allows transparency. If you put a Shape (with rounded corners) in a dark green color underneigh, it looks just like the effect that I want.
Just grow the width of the shape to match the progress and you’re in business.
When I have time I’ll make a button that fills up with a color and put up a link.
I’ve created one for you. It’s nothing cool, because I don’t have much experience with component writing, so please take it as it is 🙂
There are two components available:
TProgressButton– with basic support of progress barTProgressGlyphButton– the same as above with glyph supportThe following properties are valid for both components:
maximal visibility)
of the progress
These properties are valid only for
TProgressGlyphButton:– if there is not enough images for all states, then only the first one is drawn for all states
– iaLeft aligns glyph to the left and indent it by the result of vertical glyph centering
– iaRight aligns glyph to the right and indent it by the result of vertical glyph centering
– iaCustom allows you to specify the glyph coordinates manually (see properties above)
The
Fontproperty affects text rendering, so you may change the font style, color or whatever. Please note, that this component need to be used only with enabled Windows Themes.Both components have demo and source code included; I cannot post the updated code here because of limitations of post length. So I left here the original one.
Here’s the
latest version. I don’t have a time to describe it and to finish demo now. It’s finally inherited fromTCustomButton, supports action images (there’s a new propertyImageSourcewhich assigns what will be used as an image source,isNone= no image;isAction= image is taken from the action’s image list;isCustom= uses theImageslist).To be continue 🙂
And here how it may looks like: