battles
2011-02-25 15:30:13 UTC
procedure TCustomProgressBar.Paint;
var
DrawRct: TRect;
PercentStr: string;
begin
Canvas.Font := Font;
with Canvas do begin
DrawRct := ClientRect;
DrawRct := DrawBorderSides(Canvas, DrawRct, FBorderOuter);
if BorderWidth > 0 then
{ Fill Border }
DrawRct := DrawBevel( Canvas, DrawRct, FBorderColor,
FBorderColor,
BorderWidth, sdAllSides );
DrawRct := DrawBorderSides(Canvas, DrawRct, FBorderInner);
if FShowText
then PercentStr := S_N(FPosition, FDecimals, FDecimals) + ' ' +
FTextUnit
else PercentStr := '';
if FSmooth
then DrawLEDBar(Canvas, DrawRct, PercentStr)
else DrawPercentBar(Canvas, DrawRct, PercentStr);
end; { with }
end;
In the above procedure that is in a component I am using, I would like
to exclude the "S_N(FPosition, FDecimals, FDecimals) + ' ' +" portion
of the PercentStr string. I have tried to recompile the component
without this but I am not getting a vaild new component, mainly
because I don;t know what I am doing when it comes to component
creating.
Thanks.
var
DrawRct: TRect;
PercentStr: string;
begin
Canvas.Font := Font;
with Canvas do begin
DrawRct := ClientRect;
DrawRct := DrawBorderSides(Canvas, DrawRct, FBorderOuter);
if BorderWidth > 0 then
{ Fill Border }
DrawRct := DrawBevel( Canvas, DrawRct, FBorderColor,
FBorderColor,
BorderWidth, sdAllSides );
DrawRct := DrawBorderSides(Canvas, DrawRct, FBorderInner);
if FShowText
then PercentStr := S_N(FPosition, FDecimals, FDecimals) + ' ' +
FTextUnit
else PercentStr := '';
if FSmooth
then DrawLEDBar(Canvas, DrawRct, PercentStr)
else DrawPercentBar(Canvas, DrawRct, PercentStr);
end; { with }
end;
In the above procedure that is in a component I am using, I would like
to exclude the "S_N(FPosition, FDecimals, FDecimals) + ' ' +" portion
of the PercentStr string. I have tried to recompile the component
without this but I am not getting a vaild new component, mainly
because I don;t know what I am doing when it comes to component
creating.
Thanks.