- Realigned frmRegionControl

- Added coordinate grabbing to TfrmRegionControl
- Added hints to the grab buttons in frmLargeScaleCommand
This commit is contained in:
Andreas Schneider 2009-12-19 14:39:14 +01:00
parent 387d5fb28d
commit a9f278ae21
3 changed files with 1348 additions and 1193 deletions

View File

@ -1084,7 +1084,7 @@ object frmLargeScaleCommand: TfrmLargeScaleCommand
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnDeleteArea
Left = 4
Height = 118
Height = 122
Top = 154
Width = 144
Anchors = [akTop, akLeft, akRight, akBottom]
@ -1209,10 +1209,8 @@ object frmLargeScaleCommand: TfrmLargeScaleCommand
Top = 280
Width = 22
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 4
BorderSpacing.Top = 8
BorderSpacing.Right = 4
BorderSpacing.Bottom = 8
BorderSpacing.Bottom = 4
BorderSpacing.Around = 4
Color = clBtnFace
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
@ -1394,6 +1392,7 @@ object frmLargeScaleCommand: TfrmLargeScaleCommand
AnchorSideBottom.Side = asrBottom
Left = 34
Height = 22
Hint = 'Grab coordinates from the main window.'
Top = 360
Width = 22
Anchors = [akLeft, akBottom]
@ -1438,6 +1437,8 @@ object frmLargeScaleCommand: TfrmLargeScaleCommand
}
NumGlyphs = 0
OnClick = btnGrab1Click
ShowHint = True
ParentShowHint = False
end
object btnGrab2: TSpeedButton
AnchorSideLeft.Control = seY2
@ -1446,6 +1447,7 @@ object frmLargeScaleCommand: TfrmLargeScaleCommand
AnchorSideBottom.Side = asrBottom
Left = 92
Height = 22
Hint = 'Grab coordinates from the main window.'
Top = 360
Width = 22
Anchors = [akLeft, akBottom]
@ -1489,5 +1491,7 @@ object frmLargeScaleCommand: TfrmLargeScaleCommand
}
NumGlyphs = 0
OnClick = btnGrab1Click
ShowHint = True
ParentShowHint = False
end
end

View File

@ -3,7 +3,7 @@ object frmRegionControl: TfrmRegionControl
Height = 413
Top = 139
Width = 620
ActiveControl = Panel1
ActiveControl = vstRegions
Caption = 'Region Control'
ClientHeight = 413
ClientWidth = 620
@ -14,62 +14,266 @@ object frmRegionControl: TfrmRegionControl
OnShow = FormShow
Position = poOwnerFormCenter
ShowInTaskBar = stAlways
LCLVersion = '0.9.27'
object Panel1: TPanel
LCLVersion = '0.9.29'
object sbArea: TScrollBox
AnchorSideLeft.Control = vstRegions
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnClose
Left = 160
Height = 372
Top = 0
Width = 460
Anchors = [akTop, akLeft, akRight, akBottom]
ClientHeight = 368
ClientWidth = 456
TabOrder = 0
object pbArea: TPaintBox
Left = 0
Height = 380
Height = 105
Top = 0
Width = 105
OnMouseDown = pbAreaMouseDown
OnMouseMove = pbAreaMouseMove
OnPaint = pbAreaPaint
end
end
object btnClose: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 548
Height = 25
Top = 380
Width = 64
Anchors = [akRight, akBottom]
BorderSpacing.Around = 8
Caption = 'Close'
OnClick = btnCloseClick
TabOrder = 1
end
object btnSave: TButton
AnchorSideRight.Control = btnClose
AnchorSideBottom.Control = btnClose
AnchorSideBottom.Side = asrBottom
Left = 476
Height = 25
Top = 380
Width = 64
Anchors = [akRight, akBottom]
BorderSpacing.Right = 4
Caption = 'Save'
Enabled = False
OnClick = btnSaveClick
TabOrder = 2
end
object vstRegions: TVirtualStringTree
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideBottom.Control = btnAddRegion
Left = 0
Height = 130
Top = 0
Width = 160
Align = alLeft
ClientHeight = 380
ClientWidth = 160
TabOrder = 0
Anchors = [akTop, akLeft, akBottom]
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
item
Position = 0
Text = 'Regions'
Width = 160
end>
Header.DefaultHeight = 17
Header.Options = [hoAutoResize, hoVisible]
Header.ParentFont = True
Header.Style = hsFlatButtons
PopupMenu = pmRegions
TabOrder = 3
TreeOptions.MiscOptions = [toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnChange = vstRegionsChange
OnFreeNode = vstRegionsFreeNode
OnGetText = vstRegionsGetText
end
object btnAddRegion: TSpeedButton
AnchorSideLeft.Control = vstRegions
AnchorSideBottom.Control = spRegionsArea
Left = 4
Height = 22
Hint = 'Add region'
Top = 134
Width = 22
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 4
Color = clBtnFace
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000003A8C44FF368940FF32873CFF2F84
37FF000000000000000000000000000000000000000000000000000000000000
00000000000000000000459653FF419950FF7DC28FFF96D0A6FF96CFA6FF78BE
89FF368D42FF2C8134FF00000000000000000000000000000000000000000000
0000000000004D9C5DFF64B478FFA8DBB5FF87CC98FF66BC7DFF64BA7CFF86CB
98FFA5D9B4FF58AA6BFF2C8134FF000000000000000000000000000000000000
000056A366FF6AB97DFFA8DBB2FF60BC77FF5CBA73FF59B870FF59B56FFF58B5
6FFF5BB774FFA5D9B3FF5AAA6CFF2C8234FF0000000000000000000000000000
000053AB68FFAADDB4FF64C179FF5FBE71FF60BC77FFFFFFFFFFFFFFFFFF59B8
70FF58B56EFF5CB774FFA6DAB4FF388F43FF00000000000000000000000061AC
75FF8ACC98FF89D396FF6BC67AFF63C170FF55AB65FFFFFFFFFFFFFFFFFF59B8
70FF59B870FF5BB972FF85CC97FF7BBE8DFF308539FF000000000000000065AF
7AFFA9DDB3FF7DCF8AFF75CC81FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF59B870FF67BE7DFF9CD4ABFF34883DFF000000000000000069B2
7EFFB6E2BEFF8BD597FF7AC986FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF59B870FF69C17EFF9DD4AAFF388B42FF00000000000000006DB5
83FFACDDB6FFA6DFAFFF81CB8CFF7CC986FF6EBD79FFFFFFFFFFFFFFFFFF5BAC
6AFF60BC77FF5CBA73FF8BD199FF80C592FF3C8E47FF00000000000000000000
000085C797FFD2EED7FF95D9A0FF8AD394FF7FC889FFFFFFFFFFFFFFFFFF79CD
85FF6BC37CFF6FC77EFFACDFB5FF459E57FF0000000000000000000000000000
000070B887FFAADAB7FFD8F1DCFF92D89DFF88CD93FF84CC8EFF8BD496FF8AD4
95FF83D28EFFAFE0B7FF6BB97DFF489856FF0000000000000000000000000000
00000000000070B887FFAFDCBBFFDCF2E0FFB6E4BDFF9BDBA5FF96D9A0FFA5DF
AFFFC0E8C5FF79C28AFF509E5FFF000000000000000000000000000000000000
0000000000000000000071B887FF94CEA4FFC3E6CBFFCFEBD4FFC9E9CEFFAFDD
B8FF6DB97FFF58A569FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000006EB684FF6AB380FF67B17CFF63AE
77FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
NumGlyphs = 0
OnClick = mnuAddRegionClick
ShowHint = True
ParentShowHint = False
end
object btnDeleteRegion: TSpeedButton
AnchorSideLeft.Control = btnAddRegion
AnchorSideLeft.Side = asrBottom
AnchorSideBottom.Control = btnAddRegion
AnchorSideBottom.Side = asrBottom
Left = 30
Height = 22
Hint = 'Delete region'
Top = 134
Width = 22
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 4
Color = clBtnFace
Enabled = False
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000003853BEFF3551BDFF304BBCFF2E4E
B8FF000000000000000000000000000000000000000000000000000000000000
000000000000000000004255C6FF3C52CCFF757AE8FF8F92EEFF8F92EEFF7178
E4FF334DC1FF2B4AB7FF00000000000000000000000000000000000000000000
0000000000004959CBFF5C65E0FFA1A6F5FF7E86EFFF5B63E9FF595DE7FF7D84
EEFF9EA0F4FF515DD7FF2B4AB7FF000000000000000000000000000000000000
00005361CFFF616BE3FFA1ACF5FF545FECFF505CEAFF4D59E9FF4E59E6FF4C56
E6FF5056E6FF9EA2F4FF5460D6FF2A4AB8FF0000000000000000000000000000
00004B56DBFFA2ABF6FF5664F0FF5266EEFF4D59E9FF4D59E9FF4D59E9FF4D59
E9FF4C58E6FF525AE6FF9FA3F5FF3450C4FF0000000000000000000000005C62
D7FF818CEEFF7E91F7FF5D73F3FF4D59E9FF4D59E9FF4D59E9FF4D59E9FF4D59
E9FF4D59E9FF4F5BE9FF7B83F0FF757BE2FF2E4BBAFF00000000000000005F63
DAFFA1ABF7FF7086F8FF6882F6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF4D59E9FF5C66EAFF969CF1FF3250BCFF00000000000000006469
DBFFAFB9F9FF7F93FAFF7085F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF4D59E9FF5E6AEEFF969DF1FF364FBEFF0000000000000000676A
DEFFA5AFF5FF9DABFAFF778CF0FF545FECFF545FECFF545FECFF545FECFF545F
ECFF545FECFF6377F2FF818EF4FF787FE9FF3A53C0FF00000000000000000000
00007D83EAFFCDD4FCFF8B9DFAFF7E93F7FF758AEEFF6C84F6FF6C84F6FF6C84
F6FF6C84F6FF6379F3FFA4AFF8FF3E4FD0FF0000000000000000000000000000
00006A69E0FFA3A7F3FFD4DBFDFF879AFAFF7F91F0FF7A8EF1FF7F94F8FF7E92
F9FF768CF8FFA8B6F8FF636EE3FF4557C7FF0000000000000000000000000000
0000000000006A69E0FFAAADF2FFD8DCFDFFAEBAFAFF91A3FAFF8B9DFAFF9CA9
FBFFBAC7FCFF707BE9FF4C5BCCFF000000000000000000000000000000000000
000000000000000000006A6ADFFF8E93EDFFBEC3F8FFCCD3F9FFC4CBF9FFAAB4
F4FF6670E2FF535ED1FF00000000000000000000000000000000000000000000
000000000000000000000000000000000000686ADDFF6364DCFF6164DAFF5D63
D9FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
NumGlyphs = 0
OnClick = mnuDeleteRegionClick
ShowHint = True
ParentShowHint = False
end
object vstArea: TVirtualStringTree
AnchorSideLeft.Control = spRegionsArea
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = spRegionsArea
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnDeleteArea
Left = 4
Height = 124
Top = 179
Width = 152
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 4
BorderSpacing.Right = 4
BorderSpacing.Bottom = 4
BorderStyle = bsSingle
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <>
Header.DefaultHeight = 17
Header.MainColumn = -1
Header.Options = [hoColumnResize, hoDrag]
TabOrder = 4
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnChange = vstAreaChange
OnGetText = vstAreaGetText
end
object Label1: TLabel
Left = 5
AnchorSideLeft.Control = spRegionsArea
AnchorSideTop.Control = spRegionsArea
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = spRegionsArea
AnchorSideRight.Side = asrBottom
Left = 4
Height = 14
Top = 176
Width = 150
Align = alTop
Top = 165
Width = 152
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 4
BorderSpacing.Right = 4
Caption = 'Area:'
ParentColor = False
end
object pnlAreaControls: TPanel
Left = 5
Height = 82
Top = 293
Width = 150
Align = alBottom
BorderSpacing.Around = 4
BevelOuter = bvNone
ClientHeight = 82
ClientWidth = 150
TabOrder = 0
object lblX: TLabel
Left = 4
Height = 14
Top = 32
Width = 8
Caption = 'X'
Enabled = False
ParentColor = False
end
object lblY: TLabel
Left = 4
Height = 14
Top = 60
Width = 8
Caption = 'Y'
Enabled = False
ParentColor = False
object spRegionsArea: TSplitter
AnchorSideLeft.Control = vstRegions
AnchorSideRight.Control = vstRegions
AnchorSideRight.Side = asrBottom
Cursor = crVSplit
Left = 0
Height = 5
Top = 160
Width = 160
Align = alNone
Anchors = [akTop, akLeft, akRight]
AutoSnap = False
ResizeAnchor = akTop
end
object btnAddArea: TSpeedButton
Left = 30
AnchorSideTop.Control = btnDeleteArea
AnchorSideRight.Control = btnDeleteArea
Left = 43
Height = 22
Hint = 'Add area'
Top = 0
Width = 23
Top = 307
Width = 22
Anchors = [akTop, akRight]
Color = clBtnFace
Enabled = False
Glyph.Data = {
@ -114,11 +318,17 @@ object frmRegionControl: TfrmRegionControl
ParentShowHint = False
end
object btnDeleteArea: TSpeedButton
Left = 59
AnchorSideLeft.Control = vstArea
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = seX1
Left = 69
Height = 22
Hint = 'Delete area'
Top = 0
Width = 23
Top = 307
Width = 22
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 4
BorderSpacing.Around = 4
Color = clBtnFace
Enabled = False
Glyph.Data = {
@ -163,11 +373,14 @@ object frmRegionControl: TfrmRegionControl
ParentShowHint = False
end
object btnClearArea: TSpeedButton
Left = 87
AnchorSideLeft.Control = btnDeleteArea
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnDeleteArea
Left = 95
Height = 22
Hint = 'Delete all areas'
Top = 0
Width = 23
Top = 307
Width = 22
Color = clBtnFace
Enabled = False
Glyph.Data = {
@ -211,289 +424,201 @@ object frmRegionControl: TfrmRegionControl
ShowHint = True
ParentShowHint = False
end
object lblX: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = seX1
AnchorSideTop.Side = asrCenter
Left = 4
Height = 14
Top = 339
Width = 8
BorderSpacing.Left = 4
Caption = 'X'
Enabled = False
ParentColor = False
end
object seX1: TSpinEdit
AnchorSideLeft.Control = seY1
AnchorSideBottom.Control = seY1
Left = 20
Height = 19
Top = 29
Top = 337
Width = 50
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 8
Enabled = False
OnChange = seX1Change
TabOrder = 0
TabOrder = 6
Value = 1
end
object seX2: TSpinEdit
Left = 84
AnchorSideLeft.Control = seX1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seX1
Left = 78
Height = 19
Top = 29
Top = 337
Width = 50
BorderSpacing.Left = 8
Enabled = False
OnChange = seX1Change
TabOrder = 1
TabOrder = 7
Value = 1
end
object lblY: TLabel
AnchorSideLeft.Control = lblX
AnchorSideTop.Control = seY1
AnchorSideTop.Side = asrCenter
Left = 4
Height = 14
Top = 366
Width = 8
Caption = 'Y'
Enabled = False
ParentColor = False
end
object seY1: TSpinEdit
AnchorSideLeft.Control = lblY
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = seX1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnGrab1
Left = 20
Height = 19
Top = 56
Top = 364
Width = 50
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
Enabled = False
OnChange = seX1Change
TabOrder = 2
TabOrder = 8
Value = 1
end
object seY2: TSpinEdit
Left = 84
AnchorSideLeft.Control = seX2
AnchorSideTop.Control = seX2
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = seX2
AnchorSideRight.Side = asrBottom
Left = 78
Height = 19
Top = 56
Top = 364
Width = 50
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 8
Enabled = False
OnChange = seX1Change
TabOrder = 3
TabOrder = 9
Value = 1
end
end
object vstArea: TVirtualStringTree
Left = 5
Height = 99
Top = 190
Width = 150
Align = alClient
BorderSpacing.Left = 4
BorderSpacing.Right = 4
BorderSpacing.Bottom = 4
BorderStyle = bsSingle
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <>
Header.DefaultHeight = 17
Header.MainColumn = -1
Header.Options = [hoColumnResize, hoDrag]
TabOrder = 1
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnChange = vstAreaChange
OnGetText = vstAreaGetText
end
object spRegionsArea: TSplitter
Cursor = crVSplit
Left = 1
Height = 5
Top = 171
Width = 158
Align = alTop
AutoSnap = False
ResizeAnchor = akTop
end
object Panel4: TPanel
Left = 1
Height = 170
Top = 1
Width = 158
Align = alTop
Anchors = [akLeft, akRight]
BevelOuter = bvNone
ClientHeight = 170
ClientWidth = 158
TabOrder = 3
object vstRegions: TVirtualStringTree
Left = 0
Height = 144
Top = 0
Width = 158
Align = alClient
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
item
Position = 0
Text = 'Regions'
Width = 158
end>
Header.DefaultHeight = 17
Header.Options = [hoAutoResize, hoVisible]
Header.ParentFont = True
Header.Style = hsFlatButtons
PopupMenu = pmRegions
TabOrder = 0
TreeOptions.MiscOptions = [toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnChange = vstRegionsChange
OnFreeNode = vstRegionsFreeNode
OnGetText = vstRegionsGetText
end
object Panel5: TPanel
Left = 0
Height = 26
Top = 144
Width = 158
Align = alBottom
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 158
TabOrder = 1
object btnAddRegion: TSpeedButton
Left = 54
object btnGrab1: TSpeedButton
AnchorSideLeft.Control = seY1
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 34
Height = 22
Hint = 'Add region'
Top = 3
Width = 23
Color = clBtnFace
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000003A8C44FF368940FF32873CFF2F84
37FF000000000000000000000000000000000000000000000000000000000000
00000000000000000000459653FF419950FF7DC28FFF96D0A6FF96CFA6FF78BE
89FF368D42FF2C8134FF00000000000000000000000000000000000000000000
0000000000004D9C5DFF64B478FFA8DBB5FF87CC98FF66BC7DFF64BA7CFF86CB
98FFA5D9B4FF58AA6BFF2C8134FF000000000000000000000000000000000000
000056A366FF6AB97DFFA8DBB2FF60BC77FF5CBA73FF59B870FF59B56FFF58B5
6FFF5BB774FFA5D9B3FF5AAA6CFF2C8234FF0000000000000000000000000000
000053AB68FFAADDB4FF64C179FF5FBE71FF60BC77FFFFFFFFFFFFFFFFFF59B8
70FF58B56EFF5CB774FFA6DAB4FF388F43FF00000000000000000000000061AC
75FF8ACC98FF89D396FF6BC67AFF63C170FF55AB65FFFFFFFFFFFFFFFFFF59B8
70FF59B870FF5BB972FF85CC97FF7BBE8DFF308539FF000000000000000065AF
7AFFA9DDB3FF7DCF8AFF75CC81FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF59B870FF67BE7DFF9CD4ABFF34883DFF000000000000000069B2
7EFFB6E2BEFF8BD597FF7AC986FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF59B870FF69C17EFF9DD4AAFF388B42FF00000000000000006DB5
83FFACDDB6FFA6DFAFFF81CB8CFF7CC986FF6EBD79FFFFFFFFFFFFFFFFFF5BAC
6AFF60BC77FF5CBA73FF8BD199FF80C592FF3C8E47FF00000000000000000000
000085C797FFD2EED7FF95D9A0FF8AD394FF7FC889FFFFFFFFFFFFFFFFFF79CD
85FF6BC37CFF6FC77EFFACDFB5FF459E57FF0000000000000000000000000000
000070B887FFAADAB7FFD8F1DCFF92D89DFF88CD93FF84CC8EFF8BD496FF8AD4
95FF83D28EFFAFE0B7FF6BB97DFF489856FF0000000000000000000000000000
00000000000070B887FFAFDCBBFFDCF2E0FFB6E4BDFF9BDBA5FF96D9A0FFA5DF
AFFFC0E8C5FF79C28AFF509E5FFF000000000000000000000000000000000000
0000000000000000000071B887FF94CEA4FFC3E6CBFFCFEBD4FFC9E9CEFFAFDD
B8FF6DB97FFF58A569FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000006EB684FF6AB380FF67B17CFF63AE
77FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
NumGlyphs = 0
OnClick = mnuAddRegionClick
ShowHint = True
ParentShowHint = False
end
object btnDeleteRegion: TSpeedButton
Left = 82
Height = 22
Hint = 'Delete region'
Top = 3
Width = 23
Color = clBtnFace
Enabled = False
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000003853BEFF3551BDFF304BBCFF2E4E
B8FF000000000000000000000000000000000000000000000000000000000000
000000000000000000004255C6FF3C52CCFF757AE8FF8F92EEFF8F92EEFF7178
E4FF334DC1FF2B4AB7FF00000000000000000000000000000000000000000000
0000000000004959CBFF5C65E0FFA1A6F5FF7E86EFFF5B63E9FF595DE7FF7D84
EEFF9EA0F4FF515DD7FF2B4AB7FF000000000000000000000000000000000000
00005361CFFF616BE3FFA1ACF5FF545FECFF505CEAFF4D59E9FF4E59E6FF4C56
E6FF5056E6FF9EA2F4FF5460D6FF2A4AB8FF0000000000000000000000000000
00004B56DBFFA2ABF6FF5664F0FF5266EEFF4D59E9FF4D59E9FF4D59E9FF4D59
E9FF4C58E6FF525AE6FF9FA3F5FF3450C4FF0000000000000000000000005C62
D7FF818CEEFF7E91F7FF5D73F3FF4D59E9FF4D59E9FF4D59E9FF4D59E9FF4D59
E9FF4D59E9FF4F5BE9FF7B83F0FF757BE2FF2E4BBAFF00000000000000005F63
DAFFA1ABF7FF7086F8FF6882F6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF4D59E9FF5C66EAFF969CF1FF3250BCFF00000000000000006469
DBFFAFB9F9FF7F93FAFF7085F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF4D59E9FF5E6AEEFF969DF1FF364FBEFF0000000000000000676A
DEFFA5AFF5FF9DABFAFF778CF0FF545FECFF545FECFF545FECFF545FECFF545F
ECFF545FECFF6377F2FF818EF4FF787FE9FF3A53C0FF00000000000000000000
00007D83EAFFCDD4FCFF8B9DFAFF7E93F7FF758AEEFF6C84F6FF6C84F6FF6C84
F6FF6C84F6FF6379F3FFA4AFF8FF3E4FD0FF0000000000000000000000000000
00006A69E0FFA3A7F3FFD4DBFDFF879AFAFF7F91F0FF7A8EF1FF7F94F8FF7E92
F9FF768CF8FFA8B6F8FF636EE3FF4557C7FF0000000000000000000000000000
0000000000006A69E0FFAAADF2FFD8DCFDFFAEBAFAFF91A3FAFF8B9DFAFF9CA9
FBFFBAC7FCFF707BE9FF4C5BCCFF000000000000000000000000000000000000
000000000000000000006A6ADFFF8E93EDFFBEC3F8FFCCD3F9FFC4CBF9FFAAB4
F4FF6670E2FF535ED1FF00000000000000000000000000000000000000000000
000000000000000000000000000000000000686ADDFF6364DCFF6164DAFF5D63
D9FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
NumGlyphs = 0
OnClick = mnuDeleteRegionClick
ShowHint = True
ParentShowHint = False
end
end
end
end
object Panel2: TPanel
Left = 160
Height = 380
Top = 0
Width = 460
Align = alClient
Caption = 'Panel2'
ClientHeight = 380
ClientWidth = 460
TabOrder = 1
object sbArea: TScrollBox
Left = 1
Height = 378
Top = 1
Width = 458
Align = alClient
ClientHeight = 374
ClientWidth = 454
TabOrder = 0
object pbArea: TPaintBox
Left = 0
Height = 105
Top = 0
Width = 105
OnMouseDown = pbAreaMouseDown
OnMouseMove = pbAreaMouseMove
OnPaint = pbAreaPaint
end
end
end
object Panel3: TPanel
Left = 4
Height = 25
Top = 384
Width = 612
Align = alBottom
Hint = 'Grab coordinates from the main window.'
Top = 387
Width = 22
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 4
BevelOuter = bvNone
ClientHeight = 25
ClientWidth = 612
TabOrder = 2
object btnClose: TButton
Left = 548
Height = 25
Top = 0
Width = 64
Align = alRight
Anchors = [akTop, akRight]
BorderSpacing.Left = 4
Caption = 'Close'
OnClick = btnCloseClick
TabOrder = 0
end
object btnSave: TButton
Left = 480
Height = 25
Top = 0
Width = 64
Align = alRight
Anchors = [akTop, akRight]
BorderSpacing.Right = 4
Caption = 'Save'
Color = clBtnFace
Enabled = False
OnClick = btnSaveClick
TabOrder = 1
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF007F7F7F067C7C
7CE6787878CC75757581FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008383835DAAAA
AAFFDBDBDBFF797979F275757506FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF0097979709FFFFFF00FFFFFF00FFFFFF00888888E7DBDB
DBFFB7B7B7FF7D7D7D80FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF009C9C9CC99898981EFFFFFF0090909050ADADADFFF2F2
F2FF848484FD8181810FFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00A0A0A0FF9C9C9CE798989836949494DFD9D9D9FFC1C1
C1FF898989A0FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00A4A4A4FFD7D7D7FF9D9D9DF8D0D0D0FFEEEEEEFF9191
91FE8D8D8D18FFFFFF00FFFFFF00818181097E7E7E09FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00A9A9A9FFF2F2F2FFE5E5E5FFE2E2E2FFE3E3E3FF9595
95F4919191CC8D8D8DF9898989FF86868693FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00ADADADFFEEEEEEFFE1E1E1FFDFDFDFFFE0E0E0FFE7E7
E7FFE4E4E4FFBBBBBBFF8E8E8E93FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00B1B1B1FFF0F0F0FFE4E4E4FFE2E2E2FFE2E2E2FFE7E7
E7FFC1C1C1FF96969690FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00B5B5B5FFF2F2F2FFE8E8E8FFE7E7E7FFEAEAEAFFC6C6
C6FF9E9E9E8DFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00B9B9B9FFF4F4F4FFECECECFFEDEDEDFFCBCBCBFFA7A7
A78AFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00BDBDBDFFF7F7F7FFEFEFEFFFD0D0D0FFAFAFAF8AFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00C1C1C1FFF7F7F7FFD5D5D5FFB6B6B687FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00C4C4C4FFD9D9D9FFBEBEBE84FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00C8C8C8FFC5C5C581FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00CBCBCB7EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
NumGlyphs = 0
OnClick = btnGrab1Click
ShowHint = True
ParentShowHint = False
end
object btnGrab2: TSpeedButton
AnchorSideLeft.Control = seY2
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = btnGrab1
AnchorSideBottom.Side = asrBottom
Left = 92
Height = 22
Hint = 'Grab coordinates from the main window.'
Top = 387
Width = 22
Anchors = [akLeft, akBottom]
Color = clBtnFace
Enabled = False
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF007F7F7F067C7C
7CE6787878CC75757581FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008383835DAAAA
AAFFDBDBDBFF797979F275757506FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF0097979709FFFFFF00FFFFFF00FFFFFF00888888E7DBDB
DBFFB7B7B7FF7D7D7D80FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF009C9C9CC99898981EFFFFFF0090909050ADADADFFF2F2
F2FF848484FD8181810FFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00A0A0A0FF9C9C9CE798989836949494DFD9D9D9FFC1C1
C1FF898989A0FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00A4A4A4FFD7D7D7FF9D9D9DF8D0D0D0FFEEEEEEFF9191
91FE8D8D8D18FFFFFF00FFFFFF00818181097E7E7E09FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00A9A9A9FFF2F2F2FFE5E5E5FFE2E2E2FFE3E3E3FF9595
95F4919191CC8D8D8DF9898989FF86868693FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00ADADADFFEEEEEEFFE1E1E1FFDFDFDFFFE0E0E0FFE7E7
E7FFE4E4E4FFBBBBBBFF8E8E8E93FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00B1B1B1FFF0F0F0FFE4E4E4FFE2E2E2FFE2E2E2FFE7E7
E7FFC1C1C1FF96969690FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00B5B5B5FFF2F2F2FFE8E8E8FFE7E7E7FFEAEAEAFFC6C6
C6FF9E9E9E8DFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00B9B9B9FFF4F4F4FFECECECFFEDEDEDFFCBCBCBFFA7A7
A78AFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00BDBDBDFFF7F7F7FFEFEFEFFFD0D0D0FFAFAFAF8AFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00C1C1C1FFF7F7F7FFD5D5D5FFB6B6B687FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00C4C4C4FFD9D9D9FFBEBEBE84FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00C8C8C8FFC5C5C581FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00CBCBCB7EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
NumGlyphs = 0
OnClick = btnGrab1Click
ShowHint = True
ParentShowHint = False
end
object pmRegions: TPopupMenu
left = 48

View File

@ -21,7 +21,7 @@
* CDDL HEADER END
*
*
* Portions Copyright 2008 Andreas Schneider
* Portions Copyright 2009 Andreas Schneider
*)
unit UfrmRegionControl;
@ -32,7 +32,7 @@ interface
uses
Classes, SysUtils, math, LResources, Forms, Controls, Graphics, Dialogs,
VirtualTrees, ExtCtrls, ImagingComponents, StdCtrls, Buttons, Spin, LCLIntf,
UEnhancedMemoryStream, Menus, URectList, UEnums;
UEnhancedMemoryStream, Menus, URectList, UEnums, UWorldItem;
type
TAreaMoveType = (amLeft, amTop, amRight, amBottom);
@ -54,32 +54,28 @@ type
btnAddArea: TSpeedButton;
btnAddRegion: TSpeedButton;
btnClearArea: TSpeedButton;
btnDeleteArea: TSpeedButton;
btnClose: TButton;
btnDeleteArea: TSpeedButton;
btnDeleteRegion: TSpeedButton;
btnSave: TButton;
Label1: TLabel;
lblX: TLabel;
lblY: TLabel;
mnuAddRegion: TMenuItem;
mnuDeleteRegion: TMenuItem;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
pbArea: TPaintBox;
pnlAreaControls: TPanel;
pmRegions: TPopupMenu;
sbArea: TScrollBox;
seX1: TSpinEdit;
seX2: TSpinEdit;
seY1: TSpinEdit;
seY2: TSpinEdit;
btnGrab1: TSpeedButton;
btnGrab2: TSpeedButton;
spRegionsArea: TSplitter;
vstArea: TVirtualStringTree;
vstRegions: TVirtualStringTree;
procedure btnGrab1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure mnuAddRegionClick(Sender: TObject);
procedure mnuDeleteRegionClick(Sender: TObject);
@ -93,8 +89,8 @@ type
procedure FormShow(Sender: TObject);
procedure pbAreaMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pbAreaMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer
);
procedure pbAreaMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure pbAreaPaint(Sender: TObject);
procedure seX1Change(Sender: TObject);
procedure vstAreaChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
@ -112,12 +108,15 @@ type
FOnRegionModified: TRegionModifiedEvent;
FOnRegionDeleted: TRegionDeletedEvent;
FOnRegionList: TRegionListEvent;
FSelectFirst: Boolean;
FOldWindowState: TWindowState;
function FindRegion(AName: string): PVirtualNode;
procedure CheckUnsaved;
procedure OnModifyRegionPacket(ABuffer: TEnhancedMemoryStream);
procedure OnDeleteRegionPacket(ABuffer: TEnhancedMemoryStream);
procedure OnListRegionsPacket(ABuffer: TEnhancedMemoryStream);
procedure OnAccessChanged(AAccessLevel: TAccessLevel);
procedure TileSelected(AWorldItem: TWorldItem);
public
property OnRegionModified: TRegionModifiedEvent read FOnRegionModified write FOnRegionModified;
property OnRegionDeleted: TRegionDeletedEvent read FOnRegionDeleted write FOnRegionDeleted;
@ -221,9 +220,9 @@ end;
procedure TfrmRegionControl.FormDestroy(Sender: TObject);
begin
frmRadarMap.Dependencies.Remove(pbArea);
if AdminPacketHandlers[$08] <> nil then FreeAndNil(AdminPacketHandlers[$08]);
if AdminPacketHandlers[$09] <> nil then FreeAndNil(AdminPacketHandlers[$09]);
if AdminPacketHandlers[$0A] <> nil then FreeAndNil(AdminPacketHandlers[$0A]);
FreeAndNil(AdminPacketHandlers[$08]);
FreeAndNil(AdminPacketHandlers[$09]);
FreeAndNil(AdminPacketHandlers[$0A]);
end;
procedure TfrmRegionControl.FormShow(Sender: TObject);
@ -302,6 +301,15 @@ begin
CheckUnsaved;
end;
procedure TfrmRegionControl.btnGrab1Click(Sender: TObject);
begin
FSelectFirst := (Sender = btnGrab1);
frmMain.RegisterSelectionListener(@TileSelected);
FOldWindowState := WindowState;
WindowState := wsMinimized;
frmMain.SwitchToSelection;
end;
procedure TfrmRegionControl.mnuDeleteRegionClick(Sender: TObject);
var
regionNode: PVirtualNode;
@ -481,6 +489,8 @@ begin
seX2.Enabled := selected;
seY1.Enabled := selected;
seY2.Enabled := selected;
btnGrab1.Enabled := selected;
btnGrab2.Enabled := selected;
if selected then
begin
areaInfo := Sender.GetNodeData(Node);
@ -708,6 +718,22 @@ begin
dmNetwork.Send(TRequestRegionListPacket.Create);
end;
procedure TfrmRegionControl.TileSelected(AWorldItem: TWorldItem);
begin
if FSelectFirst then
begin
seX1.Value := AWorldItem.X;
seY1.Value := AWorldItem.Y;
end else
begin
seX2.Value := AWorldItem.X;
seY2.Value := AWorldItem.Y;
end;
frmMain.UnregisterSelectionListener(@TileSelected);
WindowState := FOldWindowState;
seX1Change(nil);
end;
initialization
{$I UfrmRegionControl.lrs}