File: kasstatusbar.pas

package info (click to toggle)
doublecmd 1.0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 44,380 kB
  • sloc: pascal: 368,788; ansic: 6,001; sh: 769; makefile: 196; python: 52; xml: 8
file content (40 lines) | stat: -rw-r--r-- 841 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
unit KASStatusBar;

{$mode delphi}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls;

type

  { TKASStatusBar }

  TKASStatusBar = class(TStatusBar)
  public
    procedure InvalidatePanel(PanelIndex: Integer; PanelParts: TPanelParts); override;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('KASComponents', [TKASStatusBar]);
end;

{ TKASStatusBar }

procedure TKASStatusBar.InvalidatePanel(PanelIndex: Integer; PanelParts: TPanelParts);
begin
  if (PanelIndex >= 0) and (ppText in PanelParts) then
  begin
    if Length(Panels[PanelIndex].Text) > 0 then
      Panels[PanelIndex].Width:= Canvas.TextWidth('WW' + Panels[PanelIndex].Text);
  end;
  inherited InvalidatePanel(PanelIndex, PanelParts);
end;

end.