View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001834 | JEDI VCL | 00 JVCL Components | public | 2004-06-04 14:54 | 2004-06-08 04:17 |
Reporter | wdonker | Assigned To | user72 | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0001834: TJvTransparentButton only supports square images | ||||
Description | TJvtransparentButton 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 Information | Proposed fix: procedure TJvTransparentButton.SetNumGlyphs(Value: TNumGlyphs); begin if FNumGlyphs <> Value then begin FNumGlyphs := Value; // next line added so the FImList is rebuilt GlyphChanged(Self); Invalidate; end; end; procedure TJvTransparentButton.GlyphChanged(Sender: TObject); var GlyphNum: Integer; begin Invalidate; // 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); end; end; | ||||
Tags | No tags attached. | ||||
|
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...) |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-06-04 14:54 | wdonker | New Issue | |
2004-06-08 02:41 |
|
Status | new => assigned |
2004-06-08 02:41 |
|
Assigned To | => user72 |
2004-06-08 04:17 |
|
Status | assigned => resolved |
2004-06-08 04:17 |
|
Resolution | open => fixed |
2004-06-08 04:17 |
|
Note Added: 0004498 |