Subject | Re: AW: [IBO] TIB_Updatebar Glyhps Color |
---|---|
Author | Paul Vinkenoog |
Post date | 2004-02-17T00:42:35Z |
Hello Rainer,
leaves a disabled button empty if it has a custom glyph. This is true
at both design time and runtime. (I'll describe the solution in a
minute.)
1: You create your custom glyphs and save them to disk as BMP or ICO.
2: You drop an ImageList on your form and load the glyphs into it.
3: Then you set the UpdateBar's CustomGlyphs property to point to
that ImageList.
4: Then you expand CustomGlyphsSupplied and change the value to true
for every glyph type you supplied.
You must repeat steps 3 and 4 for every UpdateBar you want to appear
your custom glyphs on.
Now, to get back to the empty button problem: if a button with a
custom glyph is inactive it won't be shown greyed, but empty. This
is a minor annoyance at design time, but outright unacceptable at
runtime.
To solve this problem you must:
1: Create every custom glyph as a pair, with each pair in one image:
the left half shows the active glyph, the right half the disabled
glyph. [ I'll send you a small example privately ]
2: At runtime, for every custom glyph used, and in every bar you use
it in, call this code:
UpdBar1->Buttons[ ubInsert ]->NumGlyphs = 2;
UpdBar1->Buttons[ ubCancel ]->NumGlyphs = 2;
UpdBar2->Buttons[ ubInsert ]->NumGlyphs = 2;
UpdBar2->Buttons[ ubCancel ]->NumGlyphs = 2;
etc...
You can put this code (adapted to your situation of course!) e.g.
in your Form's OnCreate or OnShow handler.
Make a screenshot of your form (with active buttons!) using Alt-PrtSc.
Then paste the screenshot into a graphics program. Crop it so that it
only contains the glyph you want to change. Change your glyph's
colors. Then copy the glyph to the clipboard. Double the width of the
graphic, the glyph should stay on the left. Paste the clipboard onto
the empty right half of the graphic. Edit the right half to make it
grey (or whatever you want for a disabled icon). Now save the double
glyph, and be proud of it - you're an artist! :-)
Hope this helps,
Paul Vinkenoog
PS:
You can't set NumGlyphs to 2 at design time. Nothing to do about it.
>> Not that I know of. I changed the colors too in some apps; had toUnless you connect to the db and activate the query. By default, IBO
>> make my own glyphs - which is a piece of cake by the way.
> It sure is, if you know what you are doing....
> I just tried that, but somehow my glyphs don't look very good :-(
> At design time they are not shown at all
leaves a disabled button empty if it has a custom glyph. This is true
at both design time and runtime. (I'll describe the solution in a
minute.)
> and at runtime it looks like I have a little mismach in the order.I don't know what causes that, but read on.
> Is it necessary to have custom glyphs for all possible buttons, orOnly the ones you need. This is how you do it:
> is it enough, to supply only the ones needed?
1: You create your custom glyphs and save them to disk as BMP or ICO.
2: You drop an ImageList on your form and load the glyphs into it.
3: Then you set the UpdateBar's CustomGlyphs property to point to
that ImageList.
4: Then you expand CustomGlyphsSupplied and change the value to true
for every glyph type you supplied.
You must repeat steps 3 and 4 for every UpdateBar you want to appear
your custom glyphs on.
Now, to get back to the empty button problem: if a button with a
custom glyph is inactive it won't be shown greyed, but empty. This
is a minor annoyance at design time, but outright unacceptable at
runtime.
To solve this problem you must:
1: Create every custom glyph as a pair, with each pair in one image:
the left half shows the active glyph, the right half the disabled
glyph. [ I'll send you a small example privately ]
2: At runtime, for every custom glyph used, and in every bar you use
it in, call this code:
UpdBar1->Buttons[ ubInsert ]->NumGlyphs = 2;
UpdBar1->Buttons[ ubCancel ]->NumGlyphs = 2;
UpdBar2->Buttons[ ubInsert ]->NumGlyphs = 2;
UpdBar2->Buttons[ ubCancel ]->NumGlyphs = 2;
etc...
You can put this code (adapted to your situation of course!) e.g.
in your Form's OnCreate or OnShow handler.
> Are there any tutorials on how to achieve nice results?You said you only wanted to change the color. I do that like this:
Make a screenshot of your form (with active buttons!) using Alt-PrtSc.
Then paste the screenshot into a graphics program. Crop it so that it
only contains the glyph you want to change. Change your glyph's
colors. Then copy the glyph to the clipboard. Double the width of the
graphic, the glyph should stay on the left. Paste the clipboard onto
the empty right half of the graphic. Edit the right half to make it
grey (or whatever you want for a disabled icon). Now save the double
glyph, and be proud of it - you're an artist! :-)
Hope this helps,
Paul Vinkenoog
PS:
You can't set NumGlyphs to 2 at design time. Nothing to do about it.