- Initial import from internal repository
This commit is contained in:
82
Client/Tools/UfrmBoundaries.lfm
Normal file
82
Client/Tools/UfrmBoundaries.lfm
Normal file
@@ -0,0 +1,82 @@
|
||||
object frmBoundaries: TfrmBoundaries
|
||||
Left = 290
|
||||
Height = 105
|
||||
Top = 171
|
||||
Width = 187
|
||||
HorzScrollBar.Page = 186
|
||||
VertScrollBar.Page = 104
|
||||
ActiveControl = tbMinZ
|
||||
BorderIcons = []
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Boundaries'
|
||||
ClientHeight = 105
|
||||
ClientWidth = 187
|
||||
OnClose = FormClose
|
||||
OnDeactivate = FormDeactivate
|
||||
object lblMinZ: TLabel
|
||||
Left = 8
|
||||
Height = 16
|
||||
Top = 8
|
||||
Width = 67
|
||||
Caption = 'Minimum Z:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblMaxZ: TLabel
|
||||
Left = 8
|
||||
Height = 16
|
||||
Top = 56
|
||||
Width = 68
|
||||
Caption = 'Maximum Z:'
|
||||
ParentColor = False
|
||||
end
|
||||
object tbMinZ: TTrackBar
|
||||
Left = 8
|
||||
Height = 17
|
||||
Top = 32
|
||||
Width = 172
|
||||
Frequency = 10
|
||||
Max = 127
|
||||
Min = -128
|
||||
OnChange = tbMinZChange
|
||||
PageSize = 1
|
||||
Position = -128
|
||||
ScalePos = trTop
|
||||
TabOrder = 0
|
||||
end
|
||||
object tbMaxZ: TTrackBar
|
||||
Left = 8
|
||||
Height = 16
|
||||
Top = 80
|
||||
Width = 172
|
||||
Frequency = 10
|
||||
Max = 127
|
||||
Min = -128
|
||||
OnChange = tbMaxZChange
|
||||
PageSize = 1
|
||||
Position = 127
|
||||
ScalePos = trTop
|
||||
TabOrder = 1
|
||||
end
|
||||
object seMinZ: TSpinEdit
|
||||
Left = 128
|
||||
Height = 23
|
||||
Top = 4
|
||||
Width = 50
|
||||
MaxValue = 127
|
||||
MinValue = -128
|
||||
OnChange = seMinZChange
|
||||
TabOrder = 2
|
||||
Value = -128
|
||||
end
|
||||
object seMaxZ: TSpinEdit
|
||||
Left = 128
|
||||
Height = 23
|
||||
Top = 52
|
||||
Width = 50
|
||||
MaxValue = 127
|
||||
MinValue = -128
|
||||
OnChange = seMaxZChange
|
||||
TabOrder = 3
|
||||
Value = 127
|
||||
end
|
||||
end
|
||||
107
Client/Tools/UfrmBoundaries.pas
Normal file
107
Client/Tools/UfrmBoundaries.pas
Normal file
@@ -0,0 +1,107 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmBoundaries;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, LMessages,
|
||||
LCLIntf, StdCtrls, ComCtrls, Spin;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmBoundaries }
|
||||
|
||||
TfrmBoundaries = class(TForm)
|
||||
lblMinZ: TLabel;
|
||||
lblMaxZ: TLabel;
|
||||
seMinZ: TSpinEdit;
|
||||
seMaxZ: TSpinEdit;
|
||||
tbMinZ: TTrackBar;
|
||||
tbMaxZ: TTrackBar;
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure seMaxZChange(Sender: TObject);
|
||||
procedure seMinZChange(Sender: TObject);
|
||||
procedure tbMaxZChange(Sender: TObject);
|
||||
procedure tbMinZChange(Sender: TObject);
|
||||
protected
|
||||
procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmBoundaries: TfrmBoundaries;
|
||||
|
||||
implementation
|
||||
|
||||
{ TfrmBoundaries }
|
||||
|
||||
procedure TfrmBoundaries.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction := caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmBoundaries.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmBoundaries.seMaxZChange(Sender: TObject);
|
||||
begin
|
||||
tbMaxZ.Position := seMaxZ.Value;
|
||||
end;
|
||||
|
||||
procedure TfrmBoundaries.seMinZChange(Sender: TObject);
|
||||
begin
|
||||
tbMinZ.Position := seMinZ.Value;
|
||||
end;
|
||||
|
||||
procedure TfrmBoundaries.tbMaxZChange(Sender: TObject);
|
||||
begin
|
||||
seMaxZ.Value := tbMaxZ.Position;
|
||||
end;
|
||||
|
||||
procedure TfrmBoundaries.tbMinZChange(Sender: TObject);
|
||||
begin
|
||||
seMinZ.Value := tbMinZ.Position;
|
||||
end;
|
||||
|
||||
procedure TfrmBoundaries.MouseLeave(var msg: TLMessage);
|
||||
begin
|
||||
if not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
|
||||
Close;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I UfrmBoundaries.lrs}
|
||||
|
||||
end.
|
||||
|
||||
35
Client/Tools/UfrmConfirmation.lfm
Normal file
35
Client/Tools/UfrmConfirmation.lfm
Normal file
@@ -0,0 +1,35 @@
|
||||
object frmConfirmation: TfrmConfirmation
|
||||
Left = 290
|
||||
Height = 43
|
||||
Top = 171
|
||||
Width = 108
|
||||
HorzScrollBar.Page = 107
|
||||
VertScrollBar.Page = 42
|
||||
BorderIcons = []
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Apply?'
|
||||
ClientHeight = 43
|
||||
ClientWidth = 108
|
||||
object btnYes: TButton
|
||||
Left = 8
|
||||
Height = 25
|
||||
Top = 8
|
||||
Width = 40
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'Yes'
|
||||
Default = True
|
||||
ModalResult = 6
|
||||
TabOrder = 0
|
||||
end
|
||||
object btnNo: TButton
|
||||
Left = 56
|
||||
Height = 25
|
||||
Top = 8
|
||||
Width = 40
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Cancel = True
|
||||
Caption = 'No'
|
||||
ModalResult = 7
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
57
Client/Tools/UfrmConfirmation.pas
Normal file
57
Client/Tools/UfrmConfirmation.pas
Normal file
@@ -0,0 +1,57 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmConfirmation;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmConfirmation }
|
||||
|
||||
TfrmConfirmation = class(TForm)
|
||||
btnYes: TButton;
|
||||
btnNo: TButton;
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmConfirmation: TfrmConfirmation;
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
{$I UfrmConfirmation.lrs}
|
||||
|
||||
end.
|
||||
|
||||
74
Client/Tools/UfrmDrawSettings.lfm
Normal file
74
Client/Tools/UfrmDrawSettings.lfm
Normal file
@@ -0,0 +1,74 @@
|
||||
object frmDrawSettings: TfrmDrawSettings
|
||||
Left = 290
|
||||
Height = 138
|
||||
Top = 171
|
||||
Width = 186
|
||||
HorzScrollBar.Page = 185
|
||||
VertScrollBar.Page = 137
|
||||
ActiveControl = rbTileList
|
||||
BorderIcons = []
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Draw settings'
|
||||
ClientHeight = 138
|
||||
ClientWidth = 186
|
||||
FormStyle = fsStayOnTop
|
||||
OnClose = FormClose
|
||||
OnDeactivate = FormDeactivate
|
||||
OnShow = FormShow
|
||||
object rbTileList: TRadioButton
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 113
|
||||
Caption = 'Use tile from the list'
|
||||
Checked = True
|
||||
State = cbChecked
|
||||
TabOrder = 0
|
||||
UseOnChange = True
|
||||
end
|
||||
object rbRandom: TRadioButton
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 32
|
||||
Width = 164
|
||||
Caption = 'Use tiles from the random pool'
|
||||
TabOrder = 1
|
||||
UseOnChange = True
|
||||
end
|
||||
object cbForceAltitude: TCheckBox
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 60
|
||||
Width = 89
|
||||
Caption = 'Force altitude:'
|
||||
TabOrder = 2
|
||||
end
|
||||
object seForceAltitude: TSpinEdit
|
||||
Left = 104
|
||||
Height = 23
|
||||
Top = 56
|
||||
Width = 50
|
||||
MaxValue = 127
|
||||
MinValue = -128
|
||||
OnChange = seForceAltitudeChange
|
||||
TabOrder = 3
|
||||
end
|
||||
object gbHue: TGroupBox
|
||||
Height = 49
|
||||
Top = 88
|
||||
Width = 185
|
||||
Caption = 'Hue (Statics only)'
|
||||
ClientHeight = 31
|
||||
ClientWidth = 181
|
||||
TabOrder = 4
|
||||
object pbHue: TPaintBox
|
||||
Cursor = crHandPoint
|
||||
Left = 6
|
||||
Height = 16
|
||||
Top = 1
|
||||
Width = 169
|
||||
OnClick = pbHueClick
|
||||
OnPaint = pbHuePaint
|
||||
end
|
||||
end
|
||||
end
|
||||
132
Client/Tools/UfrmDrawSettings.pas
Normal file
132
Client/Tools/UfrmDrawSettings.pas
Normal file
@@ -0,0 +1,132 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmDrawSettings;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Spin, ExtCtrls, LMessages, LCLIntf;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmDrawSettings }
|
||||
|
||||
TfrmDrawSettings = class(TForm)
|
||||
cbForceAltitude: TCheckBox;
|
||||
gbHue: TGroupBox;
|
||||
pbHue: TPaintBox;
|
||||
rbRandom: TRadioButton;
|
||||
rbTileList: TRadioButton;
|
||||
seForceAltitude: TSpinEdit;
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure pbHueClick(Sender: TObject);
|
||||
procedure pbHuePaint(Sender: TObject);
|
||||
procedure seForceAltitudeChange(Sender: TObject);
|
||||
protected
|
||||
procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmDrawSettings: TfrmDrawSettings;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
UGameResources, UHue, UfrmHueSettings;
|
||||
|
||||
{ TfrmDrawSettings }
|
||||
|
||||
procedure TfrmDrawSettings.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction := caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmDrawSettings.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
if not frmHueSettings.Visible then
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmDrawSettings.FormShow(Sender: TObject);
|
||||
begin
|
||||
Left := Mouse.CursorPos.x - 8;
|
||||
Top := Mouse.CursorPos.y - 8;
|
||||
end;
|
||||
|
||||
procedure TfrmDrawSettings.pbHueClick(Sender: TObject);
|
||||
var
|
||||
msg: TLMessage;
|
||||
begin
|
||||
frmHueSettings.Left := Mouse.CursorPos.x - 8;
|
||||
frmHueSettings.Top := Mouse.CursorPos.y - 8;
|
||||
frmHueSettings.ShowModal;
|
||||
pbHue.Repaint;
|
||||
MouseLeave(msg);
|
||||
end;
|
||||
|
||||
procedure TfrmDrawSettings.pbHuePaint(Sender: TObject);
|
||||
var
|
||||
hue: THue;
|
||||
begin
|
||||
if frmHueSettings <> nil then
|
||||
begin
|
||||
if frmHueSettings.lbHue.ItemIndex > 0 then
|
||||
hue := ResMan.Hue.Hues[frmHueSettings.lbHue.ItemIndex - 1]
|
||||
else
|
||||
hue := nil;
|
||||
TfrmHueSettings.DrawHue(hue, pbHue.Canvas, pbHue.Canvas.ClipRect,
|
||||
frmHueSettings.lbHue.Items.Strings[frmHueSettings.lbHue.ItemIndex]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDrawSettings.seForceAltitudeChange(Sender: TObject);
|
||||
begin
|
||||
cbForceAltitude.Checked := True;
|
||||
end;
|
||||
|
||||
procedure TfrmDrawSettings.MouseLeave(var msg: TLMessage);
|
||||
begin
|
||||
try
|
||||
if (not frmHueSettings.Visible) and (not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos))) then
|
||||
Close;
|
||||
except
|
||||
Close;
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I UfrmDrawSettings.lrs}
|
||||
|
||||
end.
|
||||
|
||||
52
Client/Tools/UfrmElevateSettings.lfm
Normal file
52
Client/Tools/UfrmElevateSettings.lfm
Normal file
@@ -0,0 +1,52 @@
|
||||
object frmElevateSettings: TfrmElevateSettings
|
||||
Left = 290
|
||||
Height = 59
|
||||
Top = 171
|
||||
Width = 131
|
||||
HorzScrollBar.Page = 130
|
||||
VertScrollBar.Page = 58
|
||||
ActiveControl = rbRaise
|
||||
BorderIcons = []
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Elevate'
|
||||
ClientHeight = 59
|
||||
ClientWidth = 131
|
||||
OnClose = FormClose
|
||||
OnDeactivate = FormDeactivate
|
||||
object rbRaise: TRadioButton
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 49
|
||||
Caption = 'Raise'
|
||||
Checked = True
|
||||
State = cbChecked
|
||||
TabOrder = 0
|
||||
end
|
||||
object rbLower: TRadioButton
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 24
|
||||
Width = 51
|
||||
Caption = 'Lower'
|
||||
TabOrder = 1
|
||||
end
|
||||
object seZ: TSpinEdit
|
||||
Left = 72
|
||||
Height = 23
|
||||
Top = 20
|
||||
Width = 50
|
||||
MaxValue = 127
|
||||
MinValue = -128
|
||||
TabOrder = 3
|
||||
Value = 1
|
||||
end
|
||||
object rbSet: TRadioButton
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 40
|
||||
Width = 38
|
||||
Caption = 'Set'
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
81
Client/Tools/UfrmElevateSettings.pas
Normal file
81
Client/Tools/UfrmElevateSettings.pas
Normal file
@@ -0,0 +1,81 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmElevateSettings;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, LMessages,
|
||||
LCLIntf, StdCtrls, Spin;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmElevateSettings }
|
||||
|
||||
TfrmElevateSettings = class(TForm)
|
||||
rbSet: TRadioButton;
|
||||
rbRaise: TRadioButton;
|
||||
rbLower: TRadioButton;
|
||||
seZ: TSpinEdit;
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
protected
|
||||
procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmElevateSettings: TfrmElevateSettings;
|
||||
|
||||
implementation
|
||||
|
||||
{ TfrmElevateSettings }
|
||||
|
||||
procedure TfrmElevateSettings.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction := caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmElevateSettings.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmElevateSettings.MouseLeave(var msg: TLMessage);
|
||||
begin
|
||||
if not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
|
||||
Close;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I UfrmElevateSettings.lrs}
|
||||
|
||||
end.
|
||||
|
||||
374
Client/Tools/UfrmFilter.lfm
Normal file
374
Client/Tools/UfrmFilter.lfm
Normal file
@@ -0,0 +1,374 @@
|
||||
object frmFilter: TfrmFilter
|
||||
Left = 290
|
||||
Height = 491
|
||||
Top = 171
|
||||
Width = 236
|
||||
HorzScrollBar.Page = 235
|
||||
VertScrollBar.Page = 490
|
||||
ActiveControl = rgFilterType
|
||||
BorderIcons = [biSystemMenu, biMinimize]
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Filter'
|
||||
ClientHeight = 491
|
||||
ClientWidth = 236
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
object rgFilterType: TRadioGroup
|
||||
Left = 4
|
||||
Height = 40
|
||||
Top = 4
|
||||
Width = 228
|
||||
Align = alTop
|
||||
AutoFill = True
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'Filter rule'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 2
|
||||
ClientHeight = 18
|
||||
ClientWidth = 222
|
||||
Columns = 2
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Exclusive'
|
||||
'Inclusive'
|
||||
)
|
||||
TabOrder = 0
|
||||
end
|
||||
object GroupBox1: TGroupBox
|
||||
Left = 4
|
||||
Height = 258
|
||||
Top = 48
|
||||
Width = 228
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'Tile filter'
|
||||
ClientHeight = 236
|
||||
ClientWidth = 222
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 4
|
||||
Height = 25
|
||||
Top = 32
|
||||
Width = 214
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'Drag and Drop static tiles from the tile list on this list to add them to the filter.'
|
||||
ParentColor = False
|
||||
WordWrap = True
|
||||
end
|
||||
object vdtFilter: TVirtualDrawTree
|
||||
Tag = 1
|
||||
Left = 4
|
||||
Height = 145
|
||||
Top = 61
|
||||
Width = 214
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 4
|
||||
BorderStyle = bsSingle
|
||||
DefaultNodeHeight = 44
|
||||
DragType = dtVCL
|
||||
Header.Options = [hoColumnResize, hoDrag, hoVisible]
|
||||
Header.Style = hsFlatButtons
|
||||
TabOrder = 0
|
||||
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
|
||||
TreeOptions.SelectionOptions = [toFullRowSelect, toMultiSelect]
|
||||
OnDragOver = vdtFilterDragOver
|
||||
OnDragDrop = vdtFilterDragDrop
|
||||
OnDrawNode = vdtFilterDrawNode
|
||||
Columns = <
|
||||
item
|
||||
WideText = 'ID'
|
||||
end
|
||||
item
|
||||
Position = 1
|
||||
Width = 44
|
||||
WideText = 'Tile'
|
||||
end
|
||||
item
|
||||
Position = 2
|
||||
Width = 100
|
||||
WideText = 'Name'
|
||||
end>
|
||||
end
|
||||
object pnlControls: TPanel
|
||||
Left = 4
|
||||
Height = 22
|
||||
Top = 210
|
||||
Width = 214
|
||||
Align = alBottom
|
||||
BorderSpacing.Around = 4
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 22
|
||||
ClientWidth = 214
|
||||
TabOrder = 1
|
||||
object btnDelete: TSpeedButton
|
||||
Left = 84
|
||||
Height = 22
|
||||
Hint = 'Delete'
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
810900002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A223136203136203131332032222C0A222E2E2063204E6F
|
||||
6E65222C0A222E2C20632023444436413638222C0A222E2D2063202344433634
|
||||
3633222C0A222E2A20632023444136343631222C0A222E612063202344393633
|
||||
3544222C0A222E6220632023444636413641222C0A222E632063202345443933
|
||||
3845222C0A222E6420632023463843334245222C0A222E652063202346394433
|
||||
4343222C0A222E6620632023463943424334222C0A222E672063202346344234
|
||||
4141222C0A222E6820632023453237303636222C0A222E692063202344313545
|
||||
3533222C0A222E6A20632023453036393641222C0A222E6B2063202346324144
|
||||
4141222C0A222E6C20632023464444434438222C0A222E6D2063202346414241
|
||||
4145222C0A222E6E20632023464141333931222C0A222E6F2063202346413944
|
||||
3842222C0A222E7020632023464241393943222C0A222E712063202346434337
|
||||
4241222C0A222E7220632023453937423730222C0A222E732063202343433542
|
||||
3443222C0A222E7420632023463341374133222C0A222E752063202346444442
|
||||
4434222C0A222E7620632023464139413837222C0A222E772063202346303931
|
||||
3746222C0A222E7820632023463138453741222C0A222E792063202346383934
|
||||
3746222C0A222E7A20632023463939323745222C0A222E412063202346383843
|
||||
3736222C0A222E4220632023463842364138222C0A222E432063202345333645
|
||||
3633222C0A222E4420632023433735373435222C0A222E452063202345413833
|
||||
3744222C0A222E4620632023464344344344222C0A222E472063202346373933
|
||||
3745222C0A222E4820632023454538413735222C0A222E492063202346363834
|
||||
3643222C0A222E4A20632023463337393633222C0A222E4B2063202346384146
|
||||
4134222C0A222E4C20632023443034463345222C0A222E4D2063202344453641
|
||||
3637222C0A222E4E20632023463541464135222C0A222E4F2063202346414142
|
||||
3944222C0A222E5020632023463038433737222C0A222E512063202345433546
|
||||
3534222C0A222E5220632023463237373633222C0A222E532063202346343845
|
||||
3831222C0A222E5420632023453937463738222C0A222E552063202343303533
|
||||
3341222C0A222E5620632023444236393634222C0A222E572063202346394239
|
||||
4146222C0A222E5820632023464139333746222C0A222E592063202346303835
|
||||
3730222C0A222E5A20632023464646464646222C0A222E302063202345393539
|
||||
3444222C0A222E3120632023454536413545222C0A222E322063202346313944
|
||||
3936222C0A222E3320632023424534463336222C0A222E342063202344413633
|
||||
3546222C0A222E3520632023463741424131222C0A222E362063202346383836
|
||||
3730222C0A222E3720632023463638323638222C0A222E382063202345413636
|
||||
3543222C0A222E3920632023463139433936222C0A222E402063202342433530
|
||||
3332222C0A222E2320632023443736323543222C0A222E3B2063202345453843
|
||||
3831222C0A222E3A20632023463739313745222C0A222E3D2063202346333733
|
||||
3544222C0A222E2B20632023453935423446222C0A222E252063202346303833
|
||||
3742222C0A222E2420632023453237423735222C0A222E282063202342413442
|
||||
3245222C0A222E2920632023444235363442222C0A222E5B2063202346364142
|
||||
4132222C0A222E5D20632023463036343536222C0A222C2E2063202345453636
|
||||
3532222C0A222C2C20632023453635383443222C0A222C2D2063202345363541
|
||||
3532222C0A222C2A20632023463541333946222C0A222C612063202343343530
|
||||
3334222C0A222C6220632023434636313533222C0A222C632063202345333642
|
||||
3631222C0A222C6420632023463541434131222C0A222C652063202345413543
|
||||
3530222C0A222C6620632023453635393445222C0A222C672063202345363536
|
||||
3443222C0A222C6820632023453635363530222C0A222C692063202346344132
|
||||
3945222C0A222C6A20632023443636303534222C0A222C6B2063202342383441
|
||||
3241222C0A222C6C20632023434235393439222C0A222C6D2063202345303635
|
||||
3543222C0A222C6E20632023463541364131222C0A222C6F2063202345463836
|
||||
3745222C0A222C7020632023453936333542222C0A222C712063202345373544
|
||||
3539222C0A222C7220632023454538343744222C0A222C732063202346344130
|
||||
3945222C0A222C7420632023443735443531222C0A222C752063202342373441
|
||||
3242222C0A222C7620632023433635353432222C0A222C772063202343433532
|
||||
3343222C0A222C7820632023453837413735222C0A222C792063202345453932
|
||||
3846222C0A222C7A20632023453437383731222C0A222C412063202343313444
|
||||
3333222C0A222C4220632023424535333338222C0A222C432063202342443531
|
||||
3335222C0A222C4420632023424334423330222C0A222C452063202342383445
|
||||
3245222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2C2E2D2E2A2E612E2E
|
||||
2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E622E632E642E652E66
|
||||
2E672E682E692E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E6A2E6B2E6C2E6D
|
||||
2E6E2E6F2E702E712E722E732E2E2E2E2E2E222C0A222E2E2E2E2E6A2E742E75
|
||||
2E762E772E782E792E7A2E412E422E432E442E2E2E2E222C0A222E2E2E2E2E45
|
||||
2E462E6F2E472E482E492E492E492E492E4A2E4B2E4C2E2E2E2E222C0A222E2E
|
||||
2E4D2E4E2E4F2E502E512E512E512E512E512E512E522E532E542E552E2E222C
|
||||
0A222E2E2E562E572E582E592E5A2E5A2E5A2E5A2E5A2E5A2E302E312E322E33
|
||||
2E2E222C0A222E2E2E342E352E362E372E5A2E5A2E5A2E5A2E5A2E5A2E302E38
|
||||
2E392E402E2E222C0A222E2E2E232E3B2E3A2E3D2E302E302E302E302E302E30
|
||||
2E2B2E252E242E282E2E222C0A222E2E2E2E2E292E5B2E5D2C2E2E302E302E30
|
||||
2E302C2C2C2D2C2A2C612E2E2E2E222C0A222E2E2E2E2C622C632C642E512C65
|
||||
2E302C662C672C682C692C6A2C6B2E2E2E2E222C0A222E2E2E2E2E2E2C6C2C6D
|
||||
2C6E2C6F2C702C712C722C732C742C752E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2C762C772C782C792C792C7A2C412C752E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2C422C432C442C452E2E2E2E2E2E2E2E2E2E2E2E222C
|
||||
0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E227D0A
|
||||
}
|
||||
NumGlyphs = 0
|
||||
OnClick = btnDeleteClick
|
||||
ShowHint = True
|
||||
ParentShowHint = False
|
||||
end
|
||||
object btnClear: TSpeedButton
|
||||
Left = 108
|
||||
Height = 22
|
||||
Hint = 'Clear'
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
F10800002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A223136203136203130342032222C0A222E2E2063204E6F
|
||||
6E65222C0A222E2C20632023464630303030222C0A222E2D2063202346443030
|
||||
3030222C0A222E2A20632023464632423236222C0A222E612063202346463639
|
||||
3543222C0A222E6220632023464636383542222C0A222E632063202346453637
|
||||
3541222C0A222E6420632023464536353538222C0A222E652063202346453633
|
||||
3536222C0A222E6620632023464536313534222C0A222E672063202346433237
|
||||
3232222C0A222E6820632023464230303030222C0A222E692063202346463641
|
||||
3544222C0A222E6A20632023464634373433222C0A222E6B2063202346453334
|
||||
3334222C0A222E6C20632023464533323332222C0A222E6D2063202346443330
|
||||
3330222C0A222E6E20632023464432443244222C0A222E6F2063202346433343
|
||||
3338222C0A222E7020632023464335443446222C0A222E712063202346413235
|
||||
3146222C0A222E7220632023463730303030222C0A222E732063202346463542
|
||||
3538222C0A222E7420632023464643464346222C0A222E752063202346453532
|
||||
3532222C0A222E7620632023464432463246222C0A222E772063202346443243
|
||||
3243222C0A222E7820632023464334423442222C0A222E792063202346454343
|
||||
4343222C0A222E7A20632023464234433438222C0A222E412063202346423537
|
||||
3439222C0A222E4220632023463932333144222C0A222E432063202346353030
|
||||
3030222C0A222E4420632023464534373433222C0A222E452063202346464633
|
||||
4633222C0A222E4620632023464645444544222C0A222E472063202346433443
|
||||
3443222C0A222E4820632023464334413441222C0A222E492063202346464543
|
||||
4543222C0A222E4A20632023464646324632222C0A222E4B2063202346454341
|
||||
4341222C0A222E4C20632023464132463241222C0A222E4D2063202346413531
|
||||
3432222C0A222E4E20632023463330303030222C0A222E4F2063202346453333
|
||||
3333222C0A222E5020632023464435303530222C0A222E512063202346454543
|
||||
4543222C0A222E5220632023464133453345222C0A222E532063202346383137
|
||||
3137222C0A222E5420632023463934453346222C0A222E552063202346313030
|
||||
3030222C0A222E5620632023464536343537222C0A222E572063202346393344
|
||||
3344222C0A222E5820632023463831363136222C0A222E592063202346373133
|
||||
3133222C0A222E5A20632023463834423343222C0A222E302063202346453632
|
||||
3535222C0A222E3120632023464332393239222C0A222E322063202346433438
|
||||
3438222C0A222E3320632023463933413341222C0A222E342063202346373132
|
||||
3132222C0A222E3520632023463630463046222C0A222E362063202346383438
|
||||
3338222C0A222E3720632023464435463532222C0A222E382063202346433238
|
||||
3238222C0A222E3920632023464334373437222C0A222E402063202346464631
|
||||
4631222C0A222E2320632023464545414541222C0A222E3B2063202346373334
|
||||
3334222C0A222E3A20632023463530423042222C0A222E3D2063202346383435
|
||||
3335222C0A222E2B20632023454630303030222C0A222E252063202346443544
|
||||
3446222C0A222E2420632023464233373332222C0A222E282063202346454342
|
||||
4342222C0A222E2920632023464545424542222C0A222E5B2063202346393342
|
||||
3342222C0A222E5D20632023463833393339222C0A222C2E2063202346454631
|
||||
4631222C0A222C2C20632023464443354335222C0A222C2D2063202346363144
|
||||
3138222C0A222C2A20632023463734333333222C0A222C612063202346393030
|
||||
3030222C0A222C6220632023464235383441222C0A222C632063202346423437
|
||||
3432222C0A222C6420632023464443394339222C0A222C652063202346363130
|
||||
3130222C0A222C6620632023463733333333222C0A222C672063202346373335
|
||||
3330222C0A222C6820632023463734343334222C0A222C692063202346323142
|
||||
3134222C0A222C6A20632023454430303030222C0A222C6B2063202346413533
|
||||
3434222C0A222C6C20632023463932393234222C0A222C6D2063202346353043
|
||||
3043222C0A222C6E20632023463530393039222C0A222C6F2063202346353142
|
||||
3136222C0A222C7020632023463131423134222C0A222C712063202346353230
|
||||
3141222C0A222C7220632023463934433343222C0A222C732063202346383439
|
||||
3341222C0A222C7420632023463834373338222C0A222C752063202346373433
|
||||
3334222C0A222C7620632023463734323332222C0A222E2E2E2E2E2E2E2E2E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2E2C2E2C2E2C2E2C2E2D2E2D2E2D2E2D2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2C2E2A2E612E622E632E642E652E662E672E682E2E2E2E2E2E222C
|
||||
0A222E2E2E2E2E2C2E2A2E692E6A2E6B2E6C2E6D2E6E2E6F2E702E712E722E2E
|
||||
2E2E222C0A222E2E2E2C2E2A2E692E732E742E752E762E772E782E792E7A2E41
|
||||
2E422E432E2E222C0A222E2E2E2C2E622E442E742E452E462E472E482E492E4A
|
||||
2E4B2E4C2E4D2E4E2E2E222C0A222E2E2E2C2E632E4F2E502E462E452E462E46
|
||||
2E4A2E512E522E532E542E552E2E222C0A222E2E2E2D2E562E6D2E6E2E782E46
|
||||
2E4A2E4A2E492E572E582E592E5A2E552E2E222C0A222E2E2E2D2E302E772E31
|
||||
2E322E462E4A2E4A2E512E332E342E352E362E552E2E222C0A222E2E2E2D2E37
|
||||
2E382E392E492E4A2E492E512E402E232E3B2E3A2E3D2E2B2E2E222C0A222E2E
|
||||
2E682E252E242E282E4A2E292E5B2E5D2E232C2E2C2C2C2D2C2A2E2B2E2E222C
|
||||
0A222E2E2C612E712C622C632C642E5B2E592C652C662C2C2C672C682C692C6A
|
||||
2E2E222C0A222E2E2E2E2E722E422C6B2C6C2E342E352C6D2C6E2C6F2C2A2C70
|
||||
2C6A2E2E2E2E222C0A222E2E2E2E2E2E2E432C712C722C732C742E3D2C752C76
|
||||
2C702C6A2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E552E552E552E552E2B
|
||||
2E2B2C6A2C6A2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
NumGlyphs = 0
|
||||
OnClick = btnClearClick
|
||||
ShowHint = True
|
||||
ParentShowHint = False
|
||||
end
|
||||
end
|
||||
object cbTileFilter: TCheckBox
|
||||
Left = 4
|
||||
Height = 24
|
||||
Top = 4
|
||||
Width = 214
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'Filter active'
|
||||
Checked = True
|
||||
State = cbChecked
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object GroupBox2: TGroupBox
|
||||
Left = 4
|
||||
Height = 168
|
||||
Top = 319
|
||||
Width = 228
|
||||
Align = alBottom
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'Hue filter'
|
||||
ClientHeight = 146
|
||||
ClientWidth = 222
|
||||
TabOrder = 2
|
||||
object cbHueFilter: TCheckBox
|
||||
Left = 4
|
||||
Height = 24
|
||||
Top = 4
|
||||
Width = 214
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'Filter active'
|
||||
TabOrder = 0
|
||||
end
|
||||
object vdtHues: TVirtualDrawTree
|
||||
Left = 4
|
||||
Height = 110
|
||||
Top = 32
|
||||
Width = 214
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 4
|
||||
BorderStyle = bsSingle
|
||||
Header.AutoSizeIndex = 2
|
||||
Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoVisible]
|
||||
Header.Style = hsFlatButtons
|
||||
PopupMenu = pmHues
|
||||
TabOrder = 1
|
||||
TreeOptions.MiscOptions = [toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
|
||||
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
|
||||
TreeOptions.SelectionOptions = [toFullRowSelect]
|
||||
OnChecked = vdtHuesChecked
|
||||
OnDrawNode = vdtHuesDrawNode
|
||||
Columns = <
|
||||
item
|
||||
Width = 20
|
||||
end
|
||||
item
|
||||
Position = 1
|
||||
Width = 38
|
||||
WideText = 'Hue'
|
||||
end
|
||||
item
|
||||
Position = 2
|
||||
Width = 156
|
||||
WideText = 'Name'
|
||||
end>
|
||||
end
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
Cursor = crVSplit
|
||||
Height = 5
|
||||
Top = 310
|
||||
Width = 236
|
||||
Align = alBottom
|
||||
ResizeAnchor = akBottom
|
||||
end
|
||||
object pmHues: TPopupMenu
|
||||
left = 148
|
||||
top = 404
|
||||
object mnuCheckHues: TMenuItem
|
||||
Caption = 'Check all hues'
|
||||
OnClick = mnuCheckHuesClick
|
||||
end
|
||||
object mnuUncheckHues: TMenuItem
|
||||
Caption = 'Uncheck all hues'
|
||||
OnClick = mnuUncheckHuesClick
|
||||
end
|
||||
end
|
||||
end
|
||||
325
Client/Tools/UfrmFilter.pas
Normal file
325
Client/Tools/UfrmFilter.pas
Normal file
@@ -0,0 +1,325 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmFilter;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
ExtCtrls, VirtualTrees, LCLIntf, LMessages, Buttons, UPlatformTypes, UStatics,
|
||||
PairSplitter, Menus;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmFilter }
|
||||
|
||||
TfrmFilter = class(TForm)
|
||||
btnClear: TSpeedButton;
|
||||
btnDelete: TSpeedButton;
|
||||
btnRandomPresetDelete: TSpeedButton;
|
||||
btnRandomPresetSave: TSpeedButton;
|
||||
cbRandomPreset: TComboBox;
|
||||
cbTileFilter: TCheckBox;
|
||||
cbHueFilter: TCheckBox;
|
||||
GroupBox1: TGroupBox;
|
||||
GroupBox2: TGroupBox;
|
||||
Label1: TLabel;
|
||||
mnuUncheckHues: TMenuItem;
|
||||
mnuCheckHues: TMenuItem;
|
||||
pnlControls: TPanel;
|
||||
pnlRandomPreset: TPanel;
|
||||
pmHues: TPopupMenu;
|
||||
rgFilterType: TRadioGroup;
|
||||
Splitter1: TSplitter;
|
||||
vdtFilter: TVirtualDrawTree;
|
||||
vdtHues: TVirtualDrawTree;
|
||||
procedure btnClearClick(Sender: TObject);
|
||||
procedure btnDeleteClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure mnuUncheckHuesClick(Sender: TObject);
|
||||
procedure mnuCheckHuesClick(Sender: TObject);
|
||||
procedure vdtFilterDragDrop(Sender: TBaseVirtualTree; Source: TObject;
|
||||
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState;
|
||||
Pt: TPoint; var Effect: Integer; Mode: TDropMode);
|
||||
procedure vdtFilterDragOver(Sender: TBaseVirtualTree; Source: TObject;
|
||||
Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode;
|
||||
var Effect: Integer; var Accept: Boolean);
|
||||
procedure vdtFilterDrawNode(Sender: TBaseVirtualTree;
|
||||
const PaintInfo: TVTPaintInfo);
|
||||
procedure vdtHuesChecked(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
||||
procedure vdtHuesDrawNode(Sender: TBaseVirtualTree;
|
||||
const PaintInfo: TVTPaintInfo);
|
||||
protected
|
||||
FLocked: Boolean;
|
||||
FCheckedHues: TBits;
|
||||
procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
|
||||
public
|
||||
property Locked: Boolean read FLocked write FLocked;
|
||||
function Filter(AStatic: TStaticItem): Boolean;
|
||||
procedure JumpToHue(AHueID: Word);
|
||||
end;
|
||||
|
||||
var
|
||||
frmFilter: TfrmFilter;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
UfrmMain, UGameResources, UHue, UGraphicHelper, UGUIPlatformUtils;
|
||||
|
||||
type
|
||||
PTileInfo = ^TTileInfo;
|
||||
TTileInfo = record
|
||||
ID: Word;
|
||||
end;
|
||||
PHueInfo = ^THueInfo;
|
||||
THueInfo = record
|
||||
ID: Word;
|
||||
Hue: THue;
|
||||
end;
|
||||
|
||||
{ TfrmFilter }
|
||||
|
||||
procedure TfrmFilter.FormShow(Sender: TObject);
|
||||
var
|
||||
upperLeft, lowerLeft: TPoint;
|
||||
begin
|
||||
upperLeft := frmMain.pnlMain.ClientToScreen(Point(0, 0));
|
||||
lowerLeft := frmMain.pnlMain.ClientToScreen(Point(0, frmMain.pnlMain.Height));
|
||||
Left := upperLeft.x;
|
||||
Top := upperLeft.y;
|
||||
Height := lowerLeft.y - upperLeft.y;
|
||||
|
||||
SetWindowParent(Handle, frmMain.Handle);
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.mnuUncheckHuesClick(Sender: TObject);
|
||||
begin
|
||||
vdtHues.ClearChecked;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.mnuCheckHuesClick(Sender: TObject);
|
||||
var
|
||||
node: PVirtualNode;
|
||||
begin
|
||||
node := vdtHues.GetFirst;
|
||||
while node <> nil do
|
||||
begin
|
||||
vdtHues.CheckState[node] := csCheckedNormal;
|
||||
node := vdtHues.GetNext(node);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.vdtFilterDragDrop(Sender: TBaseVirtualTree;
|
||||
Source: TObject; DataObject: IDataObject; Formats: TFormatArray;
|
||||
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode);
|
||||
var
|
||||
sourceTree: TVirtualDrawTree;
|
||||
selected, node: PVirtualNode;
|
||||
sourceTileInfo, targetTileInfo: PTileInfo;
|
||||
begin
|
||||
sourceTree := Source as TVirtualDrawTree;
|
||||
if (sourceTree <> Sender) and (sourceTree <> nil) and
|
||||
(sourceTree.Tag = 1) then
|
||||
begin
|
||||
Sender.BeginUpdate;
|
||||
selected := sourceTree.GetFirstSelected;
|
||||
while selected <> nil do
|
||||
begin
|
||||
sourceTileInfo := sourceTree.GetNodeData(selected);
|
||||
if sourceTileInfo^.ID > $3FFF then
|
||||
begin
|
||||
node := Sender.AddChild(nil);
|
||||
targetTileInfo := Sender.GetNodeData(node);
|
||||
targetTileInfo^.ID := sourceTileInfo^.ID;
|
||||
end;
|
||||
selected := sourceTree.GetNextSelected(selected);
|
||||
end;
|
||||
Sender.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.vdtFilterDragOver(Sender: TBaseVirtualTree;
|
||||
Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint;
|
||||
Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
|
||||
begin
|
||||
if (Source <> Sender) and (Source is TVirtualDrawTree) and
|
||||
(TVirtualDrawTree(Source).Tag = 1) then
|
||||
begin
|
||||
Accept := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.vdtFilterDrawNode(Sender: TBaseVirtualTree;
|
||||
const PaintInfo: TVTPaintInfo);
|
||||
begin
|
||||
frmMain.vdtTilesDrawNode(Sender, PaintInfo);
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.vdtHuesChecked(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
||||
var
|
||||
hueInfo: PHueInfo;
|
||||
begin
|
||||
hueInfo := Sender.GetNodeData(Node);
|
||||
FCheckedHues.Bits[hueInfo^.ID] := (Sender.CheckState[node] = csCheckedNormal);
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.vdtHuesDrawNode(Sender: TBaseVirtualTree;
|
||||
const PaintInfo: TVTPaintInfo);
|
||||
var
|
||||
hueInfo: PHueInfo;
|
||||
hueColor: TColor;
|
||||
i: Integer;
|
||||
textStyle: TTextStyle;
|
||||
begin
|
||||
hueInfo := Sender.GetNodeData(PaintInfo.Node);
|
||||
textStyle := PaintInfo.Canvas.TextStyle;
|
||||
textStyle.Alignment := taLeftJustify;
|
||||
textStyle.Layout := tlCenter;
|
||||
textStyle.Wordbreak := True;
|
||||
case PaintInfo.Column of
|
||||
1:
|
||||
begin
|
||||
for i := 0 to 31 do
|
||||
begin
|
||||
hueColor := ARGB2RGB(hueInfo^.Hue.ColorTable[i]);
|
||||
PaintInfo.Canvas.Pen.Color := hueColor;
|
||||
PaintInfo.Canvas.MoveTo(PaintInfo.CellRect.Left + 2 + i, PaintInfo.CellRect.Top + 1);
|
||||
PaintInfo.Canvas.LineTo(PaintInfo.CellRect.Left + 2 + i, PaintInfo.CellRect.Bottom - 1);
|
||||
end;
|
||||
end;
|
||||
2:
|
||||
begin
|
||||
PaintInfo.Canvas.TextRect(PaintInfo.CellRect, PaintInfo.CellRect.Left, PaintInfo.CellRect.Top, Format('$%x (%s)', [hueInfo^.ID, hueInfo^.Hue.Name]), textStyle);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.MouseLeave(var msg: TLMessage);
|
||||
begin
|
||||
{if Active and (not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos))) then
|
||||
Close;}
|
||||
end;
|
||||
|
||||
function TfrmFilter.Filter(AStatic: TStaticItem): Boolean;
|
||||
var
|
||||
found: Boolean;
|
||||
tileInfo: PTileInfo;
|
||||
node: PVirtualNode;
|
||||
id: Word;
|
||||
begin
|
||||
if cbTileFilter.Checked then
|
||||
begin
|
||||
id := AStatic.TileID + $4000;
|
||||
|
||||
found := False;
|
||||
node := vdtFilter.GetFirst;
|
||||
while (node <> nil) and (not found) do
|
||||
begin
|
||||
tileInfo := vdtFilter.GetNodeData(node);
|
||||
if tileInfo^.ID = id then
|
||||
found := True
|
||||
else
|
||||
node := vdtFilter.GetNext(node);
|
||||
end;
|
||||
|
||||
Result := ((rgFilterType.ItemIndex = 0) and (not found)) or
|
||||
((rgFilterType.ItemIndex = 1) and found);
|
||||
end else
|
||||
Result := True;
|
||||
|
||||
if cbHueFilter.Checked then
|
||||
begin
|
||||
Result := Result and (
|
||||
((rgFilterType.ItemIndex = 0) and (not FCheckedHues.Bits[AStatic.Hue])) or
|
||||
((rgFilterType.ItemIndex = 1) and (FCheckedHues.Bits[AStatic.Hue]))
|
||||
);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.JumpToHue(AHueID: Word);
|
||||
var
|
||||
hueInfo: PHueInfo;
|
||||
node: PVirtualNode;
|
||||
begin
|
||||
node := vdtHues.GetFirst;
|
||||
while node <> nil do
|
||||
begin
|
||||
hueInfo := vdtHues.GetNodeData(node);
|
||||
if hueInfo^.ID = AHueID then
|
||||
begin
|
||||
vdtHues.ClearSelection;
|
||||
vdtHues.Selected[node] := True;
|
||||
vdtHues.FocusedNode := node;
|
||||
node := nil;
|
||||
end else
|
||||
node := vdtHues.GetNext(node);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.FormCreate(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
hueInfo: PHueInfo;
|
||||
node: PVirtualNode;
|
||||
begin
|
||||
FLocked := False;
|
||||
vdtFilter.NodeDataSize := SizeOf(TTileInfo);
|
||||
vdtHues.NodeDataSize := SizeOf(THueInfo);
|
||||
|
||||
vdtHues.BeginUpdate;
|
||||
vdtHues.Clear;
|
||||
for i := 0 to ResMan.Hue.Count - 1 do
|
||||
begin
|
||||
node := vdtHues.AddChild(nil);
|
||||
hueInfo := vdtHues.GetNodeData(node);
|
||||
hueInfo^.ID := i + 1;
|
||||
hueInfo^.Hue := ResMan.Hue.Hues[i];
|
||||
vdtHues.CheckType[node] := ctCheckBox;
|
||||
end;
|
||||
vdtHues.EndUpdate;
|
||||
FCheckedHues := TBits.Create(ResMan.Hue.Count + 1);
|
||||
//FCheckedHues.Bits[0] := True;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.btnDeleteClick(Sender: TObject);
|
||||
begin
|
||||
vdtFilter.DeleteSelectedNodes;
|
||||
end;
|
||||
|
||||
procedure TfrmFilter.btnClearClick(Sender: TObject);
|
||||
begin
|
||||
vdtFilter.Clear;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I UfrmFilter.lrs}
|
||||
|
||||
end.
|
||||
|
||||
45
Client/Tools/UfrmHueSettings.lfm
Normal file
45
Client/Tools/UfrmHueSettings.lfm
Normal file
@@ -0,0 +1,45 @@
|
||||
object frmHueSettings: TfrmHueSettings
|
||||
Left = 290
|
||||
Height = 207
|
||||
Top = 171
|
||||
Width = 217
|
||||
HorzScrollBar.Page = 216
|
||||
VertScrollBar.Page = 206
|
||||
ActiveControl = lbHue
|
||||
BorderIcons = []
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Hue Settings'
|
||||
ClientHeight = 207
|
||||
ClientWidth = 217
|
||||
FormStyle = fsStayOnTop
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDeactivate = FormDeactivate
|
||||
object lblHue: TLabel
|
||||
Left = 8
|
||||
Height = 16
|
||||
Top = 12
|
||||
Width = 26
|
||||
Caption = 'Hue:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lbHue: TListBox
|
||||
Left = 8
|
||||
Height = 160
|
||||
Top = 40
|
||||
Width = 200
|
||||
ItemHeight = 16
|
||||
OnDrawItem = lbHueDrawItem
|
||||
OnSelectionChange = lbHueSelectionChange
|
||||
Style = lbOwnerDrawFixed
|
||||
TabOrder = 0
|
||||
end
|
||||
object edHue: TEdit
|
||||
Left = 48
|
||||
Height = 23
|
||||
Top = 10
|
||||
Width = 80
|
||||
OnEditingDone = edHueEditingDone
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
156
Client/Tools/UfrmHueSettings.pas
Normal file
156
Client/Tools/UfrmHueSettings.pas
Normal file
@@ -0,0 +1,156 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmHueSettings;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
LMessages, LCLIntf, UHue;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmHueSettings }
|
||||
|
||||
TfrmHueSettings = class(TForm)
|
||||
edHue: TEdit;
|
||||
lblHue: TLabel;
|
||||
lbHue: TListBox;
|
||||
procedure edHueEditingDone(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure lbHueDrawItem(Control: TWinControl; Index: Integer; ARect: TRect;
|
||||
State: TOwnerDrawState);
|
||||
procedure lbHueSelectionChange(Sender: TObject; User: boolean);
|
||||
protected
|
||||
procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
|
||||
public
|
||||
class procedure DrawHue(AHue: THue; ACanvas: TCanvas; ARect: TRect;
|
||||
ACaption: string);
|
||||
end;
|
||||
|
||||
var
|
||||
frmHueSettings: TfrmHueSettings;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
UGameResources, UGraphicHelper;
|
||||
|
||||
{ TfrmHueSettings }
|
||||
|
||||
procedure TfrmHueSettings.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction := caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmHueSettings.edHueEditingDone(Sender: TObject);
|
||||
var
|
||||
hueID: Integer;
|
||||
begin
|
||||
if (not TryStrToInt(edHue.Text, hueID)) or (hueID >= lbHue.Items.Count) then
|
||||
begin
|
||||
edHue.Text := Format('$%x', [lbHue.ItemIndex]);
|
||||
MessageDlg('Invalid Hue', 'The hue you''ve entered is invalid.', mtWarning, [mbOK], 0);
|
||||
end else
|
||||
lbHue.ItemIndex := hueID;
|
||||
end;
|
||||
|
||||
procedure TfrmHueSettings.FormCreate(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
hue: THue;
|
||||
begin
|
||||
lbHue.Clear;
|
||||
lbHue.Items.Add('$0 (no hue)');
|
||||
for i := 1 to ResMan.Hue.Count do
|
||||
begin
|
||||
hue := ResMan.Hue.Hues[i-1];
|
||||
lbHue.Items.AddObject(Format('$%x (%s)', [i, hue.Name]), hue);
|
||||
end;
|
||||
lbHue.ItemIndex := 0;
|
||||
end;
|
||||
|
||||
procedure TfrmHueSettings.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmHueSettings.lbHueDrawItem(Control: TWinControl; Index: Integer;
|
||||
ARect: TRect; State: TOwnerDrawState);
|
||||
var
|
||||
hue: THue;
|
||||
begin
|
||||
if Index > 0 then
|
||||
hue := ResMan.Hue.Hues[Index-1]
|
||||
else
|
||||
hue := nil;
|
||||
DrawHue(hue, lbHue.Canvas, ARect, lbHue.Items.Strings[Index]);
|
||||
end;
|
||||
|
||||
procedure TfrmHueSettings.lbHueSelectionChange(Sender: TObject; User: boolean);
|
||||
begin
|
||||
edHue.Text := Format('$%x', [lbHue.ItemIndex]);
|
||||
end;
|
||||
|
||||
procedure TfrmHueSettings.MouseLeave(var msg: TLMessage);
|
||||
begin
|
||||
try
|
||||
if not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
|
||||
Close;
|
||||
except
|
||||
Close;
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TfrmHueSettings.DrawHue(AHue: THue; ACanvas: TCanvas; ARect: TRect;
|
||||
ACaption: string);
|
||||
var
|
||||
hueColor: TColor;
|
||||
i: Integer;
|
||||
begin
|
||||
ACanvas.Pen.Color := clWhite;
|
||||
ACanvas.Rectangle(ARect);
|
||||
if AHue <> nil then
|
||||
for i := 0 to 31 do
|
||||
begin
|
||||
hueColor := ARGB2RGB(AHue.ColorTable[i]);
|
||||
ACanvas.Pen.Color := hueColor;
|
||||
ACanvas.MoveTo(ARect.Left + 2 + i, ARect.Top + 1);
|
||||
ACanvas.LineTo(ARect.Left + 2 + i, ARect.Bottom - 1);
|
||||
end;
|
||||
ACanvas.TextOut(ARect.Left + 36, ARect.Top, ACaption);
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I UfrmHueSettings.lrs}
|
||||
|
||||
end.
|
||||
|
||||
259
Client/Tools/UfrmMoveSettings.lfm
Normal file
259
Client/Tools/UfrmMoveSettings.lfm
Normal file
@@ -0,0 +1,259 @@
|
||||
object frmMoveSettings: TfrmMoveSettings
|
||||
Left = 290
|
||||
Height = 125
|
||||
Top = 171
|
||||
Width = 228
|
||||
HorzScrollBar.Page = 227
|
||||
VertScrollBar.Page = 124
|
||||
ActiveControl = cbAsk
|
||||
BorderIcons = []
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Move settings'
|
||||
ClientHeight = 125
|
||||
ClientWidth = 228
|
||||
FormStyle = fsStayOnTop
|
||||
OnClose = FormClose
|
||||
OnDeactivate = FormDeactivate
|
||||
OnShow = FormShow
|
||||
object cbAsk: TCheckBox
|
||||
Left = 128
|
||||
Height = 15
|
||||
Top = 16
|
||||
Width = 89
|
||||
Caption = 'Ask each time'
|
||||
Checked = True
|
||||
State = cbChecked
|
||||
TabOrder = 0
|
||||
end
|
||||
object gbDirection: TGroupBox
|
||||
Left = 8
|
||||
Height = 112
|
||||
Top = 8
|
||||
Width = 105
|
||||
ClientHeight = 94
|
||||
ClientWidth = 101
|
||||
TabOrder = 1
|
||||
object btnTopLeft: TSpeedButton
|
||||
Left = 6
|
||||
Height = 22
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Down = True
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2C2C2C2C
|
||||
2C2C2C2E2E2E2E2E2E2E222C0A222E2E2C2C2C2C2C2C2E2E2E2E2E2E2E2E222C
|
||||
0A222E2E2C2C2C2C2C2E2E2E2E2E2E2E2E2E222C0A222E2E2C2C2C2C2C2C2E2E
|
||||
2E2E2E2E2E2E222C0A222E2E2C2C2C2C2C2C2C2E2E2E2E2E2E2E222C0A222E2E
|
||||
2C2C2E2C2C2C2C2C2E2E2E2E2E2E222C0A222E2E2C2E2E2E2C2C2C2C2C2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2C2C2C2C2C2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2C2C2C2C2C2E2E2E222C0A222E2E2E2E2E2E2E2E2E2C2C2C2C2C2E2E222C
|
||||
0A222E2E2E2E2E2E2E2E2E2E2C2C2C2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E
|
||||
2E2C2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object btnTop: TSpeedButton
|
||||
Left = 38
|
||||
Height = 22
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2C2C2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2C2C2C2C2C2C2E2E2E2E2E222C
|
||||
0A222E2E2E2E2C2C2C2C2C2C2C2C2E2E2E2E222C0A222E2E2E2C2C2C2C2C2C2C
|
||||
2C2C2C2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C
|
||||
0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object btnTopRight: TSpeedButton
|
||||
Left = 70
|
||||
Height = 22
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2E2C2C2C2C2C2C2C2E2E222C0A222E2E2E2E2E2E2E2E2C2C2C2C2C2C2E2E222C
|
||||
0A222E2E2E2E2E2E2E2E2E2C2C2C2C2C2E2E222C0A222E2E2E2E2E2E2E2E2C2C
|
||||
2C2C2C2C2E2E222C0A222E2E2E2E2E2E2E2C2C2C2C2C2C2C2E2E222C0A222E2E
|
||||
2E2E2E2E2C2C2C2C2C2E2C2C2E2E222C0A222E2E2E2E2E2C2C2C2C2C2E2E2E2C
|
||||
2E2E222C0A222E2E2E2E2C2C2C2C2C2E2E2E2E2E2E2E222C0A222E2E2E2C2C2C
|
||||
2C2C2E2E2E2E2E2E2E2E222C0A222E2E2C2C2C2C2C2E2E2E2E2E2E2E2E2E222C
|
||||
0A222E2E2E2C2C2C2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2C2E2E2E2E2E
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object btnRight: TSpeedButton
|
||||
Left = 70
|
||||
Height = 22
|
||||
Top = 32
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2C2E2E2E2E2E222C
|
||||
0A222E2E2E2E2E2E2E2E2E2E2C2C2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E
|
||||
2C2C2C2E2E2E222C0A222E2E2C2C2C2C2C2C2C2C2C2C2C2C2E2E222C0A222E2E
|
||||
2C2C2C2C2C2C2C2C2C2C2C2C2C2E222C0A222E2E2C2C2C2C2C2C2C2C2C2C2C2C
|
||||
2C2E222C0A222E2E2C2C2C2C2C2C2C2C2C2C2C2C2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2E2E2C2C2C2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2C2C2E2E2E2E222C
|
||||
0A222E2E2E2E2E2E2E2E2E2E2C2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object btnBottomRight: TSpeedButton
|
||||
Left = 70
|
||||
Height = 22
|
||||
Top = 64
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2C2E
|
||||
2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2C2C2C2E2E2E2E2E2E2E2E2E2E222C
|
||||
0A222E2E2C2C2C2C2C2E2E2E2E2E2E2E2E2E222C0A222E2E2E2C2C2C2C2C2E2E
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2C2C2C2C2C2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2C2C2C2C2C2E2E2E2C2E2E222C0A222E2E2E2E2E2E2C2C2C2C2C2E2C2C
|
||||
2E2E222C0A222E2E2E2E2E2E2E2C2C2C2C2C2C2C2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2C2C2C2C2C2C2E2E222C0A222E2E2E2E2E2E2E2E2E2C2C2C2C2C2E2E222C
|
||||
0A222E2E2E2E2E2E2E2E2C2C2C2C2C2C2E2E222C0A222E2E2E2E2E2E2E2C2C2C
|
||||
2C2C2C2C2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object btnBottom: TSpeedButton
|
||||
Left = 38
|
||||
Height = 22
|
||||
Top = 64
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C
|
||||
0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2C2C2C2C2E2E2E2E2E2E222C0A222E2E2E2C2C2C
|
||||
2C2C2C2C2C2C2C2E2E2E222C0A222E2E2E2E2C2C2C2C2C2C2C2C2E2E2E2E222C
|
||||
0A222E2E2E2E2E2C2C2C2C2C2C2E2E2E2E2E222C0A222E2E2E2E2E2E2C2C2C2C
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2C2C2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object btnBottomLeft: TSpeedButton
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 64
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2E2E2E2C2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2C2C2C2E2E2E222C
|
||||
0A222E2E2E2E2E2E2E2E2E2C2C2C2C2C2E2E222C0A222E2E2E2E2E2E2E2E2C2C
|
||||
2C2C2C2E2E2E222C0A222E2E2E2E2E2E2E2C2C2C2C2C2E2E2E2E222C0A222E2E
|
||||
2C2E2E2E2C2C2C2C2C2E2E2E2E2E222C0A222E2E2C2C2E2C2C2C2C2C2E2E2E2E
|
||||
2E2E222C0A222E2E2C2C2C2C2C2C2C2E2E2E2E2E2E2E222C0A222E2E2C2C2C2C
|
||||
2C2C2E2E2E2E2E2E2E2E222C0A222E2E2C2C2C2C2C2E2E2E2E2E2E2E2E2E222C
|
||||
0A222E2E2C2C2C2C2C2C2E2E2E2E2E2E2E2E222C0A222E2E2C2C2C2C2C2C2C2E
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object btnLeft: TSpeedButton
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 32
|
||||
Width = 23
|
||||
Color = clBtnFace
|
||||
Glyph.Data = {
|
||||
8D0100002F2A2058504D202A2F0A7374617469632063686172202A6772617068
|
||||
69635B5D203D207B0A22313620313620322031222C0A222E2063204E6F6E6522
|
||||
2C0A222C20632023343034303430222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E
|
||||
2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E
|
||||
2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2C2E2E2E2E2E2E2E2E2E2E222C
|
||||
0A222E2E2E2E2C2C2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2C2C2C2E2E2E2E
|
||||
2E2E2E2E2E2E222C0A222E2E2C2C2C2C2C2C2C2C2C2C2C2C2E2E222C0A222E2C
|
||||
2C2C2C2C2C2C2C2C2C2C2C2C2E2E222C0A222E2C2C2C2C2C2C2C2C2C2C2C2C2C
|
||||
2E2E222C0A222E2E2C2C2C2C2C2C2C2C2C2C2C2C2E2E222C0A222E2E2E2C2C2C
|
||||
2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2C2C2E2E2E2E2E2E2E2E2E2E222C
|
||||
0A222E2E2E2E2E2C2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E
|
||||
2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E
|
||||
2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D0A
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnTopLeftClick
|
||||
end
|
||||
object seOffset: TSpinEdit
|
||||
Left = 33
|
||||
Height = 23
|
||||
Hint = 'Offset'
|
||||
Top = 32
|
||||
Width = 34
|
||||
MaxValue = 8
|
||||
MinValue = 1
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 0
|
||||
Value = 1
|
||||
end
|
||||
end
|
||||
object btnCancel: TButton
|
||||
Left = 128
|
||||
Height = 25
|
||||
Top = 88
|
||||
Width = 89
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Cancel = True
|
||||
Caption = 'Cancel'
|
||||
ModalResult = 2
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
152
Client/Tools/UfrmMoveSettings.pas
Normal file
152
Client/Tools/UfrmMoveSettings.pas
Normal file
@@ -0,0 +1,152 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmMoveSettings;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Buttons, Spin, LMessages, LCLIntf, math;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmMoveSettings }
|
||||
|
||||
TfrmMoveSettings = class(TForm)
|
||||
btnCancel: TButton;
|
||||
cbAsk: TCheckBox;
|
||||
gbDirection: TGroupBox;
|
||||
btnTopLeft: TSpeedButton;
|
||||
btnTop: TSpeedButton;
|
||||
btnTopRight: TSpeedButton;
|
||||
btnRight: TSpeedButton;
|
||||
btnBottomRight: TSpeedButton;
|
||||
btnBottom: TSpeedButton;
|
||||
btnBottomLeft: TSpeedButton;
|
||||
btnLeft: TSpeedButton;
|
||||
seOffset: TSpinEdit;
|
||||
procedure btnTopLeftClick(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
protected
|
||||
procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
|
||||
public
|
||||
function GetOffsetX: Integer;
|
||||
function GetOffsetY: Integer;
|
||||
end;
|
||||
|
||||
var
|
||||
frmMoveSettings: TfrmMoveSettings;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
UdmNetwork, UfrmMain, UEnums;
|
||||
|
||||
{ TfrmMoveSettings }
|
||||
|
||||
procedure TfrmMoveSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction := caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmMoveSettings.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
if not (fsModal in FormState) then
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmMoveSettings.FormShow(Sender: TObject);
|
||||
begin
|
||||
btnCancel.Visible := (fsModal in FormState);
|
||||
if dmNetwork.AccessLevel = alAdministrator then
|
||||
seOffset.MaxValue := Max(frmMain.Landscape.CellWidth, frmMain.Landscape.CellHeight);
|
||||
end;
|
||||
|
||||
procedure TfrmMoveSettings.MouseLeave(var msg: TLMessage);
|
||||
begin
|
||||
if Visible and (not (fsModal in FormState)) and
|
||||
(not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos))) then
|
||||
Close;
|
||||
end;
|
||||
|
||||
function TfrmMoveSettings.GetOffsetX: Integer;
|
||||
begin
|
||||
if btnTopLeft.Down then
|
||||
Result := -seOffset.Value
|
||||
else if btnTop.Down then
|
||||
Result := -seOffset.Value
|
||||
else if btnTopRight.Down then
|
||||
Result := 0
|
||||
else if btnRight.Down then
|
||||
Result := seOffset.Value
|
||||
else if btnBottomRight.Down then
|
||||
Result := seOffset.Value
|
||||
else if btnBottom.Down then
|
||||
Result := seOffset.Value
|
||||
else if btnBottomLeft.Down then
|
||||
Result := 0
|
||||
else if btnLeft.Down then
|
||||
Result := -seOffset.Value
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TfrmMoveSettings.GetOffsetY: Integer;
|
||||
begin
|
||||
if btnTopLeft.Down then
|
||||
Result := 0
|
||||
else if btnTop.Down then
|
||||
Result := -seOffset.Value
|
||||
else if btnTopRight.Down then
|
||||
Result := -seOffset.Value
|
||||
else if btnRight.Down then
|
||||
Result := -seOffset.Value
|
||||
else if btnBottomRight.Down then
|
||||
Result := 0
|
||||
else if btnBottom.Down then
|
||||
Result := seOffset.Value
|
||||
else if btnBottomLeft.Down then
|
||||
Result := seOffset.Value
|
||||
else if btnLeft.Down then
|
||||
Result := seOffset.Value
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
procedure TfrmMoveSettings.btnTopLeftClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult := mrYes;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I UfrmMoveSettings.lrs}
|
||||
|
||||
end.
|
||||
|
||||
46
Client/Tools/UfrmVirtualLayer.lfm
Normal file
46
Client/Tools/UfrmVirtualLayer.lfm
Normal file
@@ -0,0 +1,46 @@
|
||||
object frmVirtualLayer: TfrmVirtualLayer
|
||||
Left = 290
|
||||
Height = 73
|
||||
Top = 171
|
||||
Width = 178
|
||||
HorzScrollBar.Page = 177
|
||||
VertScrollBar.Page = 72
|
||||
BorderIcons = []
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Virtual Layer'
|
||||
ClientHeight = 73
|
||||
ClientWidth = 178
|
||||
OnClose = FormClose
|
||||
OnDeactivate = FormDeactivate
|
||||
object seZ: TSpinEdit
|
||||
Left = 120
|
||||
Height = 23
|
||||
Top = 8
|
||||
Width = 50
|
||||
MaxValue = 127
|
||||
MinValue = -128
|
||||
OnChange = seZChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object cbShowLayer: TCheckBox
|
||||
Left = 11
|
||||
Height = 15
|
||||
Top = 12
|
||||
Width = 103
|
||||
Caption = 'Show Layer at Z:'
|
||||
TabOrder = 1
|
||||
end
|
||||
object tbZ: TTrackBar
|
||||
Left = 8
|
||||
Height = 33
|
||||
Top = 32
|
||||
Width = 162
|
||||
Frequency = 10
|
||||
Max = 127
|
||||
Min = -128
|
||||
OnChange = tbZChange
|
||||
PageSize = 1
|
||||
ScalePos = trTop
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
92
Client/Tools/UfrmVirtualLayer.pas
Normal file
92
Client/Tools/UfrmVirtualLayer.pas
Normal file
@@ -0,0 +1,92 @@
|
||||
(*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* http://www.opensource.org/licenses/cddl1.php.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at
|
||||
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
||||
* add the following below this CDDL HEADER, with the fields enclosed
|
||||
* by brackets "[]" replaced with your own identifying * information:
|
||||
* Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*
|
||||
*
|
||||
* Portions Copyright 2007 Andreas Schneider
|
||||
*)
|
||||
unit UfrmVirtualLayer;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, LCLIntf,
|
||||
LMessages, StdCtrls, Spin, ComCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmVirtualLayer }
|
||||
|
||||
TfrmVirtualLayer = class(TForm)
|
||||
cbShowLayer: TCheckBox;
|
||||
seZ: TSpinEdit;
|
||||
tbZ: TTrackBar;
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure seZChange(Sender: TObject);
|
||||
procedure tbZChange(Sender: TObject);
|
||||
protected
|
||||
procedure MouseLeave(var msg: TLMessage); message CM_MouseLeave;
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmVirtualLayer: TfrmVirtualLayer;
|
||||
|
||||
implementation
|
||||
|
||||
{ TfrmVirtualLayer }
|
||||
|
||||
procedure TfrmVirtualLayer.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction := caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmVirtualLayer.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmVirtualLayer.seZChange(Sender: TObject);
|
||||
begin
|
||||
tbZ.Position := seZ.Value;
|
||||
end;
|
||||
|
||||
procedure TfrmVirtualLayer.tbZChange(Sender: TObject);
|
||||
begin
|
||||
seZ.Value := tbZ.Position;
|
||||
end;
|
||||
|
||||
procedure TfrmVirtualLayer.MouseLeave(var msg: TLMessage);
|
||||
begin
|
||||
if not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
|
||||
Close;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I UfrmVirtualLayer.lrs}
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user