1 | unit FormScreen;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Os;
|
---|
7 |
|
---|
8 | type
|
---|
9 |
|
---|
10 | { TFormScreen }
|
---|
11 |
|
---|
12 | TFormScreen = class(TForm)
|
---|
13 | PaintBox1: TPaintBox;
|
---|
14 | Timer1: TTimer;
|
---|
15 | procedure PaintBox1Paint(Sender: TObject);
|
---|
16 | procedure Timer1Timer(Sender: TObject);
|
---|
17 | private
|
---|
18 | DrawPending: Boolean;
|
---|
19 | public
|
---|
20 | System: TSystem;
|
---|
21 | procedure Redraw(Sender: TObject);
|
---|
22 | end;
|
---|
23 |
|
---|
24 | implementation
|
---|
25 |
|
---|
26 | {$R *.lfm}
|
---|
27 |
|
---|
28 | { TFormScreen }
|
---|
29 |
|
---|
30 | procedure TFormScreen.PaintBox1Paint(Sender: TObject);
|
---|
31 | var
|
---|
32 | I: Integer;
|
---|
33 | const
|
---|
34 | TitleHeight = 40;
|
---|
35 | begin
|
---|
36 | PaintBox1.Canvas.Brush.Color := clBlack;
|
---|
37 | PaintBox1.Canvas.Brush.Style := bsSolid;
|
---|
38 |
|
---|
39 | for I := 0 to System.Windows.Count - 1 do
|
---|
40 | with System.Windows[I] do begin
|
---|
41 | if Visible then begin
|
---|
42 | PaintBox1.Canvas.Brush.Color := clGray;
|
---|
43 | PaintBox1.Canvas.Brush.Style := bsSolid;
|
---|
44 | PaintBox1.Canvas.Pen.Color := clWhite;
|
---|
45 | PaintBox1.Canvas.Pen.Style := psSolid;
|
---|
46 | PaintBox1.Canvas.Pen.Width := 5;
|
---|
47 | PaintBox1.Canvas.Rectangle(Rect);
|
---|
48 | PaintBox1.Canvas.TextOut(Rect.Left + 20, Rect.Top + 5, Name);
|
---|
49 | PaintBox1.Canvas.Line(Rect.Left, Rect.Top + TitleHeight, Rect.Right, Rect.Top + TitleHeight);
|
---|
50 | end;
|
---|
51 | end;
|
---|
52 | end;
|
---|
53 |
|
---|
54 | procedure TFormScreen.Timer1Timer(Sender: TObject);
|
---|
55 | begin
|
---|
56 | if DrawPending then begin
|
---|
57 | DrawPending := False;
|
---|
58 | PaintBox1.Repaint;
|
---|
59 | end;
|
---|
60 | end;
|
---|
61 |
|
---|
62 | procedure TFormScreen.Redraw(Sender: TObject);
|
---|
63 | begin
|
---|
64 | DrawPending := True;
|
---|
65 | end;
|
---|
66 |
|
---|
67 | end.
|
---|
68 |
|
---|