source: branches/Independent/Forms/FormScreen.pas

Last change on this file was 67, checked in by chronos, 3 weeks ago
  • Modified: Apps split into separate units.
  • Modified: SystemApi moved into separate unit.
File size: 1.4 KB
Line 
1unit FormScreen;
2
3interface
4
5uses
6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Os;
7
8type
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
24implementation
25
26{$R *.lfm}
27
28{ TFormScreen }
29
30procedure TFormScreen.PaintBox1Paint(Sender: TObject);
31var
32 I: Integer;
33const
34 TitleHeight = 40;
35begin
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;
52end;
53
54procedure TFormScreen.Timer1Timer(Sender: TObject);
55begin
56 if DrawPending then begin
57 DrawPending := False;
58 PaintBox1.Repaint;
59 end;
60end;
61
62procedure TFormScreen.Redraw(Sender: TObject);
63begin
64 DrawPending := True;
65end;
66
67end.
68
Note: See TracBrowser for help on using the repository browser.