root / Client / Tools / UfrmBoundaries.pas @ 0:95bd93c28625
History | View | Annotate | Download (2.6 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 UfrmBoundaries;
|
| 27 | |
| 28 | {$mode objfpc}{$H+} |
| 29 | |
| 30 | interface
|
| 31 | |
| 32 | uses
|
| 33 | Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, LMessages, |
| 34 | LCLIntf, StdCtrls, ComCtrls, Spin; |
| 35 | |
| 36 | type
|
| 37 | |
| 38 | { TfrmBoundaries }
|
| 39 | |
| 40 | TfrmBoundaries = class(TForm)
|
| 41 | lblMinZ: TLabel; |
| 42 | lblMaxZ: TLabel; |
| 43 | seMinZ: TSpinEdit; |
| 44 | seMaxZ: TSpinEdit; |
| 45 | tbMinZ: TTrackBar; |
| 46 | tbMaxZ: TTrackBar; |
| 47 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); |
| 48 | procedure FormDeactivate(Sender: TObject);
|
| 49 | procedure seMaxZChange(Sender: TObject);
|
| 50 | procedure seMinZChange(Sender: TObject);
|
| 51 | procedure tbMaxZChange(Sender: TObject);
|
| 52 | procedure tbMinZChange(Sender: TObject);
|
| 53 | protected
|
| 54 | procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave; |
| 55 | public
|
| 56 | { public declarations }
|
| 57 | end;
|
| 58 | |
| 59 | var
|
| 60 | frmBoundaries: TfrmBoundaries; |
| 61 | |
| 62 | implementation
|
| 63 | |
| 64 | { TfrmBoundaries }
|
| 65 | |
| 66 | procedure TfrmBoundaries.FormClose(Sender: TObject;
|
| 67 | var CloseAction: TCloseAction);
|
| 68 | begin
|
| 69 | CloseAction := caHide; |
| 70 | end;
|
| 71 | |
| 72 | procedure TfrmBoundaries.FormDeactivate(Sender: TObject);
|
| 73 | begin
|
| 74 | Close; |
| 75 | end;
|
| 76 | |
| 77 | procedure TfrmBoundaries.seMaxZChange(Sender: TObject);
|
| 78 | begin
|
| 79 | tbMaxZ.Position := seMaxZ.Value; |
| 80 | end;
|
| 81 | |
| 82 | procedure TfrmBoundaries.seMinZChange(Sender: TObject);
|
| 83 | begin
|
| 84 | tbMinZ.Position := seMinZ.Value; |
| 85 | end;
|
| 86 | |
| 87 | procedure TfrmBoundaries.tbMaxZChange(Sender: TObject);
|
| 88 | begin
|
| 89 | seMaxZ.Value := tbMaxZ.Position; |
| 90 | end;
|
| 91 | |
| 92 | procedure TfrmBoundaries.tbMinZChange(Sender: TObject);
|
| 93 | begin
|
| 94 | seMinZ.Value := tbMinZ.Position; |
| 95 | end;
|
| 96 | |
| 97 | procedure TfrmBoundaries.MouseLeave(var msg: TLMessage); |
| 98 | begin
|
| 99 | if not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then |
| 100 | Close; |
| 101 | end;
|
| 102 | |
| 103 | initialization
|
| 104 | {$I UfrmBoundaries.lrs}
|
| 105 | |
| 106 | end.
|
| 107 |