Statistics
| Branch: | Tag: | Revision:

root / Client / Tools / UfrmVirtualLayer.pas @ 0:95bd93c28625

History | View | Annotate | Download (2.3 kB)

1
(*
2
 * CDDL HEADER START
3
 *
4
 * The contents of this file are subject to the terms of the
5
 * Common Development and Distribution License, Version 1.0 only
6
 * (the "License").  You may not use this file except in compliance
7
 * with the License.
8
 *
9
 * You can obtain a copy of the license at
10
 * http://www.opensource.org/licenses/cddl1.php.
11
 * See the License for the specific language governing permissions
12
 * and limitations under the License.
13
 *
14
 * When distributing Covered Code, include this CDDL HEADER in each
15
 * file and include the License file at
16
 * http://www.opensource.org/licenses/cddl1.php.  If applicable,
17
 * add the following below this CDDL HEADER, with the fields enclosed
18
 * by brackets "[]" replaced with your own identifying * information:
19
 *      Portions Copyright [yyyy] [name of copyright owner]
20
 *
21
 * CDDL HEADER END
22
 *
23
 *
24
 *      Portions Copyright 2007 Andreas Schneider
25
 *)
26
unit UfrmVirtualLayer;
27
28
{$mode objfpc}{$H+}
29
30
interface
31
32
uses
33
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, LCLIntf,
34
  LMessages, StdCtrls, Spin, ComCtrls;
35
36
type
37
38
  { TfrmVirtualLayer }
39
40
  TfrmVirtualLayer = class(TForm)
41
    cbShowLayer: TCheckBox;
42
    seZ: TSpinEdit;
43
    tbZ: TTrackBar;
44
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
45
    procedure FormDeactivate(Sender: TObject);
46
    procedure seZChange(Sender: TObject);
47
    procedure tbZChange(Sender: TObject);
48
  protected
49
    procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
50
  public
51
    { public declarations }
52
  end; 
53
54
var
55
  frmVirtualLayer: TfrmVirtualLayer;
56
57
implementation
58
59
{ TfrmVirtualLayer }
60
61
procedure TfrmVirtualLayer.FormClose(Sender: TObject;
62
  var CloseAction: TCloseAction);
63
begin
64
  CloseAction := caHide;
65
end;
66
67
procedure TfrmVirtualLayer.FormDeactivate(Sender: TObject);
68
begin
69
  Close;
70
end;
71
72
procedure TfrmVirtualLayer.seZChange(Sender: TObject);
73
begin
74
  tbZ.Position := seZ.Value;
75
end;
76
77
procedure TfrmVirtualLayer.tbZChange(Sender: TObject);
78
begin
79
  seZ.Value := tbZ.Position;
80
end;
81
82
procedure TfrmVirtualLayer.MouseLeave(var msg: TLMessage);
83
begin
84
  if not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
85
    Close;
86
end;
87
88
initialization
89
  {$I UfrmVirtualLayer.lrs}
90
91
end.
92