Hello,
I had trouble with the caption on a speed button and needed to modify the sorce code. When the button layout is glyph on top or bottom the caption width calculation must not include the width of the glyph or the spacing.
The following code for sSpeedButton.pas works for runtime. Where do I fix the same problem for design time?
function MaxCaptionWidth(Button : TsSpeedButton) : integer;
begin
with Button do begin
if (not ShowCaption) or (Caption = '') then
Result := 0
else if (Layout in [blGlyphTop, blGlyphBottom]) then
Result := Width – ArrowWidth – 2 * Margin
else
Result := Width – ArrowWidth – 2 * Margin – (Spacing + GlyphWidth) * integer(GlyphWidth <> 0);
end;
end;
Neil Nolte
Director of Software Development
Hirschmann Automation, LLC