| 1 |
unit KASStatusBar; |
| 2 |
|
| 3 |
{$mode delphi} |
| 4 |
|
| 5 |
interface |
| 6 |
|
| 7 |
uses |
| 8 |
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls; |
| 9 |
|
| 10 |
type |
| 11 |
|
| 12 |
{ TKASStatusBar } |
| 13 |
|
| 14 |
TKASStatusBar = class(TStatusBar) |
| 15 |
public |
| 16 |
procedure InvalidatePanel(PanelIndex: Integer; PanelParts: TPanelParts); override; |
| 17 |
end; |
| 18 |
|
| 19 |
procedure Register; |
| 20 |
|
| 21 |
implementation |
| 22 |
|
| 23 |
procedure Register; |
| 24 |
begin |
| 25 |
RegisterComponents('KASComponents', [TKASStatusBar]); |
| 26 |
end; |
| 27 |
|
| 28 |
{ TKASStatusBar } |
| 29 |
|
| 30 |
procedure TKASStatusBar.InvalidatePanel(PanelIndex: Integer; PanelParts: TPanelParts); |
| 31 |
begin |
| 32 |
if (PanelIndex >= 0) and (ppText in PanelParts) then |
| 33 |
begin |
| 34 |
if Length(Panels[PanelIndex].Text) > 0 then |
| 35 |
Panels[PanelIndex].Width:= Canvas.TextWidth('WW' + Panels[PanelIndex].Text); |
| 36 |
end; |
| 37 |
inherited InvalidatePanel(PanelIndex, PanelParts); |
| 38 |
end; |
| 39 |
|
| 40 |
end. |