View Issue Details

IDProjectCategoryView StatusLast Update
0001834JEDI VCL00 JVCL Componentspublic2004-06-08 04:17
ReporterwdonkerAssigned Touser72 
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001834: TJvTransparentButton only supports square images
DescriptionTJvtransparentButton has a property NumGlyphs, which has no meaning in the current implementation.
Cause: procedure GlyphChanged overrides NumGlyphs with a value calculated from the Height and Width of the Glyph.
Moreover this calculation assumes the Glyps are square!ssume, assuming
Additional InformationProposed fix:

procedure TJvTransparentButton.SetNumGlyphs(Value: TNumGlyphs);
  if FNumGlyphs <> Value then
    FNumGlyphs := Value;
// next line added so the FImList is rebuilt
procedure TJvTransparentButton.GlyphChanged(Sender: TObject);
  GlyphNum: Integer;
// no need to recalculate NumGlyphs anymore, so
  these lines are no longer needed
// GlyphNum := 1;
// if (Glyph <> nil) and (Glyph.Height > 0) then
// begin
// if Glyph.Width mod Glyph.Height = 0 then
// begin
// GlyphNum := Glyph.Width div Glyph.Height;
// if GlyphNum > 4 then
// GlyphNum := 1;
// SetNumGlyphs(GlyphNum);
// end;
    AddGlyphs(Glyph, Glyph.TransparentColor {Glyph.Canvas.Pixels[0,Height]}, GlyphNum);
TagsNo tags attached.



2004-06-08 04:17


Fixed in CVS, although I've changed it slightly so the number of glyphs are calculated when a new image is assigned.

I've also fixes a Down bug (TJvTransparentButton2 didn't draw a pattern when the button was down) and published AllowAllup and GroupIndex (so you can use the Down property...)

Issue History

Date Modified Username Field Change
2004-06-04 14:54 wdonker New Issue
2004-06-08 02:41 user72 Status new => assigned
2004-06-08 02:41 user72 Assigned To => user72
2004-06-08 04:17 user72 Status assigned => resolved
2004-06-08 04:17 user72 Resolution open => fixed
2004-06-08 04:17 user72 Note Added: 0004498