new menu commands + some fixes

This commit is contained in:
zueuk 2006-04-05 10:59:31 +00:00
parent 7fddbe82d1
commit d85cf9e346
2 changed files with 555 additions and 175 deletions

View File

@ -81,7 +81,7 @@ object EditForm: TEditForm
object EditorToolBar: TToolBar object EditorToolBar: TToolBar
Left = 1 Left = 1
Top = 1 Top = 1
Width = 408 Width = 432
Height = 22 Height = 22
Align = alLeft Align = alLeft
ButtonWidth = 25 ButtonWidth = 25
@ -179,13 +179,25 @@ object EditForm: TEditForm
ShowHint = True ShowHint = True
OnClick = tbSelectClick OnClick = tbSelectClick
end end
object tbMove: TToolButton object tbAutoEditMode: TToolButton
Left = 191 Left = 191
Top = 0 Top = 0
Hint = 'Move Triangle' Hint = 'Auto edit mode'
Caption = 'Move' Caption = 'Auto'
Down = True Down = True
Grouped = True Grouped = True
ImageIndex = 19
ParentShowHint = False
ShowHint = True
Style = tbsCheck
OnClick = tbEditModeClick
end
object tbMove: TToolButton
Left = 216
Top = 0
Hint = 'Move triangle'
Caption = 'Move'
Grouped = True
ImageIndex = 7 ImageIndex = 7
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
@ -193,7 +205,7 @@ object EditForm: TEditForm
OnClick = tbEditModeClick OnClick = tbEditModeClick
end end
object tbRotate: TToolButton object tbRotate: TToolButton
Left = 216 Left = 241
Top = 0 Top = 0
Hint = 'Rotate triangle' Hint = 'Rotate triangle'
Caption = 'Rotate' Caption = 'Rotate'
@ -205,7 +217,7 @@ object EditForm: TEditForm
OnClick = tbEditModeClick OnClick = tbEditModeClick
end end
object tbScale: TToolButton object tbScale: TToolButton
Left = 241 Left = 266
Top = 0 Top = 0
Hint = 'Scale triangle' Hint = 'Scale triangle'
Caption = 'Scale' Caption = 'Scale'
@ -217,7 +229,7 @@ object EditForm: TEditForm
OnClick = tbEditModeClick OnClick = tbEditModeClick
end end
object ToolButton5: TToolButton object ToolButton5: TToolButton
Left = 266 Left = 291
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton5' Caption = 'ToolButton5'
@ -225,7 +237,7 @@ object EditForm: TEditForm
Style = tbsSeparator Style = tbsSeparator
end end
object tbFlipHorz: TToolButton object tbFlipHorz: TToolButton
Left = 274 Left = 299
Top = 0 Top = 0
Hint = 'Flip triangle horizontal' Hint = 'Flip triangle horizontal'
Caption = 'Flip Horizontal' Caption = 'Flip Horizontal'
@ -235,7 +247,7 @@ object EditForm: TEditForm
OnClick = mnuFlipHorizontalClick OnClick = mnuFlipHorizontalClick
end end
object tbFlipVert: TToolButton object tbFlipVert: TToolButton
Left = 299 Left = 324
Top = 0 Top = 0
Hint = 'Flip triangle vertical' Hint = 'Flip triangle vertical'
Caption = 'Flip Vertical' Caption = 'Flip Vertical'
@ -245,7 +257,7 @@ object EditForm: TEditForm
OnClick = mnuFlipVerticalClick OnClick = mnuFlipVerticalClick
end end
object ToolButton2: TToolButton object ToolButton2: TToolButton
Left = 324 Left = 349
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton2' Caption = 'ToolButton2'
@ -253,7 +265,7 @@ object EditForm: TEditForm
Style = tbsSeparator Style = tbsSeparator
end end
object tbVarPreview: TToolButton object tbVarPreview: TToolButton
Left = 332 Left = 357
Top = 0 Top = 0
Hint = 'Show/hide variation preview' Hint = 'Show/hide variation preview'
Caption = 'Variation Preview' Caption = 'Variation Preview'
@ -264,7 +276,7 @@ object EditForm: TEditForm
OnClick = tbVarPreviewClick OnClick = tbVarPreviewClick
end end
object ToolButton3: TToolButton object ToolButton3: TToolButton
Left = 357 Left = 382
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton3' Caption = 'ToolButton3'
@ -272,7 +284,7 @@ object EditForm: TEditForm
Style = tbsSeparator Style = tbsSeparator
end end
object tbEnableFinalXform: TToolButton object tbEnableFinalXform: TToolButton
Left = 365 Left = 390
Top = 0 Top = 0
Hint = 'Enable final transform' Hint = 'Enable final transform'
Caption = 'Show Final Xform' Caption = 'Show Final Xform'
@ -1777,8 +1789,8 @@ object EditForm: TEditForm
Left = 313 Left = 313
Top = 40 Top = 40
Bitmap = { Bitmap = {
494C010115001800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 494C010118001D00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000006000000001002000000000000060 0000000000003600000028000000400000008000000001002000000000000080
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -1828,32 +1840,333 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000600000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000600000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000600000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000600000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000600000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000600000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000006000000000000000600000000000000060000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000600000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000060000000600000006000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000600000000000
0000600000000000000060000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000006000
0000000000000000000000000000600000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000006000
0000600000006000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000054545400000000000000 0000000000000000000000000000000000000000000054545400000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00006000000000000000FFFFFF00FFFFFF00FFFFFF0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000600000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000005454540000000000000000000000 0000000000000000000000000000000000005454540000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000006000000060000000600000006000
0000000000000000000000000000000000000000000000000000000000000000 00006000000060000000FFFFFF0000000000FFFFFF0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000545454000000000000000000000000000000 0000000000000000000000000000545454000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000005454
0000000000000000000000000000000000000000000000000000000000000000 5400000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00006000000000000000FFFFFF00FFFFFF00FFFFFF0000000000000000005454
0000000000000000000000000000000000000000000000000000000000000000 5400000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000005454
0000000000000000000000000000000000000000000000000000000000000000 5400000000000000000000000000000000000000000000000000000000000000
0000000000000000000054545400000000000000000000000000000000000000 0000000000000000000054545400000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000545454000000
0000000000000000000000000000000000000000000000000000000000006000
0000000000000000000000000000000000000000000000000000545454000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000545454000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000054545400000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000054545400000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000600000000000000000000000000000000000000054545400000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000005454540000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000005454540000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000006000000000000000000000005454540000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000006000000060000000600000006000
0000600000006000000060000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000006000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000600000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -1868,86 +2181,41 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000060000000000000006000
0000000000000000000000000000000000000000000000000000000000000000 0000000000006000000060000000600000000000000060000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000600000006000000060000000000000000000000000000000FFFFFF000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000FFFFFF000000
00000000000000000000000000000000000000000000FFFFFF00000000000000 00000000000000000000000000000000000000000000FFFFFF00000000000000
000000000000FFFFFF0000000000000000000000000000000000000000000000 000000000000FFFFFF0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000002424 0000000000000000000000000000000000000000000000000000000000002424
2400242424002424240000000000000000000000000000000000242424002424 2400242424002424240000000000000000000000000000000000242424002424
2400242424000000000000000000000000000000000000000000000000000000 2400242424000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000060000000000000006000
0000000000000000000000000000000000000000000000000000000000000000 0000000000006000000000000000600000000000000060000000000000000000
0000000000000000000000000000000000000000000000000000FFFFFF000000 0000600000000000000060000000000000000000000000000000FFFFFF000000
00000000000000000000000000000000000000000000FFFFFF00000000000000 00000000000000000000000000000000000000000000FFFFFF00000000000000
000000000000FFFFFF0000000000000000000000000000000000000000000000 000000000000FFFFFF0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000002424 0000000000000000000000000000000000000000000000000000000000002424
2400000000002424240000000000000000000000000000000000242424000000 2400000000002424240000000000000000000000000000000000242424000000
0000242424000000000000000000000000000000000000000000000000000000 0000242424000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000060000000600000006000
0000000000000000000000000000000000000000000000000000000000000000 0000000000006000000000000000600000000000000060000000000000000000
0000000000000000000000000000000000000000000000000000FFFFFF000000 0000600000000000000060000000000000000000000000000000FFFFFF000000
0000000000000000000000000000000000000000000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000FFFFFF000000
0000FFFFFF000000000000000000000000000000000000000000000000000000 0000FFFFFF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000002424 0000000000000000000000000000000000000000000000000000000000002424
2400000000002424240000000000000000000000000000000000242424000000 2400000000002424240000000000000000000000000000000000242424000000
0000242424000000000000000000000000000000000000000000000000000000 0000242424000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000060000000000000006000
0000000000000000000000000000000000000000000000000000000000000000 0000000000006000000000000000600000000000000060000000000000000000
0000000000000000000000000000000000000000000000000000FFFFFF00FFFF 0000600000000000000060000000000000000000000000000000FFFFFF00FFFF
FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF
FF00000000000000000000000000000000000000000000000000000000000000 FF00000000000000000000000000000000000000000000000000000000000000
0000000000000000000024242400000000000000000000000000000000002424 0000000000000000000024242400000000000000000000000000000000002424
2400000000002424240000000000000000000000000000000000242424000000 2400000000002424240000000000000000000000000000000000242424000000
0000242424000000000000000000000000000000000024242400000000000000 0000242424000000000000000000000000000000000024242400000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000600000006000
0000000000000000000000000000000000000000000000000000000000000000 0000000000006000000000000000000000006000000060000000600000000000
0000000000000000000000000000000000000000000000000000FFFFFF000000 0000600000006000000060000000000000000000000000000000FFFFFF000000
0000000000000000000000000000000000000000000000000000FFFFFF000000 0000000000000000000000000000000000000000000000000000FFFFFF000000
0000FFFFFF000000000000000000000000000000000000000000000000000000 0000FFFFFF000000000000000000000000000000000000000000000000000000
0000000000002424240024242400000000000000000000000000000000002424 0000000000002424240024242400000000000000000000000000000000002424
@ -1969,32 +2237,32 @@ object EditForm: TEditForm
2400242424000000000024242400000000000000000000000000000000002424 2400242424000000000024242400000000000000000000000000000000002424
2400000000002424240000000000000000000000000000000000242424000000 2400000000002424240000000000000000000000000000000000242424000000
0000242424000000000000000000000000000000000024242400000000002424 0000242424000000000000000000000000000000000024242400000000002424
2400242424000000000000000000000000000000000000000000000000000000 24002424240000000000000000000000000000000000000000005C5C5C000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00005C5C5C000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000242424002424 0000000000000000000000000000000000000000000000000000242424002424
2400000000000000000024242400242424002424240024242400242424002424 2400000000000000000024242400242424002424240024242400242424002424
2400000000002424240000000000000000000000000000000000242424000000 2400000000002424240000000000000000000000000000000000242424000000
0000242424002424240024242400242424002424240024242400000000000000 0000242424002424240024242400242424002424240024242400000000000000
0000242424002424240000000000000000000000000000000000000000000000 0000242424002424240000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000005454 0000000000000000000000000000000000000000000000000000000000000000
5400000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000024242400242424000000 0000000000000000000000000000000000000000000024242400242424000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000002424240000000000000000000000000000000000242424000000 0000000000002424240000000000000000000000000000000000242424000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000002424240024242400000000000000000000000000000000000000 00000000000024242400242424000000000000000000000000005C5C5C000000
0000000000000000000000000000000000000000000000000000545454000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00005C5C5C000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000242424002424 0000000000000000000000000000000000000000000000000000242424002424
2400000000000000000024242400242424002424240024242400242424002424 2400000000000000000024242400242424002424240024242400242424002424
2400242424002424240000000000000000000000000000000000242424002424 2400242424002424240000000000000000000000000000000000242424002424
2400242424002424240024242400242424002424240024242400000000000000 2400242424002424240024242400242424002424240024242400000000000000
0000242424002424240000000000000000000000000000000000000000000000 0000242424002424240000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000054545400000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000FFFFFF00C0C0C000C0C0C000FFFFFF00000000000000 00000000000000000000FFFFFF00C0C0C000C0C0C000FFFFFF00000000000000
0000000000000000000000000000000000000000000000000000000000002424 0000000000000000000000000000000000000000000000000000000000002424
@ -2002,7 +2270,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000024242400000000002424 0000000000000000000000000000000000000000000024242400000000002424
2400242424000000000000000000000000000000000000000000000000000000 2400242424000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000005454540000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF 0000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF
FF00000000000000000000000000000000000000000000000000000000000000 FF00000000000000000000000000000000000000000000000000000000000000
@ -2018,7 +2286,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000024242400242424000000 0000000000000000000000000000000000000000000024242400242424000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 000000000000000000005C5C5C00000000005C5C5C0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000FFFFFF00C0C0C000C0C0C000FFFFFF00000000000000 00000000000000000000FFFFFF00C0C0C000C0C0C000FFFFFF00000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -2548,16 +2816,24 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000 000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000600000000100010000000000000300000000000000000000 2800000040000000800000000100010000000000000400000000000000000000
000000000000000000000000FFFFFF00FFFF000000000000AAAB000000000000 000000000000000000000000FFFFFF0000000000000000000000000000000000
FFFD000000000000BFFF000000000000FFFD000000000000B80F000000000000 0000000000000000000000000000000000000000000000000000000000000000
FB9D000000000000BB3F000000000000FA7D000000000000B8FF000000000000 0000000000000000000000000000000000000000000000000000000000000000
F9FD000000000000BBFF000000000000FFFD000000000000BFFF000000000000 0000000000000000000000000000000000000000000000000000000000000000
D555000000000000FFFF0000000000008F11FFFFFFFFFFFF8F11FFE3C7FFFEFF 0000000000000000000000000000000000000000000000000000000000000000
8F11FFE3C7FFFFFF8383FFE3C7FFFEFF83C7FDE3C7BFFFFF8383F9E3C79FFEFF 0000000000000000000000000000000000000000000000000000000000000000
8111F1E3C78FFFFF8111E1E3C787AA028111C003C003FEE7FFFF8003C001FECF 0000000000000000000000000000000000000000000000000000000000000000
FC3FC003C003FE9FF00FE1FFFF87FE3FE007F1FFFF8FFE7FE007F9FFFF9FFEFF 0000000000000000000000000000000000000000000000000000000000000000
F00FFDFFFFBFFFFFFC3FFFFFFFFFFEFFFF7FFFFFFFFF8F11FF7FFFFFFDBF8F11 00000000000000000000000000000000FFFFFFFFFEFFFFF7AAABFEFFFEFFFEF7
FFFDFFFFFEFFFFF7BFFFFEFFFABFFEF7FFFDFFFFFC7FFFD5B80FFEFFEEFFFEE3
FB9DFFFFF47FFFF7BB3FAA020002AA02FA7DFEE7F467FEE7B8FFFECFEECFFECF
F9FDFE9FFE9FF69FBBFFFE3FFE3FFA3FFFFDFE7FFE7F007FBFFFFEFFFEFFFAFF
D555FFFFFFFFF7FFFFFFFEFFFEFFFEFF8F11FFFFFFFFA8B18F11FFE3C7FFAAB5
8F11FFE3C7FF8AB58383FFE3C7FFAAB583C7FDE3C7BFCB118383F9E3C79FFFFF
8111F1E3C78FDEF78111E1E3C7879EF38111C003C0030001FFFF8003C0019EF3
FC3FC003C003DEF7F00FE1FFFF87FEFFE007F1FFFF8FFEFFE007F9FFFF9FF83F
F00FFDFFFFBFFC7FFC3FFFFFFFFFFEFFFF7FFFFFFFFF8F11FF7FFFFFFDBF8F11
FF7FFFFFEFF78F11E00FF3E77DBE8383E007E1E7F7EF83C7FF63C0E7DC3B8383 FF7FFFFFEFF78F11E00FF3E77DBE8383E007E1E7F7EF83C7FF63C0E7DC3B8383
FF73F3E7700E8111FF73F3E7E0078111FB730000E0078111F363F3E7700EFFFF FF73F3E7700E8111FF73F3E7E0078111FB730000E0078111F363F3E7700EFFFF
E007F3E7DC3BFE7FE00FF1C7F7EFFE7FF37FF80F7DBEF81FFB7FFC1FEFF7F81F E007F3E7DC3BFE7FE00FF1C7F7EFFE7FF37FF80F7DBEF81FFB7FFC1FEFF7F81F
@ -2582,11 +2858,21 @@ object EditForm: TEditForm
Left = 353 Left = 353
Top = 73 Top = 73
object mnuReset: TMenuItem object mnuReset: TMenuItem
Caption = 'Reset' Caption = 'Reset triangle'
Hint = 'Reset triangle position' Hint = 'Reset triangle'
ImageIndex = 19 ImageIndex = 21
OnClick = mnuResetClick OnClick = mnuResetClick
end end
object mnuResetTrgPosition: TMenuItem
Caption = 'Reset position'
ImageIndex = 22
OnClick = btnOcoefsClick
end
object mnuResetTrgRotation: TMenuItem
Caption = 'Reset rotation'
ImageIndex = 23
OnClick = mnuResetTrgRotationClick
end
object N6: TMenuItem object N6: TMenuItem
Caption = '-' Caption = '-'
end end

View File

@ -174,6 +174,9 @@ type
txtSymmetry: TEdit; txtSymmetry: TEdit;
pnlWeight: TPanel; pnlWeight: TPanel;
pnlSymmetry: TPanel; pnlSymmetry: TPanel;
tbAutoEditMode: TToolButton;
mnuResetTrgRotation: TMenuItem;
mnuResetTrgPosition: TMenuItem;
procedure ValidateVariable; procedure ValidateVariable;
procedure vleVariablesValidate(Sender: TObject; ACol, ARow: Integer; const KeyName, KeyValue: string); procedure vleVariablesValidate(Sender: TObject; ACol, ARow: Integer; const KeyName, KeyValue: string);
procedure vleVariablesKeyPress(Sender: TObject; var Key: Char); procedure vleVariablesKeyPress(Sender: TObject; var Key: Char);
@ -310,6 +313,7 @@ type
procedure DragPanelMouseUp(Sender: TObject; Button: TMouseButton; procedure DragPanelMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
procedure DragPanelDblClick(Sender: TObject); procedure DragPanelDblClick(Sender: TObject);
procedure mnuResetTrgRotationClick(Sender: TObject);
private private
TriangleView: TCustomDrawControl; TriangleView: TCustomDrawControl;
@ -487,7 +491,8 @@ end;
function ScaleTrianglePoint(t: TTriangle; x, y, scale: double): TTriangle; function ScaleTrianglePoint(t: TTriangle; x, y, scale: double): TTriangle;
begin begin
assert(scale <> 0); //assert(scale <> 0);
if scale = 0 then scale := 1e-64;
Result.y[0] := scale * (t.y[0] - y) + y; Result.y[0] := scale * (t.y[0] - y) + y;
Result.y[1] := scale * (t.y[1] - y) + y; Result.y[1] := scale * (t.y[1] - y) + y;
@ -605,7 +610,7 @@ begin
} }
cp.copy(MainCp); cp.copy(MainCp);
if SelectedTriangle > LastTriangle{???} then//NumXForms(cp) then if SelectedTriangle > LastTriangle{???} then
begin begin
SelectedTriangle := cp.NumXForms-1; SelectedTriangle := cp.NumXForms-1;
mouseOverTriangle := -1; mouseOverTriangle := -1;
@ -881,11 +886,11 @@ begin
Dec(Transforms); Dec(Transforms);
assert(cp.xform[transforms].density = 0); // cp.xform[transforms].density := 0; assert(cp.xform[transforms].density = 0); // cp.xform[transforms].density := 0;
end; end;
UpdateFlame(True);
cbTransforms.clear; cbTransforms.clear;
for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i)); for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i));
if cp.HasFinalXForm then cbTransforms.Items.Add('Final'); if EnableFinalXform or (cp.HasFinalXForm = true) then cbTransforms.Items.Add('Final');
cbTransforms.ItemIndex := SelectedTriangle; cbTransforms.ItemIndex := SelectedTriangle;
UpdateFlame(True);
end; end;
function TEditForm.InsideTriangle(x, y: double): integer; function TEditForm.InsideTriangle(x, y: double): integer;
@ -967,6 +972,10 @@ var
end; end;
end; end;
end; end;
var
xx, xy, yx, yy: double;
var var
i, n, tc, tn: integer; i, n, tc, tn: integer;
d, d1: double; d, d1: double;
@ -1097,7 +1106,15 @@ end;
a := ToScreen(MainTriangles[i].x[0], MainTriangles[i].y[0]); a := ToScreen(MainTriangles[i].x[0], MainTriangles[i].y[0]);
b := ToScreen(MainTriangles[i].x[1], MainTriangles[i].y[1]); b := ToScreen(MainTriangles[i].x[1], MainTriangles[i].y[1]);
c := ToScreen(MainTriangles[i].x[2], MainTriangles[i].y[2]); c := ToScreen(MainTriangles[i].x[2], MainTriangles[i].y[2]);
Polyline([a, b, c, a]); if pen.Style <> psSolid then
Polyline([a, b, c, a])
else begin
Polyline([a, b, c]);
Pen.Style := psDot;
brush.Color := pen.color shr 1 and $7f7f7f;
Polyline([c, a]);
brush.Color := EditorBkgColor;
end;
Pen.Style := psSolid; Pen.Style := psSolid;
Ellipse(a.x - 4, a.y - 4, a.x + 4, a.y + 4); Ellipse(a.x - 4, a.y - 4, a.x + 4, a.y + 4);
@ -1110,6 +1127,41 @@ end;
TextOut(b.x+2, b.y+1, 'O'); TextOut(b.x+2, b.y+1, 'O');
end; end;
//if showTriangleCorners then
with MainTriangles[SelectedTriangle] do
begin
xx := x[0] - x[1];
xy := y[0] - y[1];
yx := x[2] - x[1];
yy := y[2] - y[1];
Pen.Color := GetTriangleColor(SelectedTriangle) shr 1 and $7f7f7f;
Pen.Mode := pmMerge;
a:=toscreen(x[1] + 0.8*xx + yx, y[1] + 0.8*xy + yy);
b:=toscreen(x[1] + xx + yx, y[1] + xy + yy);
c:=toscreen(x[1] + xx + 0.8*yx, y[1] + xy + 0.8*yy);
moveto(a.x, a.y);
lineto(b.x, b.y);
lineto(c.x, c.y);
a:=toscreen(x[1] - 0.8*xx + yx, y[1] - 0.8*xy + yy);
b:=toscreen(x[1] - xx + yx, y[1] - xy + yy);
c:=toscreen(x[1] - xx + 0.8*yx, y[1] - xy + 0.8*yy);
moveto(a.x, a.y);
lineto(b.x, b.y);
lineto(c.x, c.y);
a:=toscreen(x[1] - 0.8*xx - yx, y[1] - 0.8*xy - yy);
b:=toscreen(x[1] - xx - yx, y[1] - xy - yy);
c:=toscreen(x[1] - xx - 0.8*yx, y[1] - xy - 0.8*yy);
moveto(a.x, a.y);
lineto(b.x, b.y);
lineto(c.x, c.y);
a:=toscreen(x[1] + 0.8*xx - yx, y[1] + 0.8*xy - yy);
b:=toscreen(x[1] + xx - yx, y[1] + xy - yy);
c:=toscreen(x[1] + xx - 0.8*yx, y[1] + xy - 0.8*yy);
moveto(a.x, a.y);
lineto(b.x, b.y);
lineto(c.x, c.y);
end;
if showVarPreview then if showVarPreview then
begin begin
assert(trkVarPreviewRange.position > 0); assert(trkVarPreviewRange.position > 0);
@ -1183,7 +1235,7 @@ end;
b := ToScreen(Pivot.x + dy, Pivot.y - dx); b := ToScreen(Pivot.x + dy, Pivot.y - dx);
c := ToScreen(Pivot.x, Pivot.y); c := ToScreen(Pivot.x, Pivot.y);
MoveTo(a.x, a.y); MoveTo(a.x, a.y);
LineTo(c.X, c.y); // not necessary but it looks better with it... LineTo(c.X, c.y);
LineTo(b.X, b.y); LineTo(b.X, b.y);
end; end;
@ -1230,9 +1282,11 @@ end;
if (mouseOverTriangle >= 0) then // highlight triangle under cursor if (mouseOverTriangle >= 0) then // highlight triangle under cursor
begin begin
a := ToScreen(MainTriangles[mouseOverTriangle].x[0], MainTriangles[mouseOverTriangle].y[0]); with MainTriangles[mouseOverTriangle] do begin
b := ToScreen(MainTriangles[mouseOverTriangle].x[1], MainTriangles[mouseOverTriangle].y[1]); a := ToScreen(x[0], y[0]);
c := ToScreen(MainTriangles[mouseOverTriangle].x[2], MainTriangles[mouseOverTriangle].y[2]); b := ToScreen(x[1], y[1]);
c := ToScreen(x[2], y[2]);
end;
pen.Width:=2; pen.Width:=2;
Pen.Color:=GetTriangleColor(mouseOverTriangle) shr 1 and $7f7f7f; Pen.Color:=GetTriangleColor(mouseOverTriangle) shr 1 and $7f7f7f;
@ -1309,13 +1363,13 @@ end;
end; end;
end; end;
end; end;
if (mouseOverTriangle>=0) and (mouseOverEdge >= 0) then // highlight edge under cursor if (mouseOverEdge >= 0) then // highlight edge under cursor
begin begin
i := (mouseOverEdge + 1) mod 3; i := (mouseOverEdge + 1) mod 3;
a := ToScreen(MainTriangles[mouseOverTriangle].x[mouseOverEdge], MainTriangles[mouseOverTriangle].y[mouseOverEdge]); a := ToScreen(MainTriangles[mouseOverTriangle].x[mouseOverEdge], MainTriangles[mouseOverTriangle].y[mouseOverEdge]);
b := ToScreen(MainTriangles[mouseOverTriangle].x[i], MainTriangles[mouseOverTriangle].y[i]); b := ToScreen(MainTriangles[mouseOverTriangle].x[i], MainTriangles[mouseOverTriangle].y[i]);
pen.Width:=4; pen.Width:=5;
Pen.Color:=GetTriangleColor(mouseOverTriangle) shr 1 and $7f7f7f; Pen.Color:=GetTriangleColor(mouseOverTriangle) shr 1 and $7f7f7f;
Pen.Mode:=pmMerge; Pen.Mode:=pmMerge;
@ -1486,8 +1540,9 @@ begin
d := dist(fx, fy, MainTriangles[i].x[j], MainTriangles[i].y[j]); d := dist(fx, fy, MainTriangles[i].x[j], MainTriangles[i].y[j]);
if (d * GraphZoom * 50) < 4 then if (d * GraphZoom * 50) < 4 then
begin begin
mouseOverTriangle:=i; mouseOverTriangle := i;
mouseOverCorner:=j; mouseOverCorner := j;
mouseOverEdge := -1;
// -- from MouseDown -- for highlighting: // -- from MouseDown -- for highlighting:
// TODO: optimize... // TODO: optimize...
@ -1520,12 +1575,16 @@ begin
goto FoundCorner; goto FoundCorner;
end; end;
end; end;
end;
if oldMode = modeNone then {hmm} for j := 0 to 2 do // -- detect edge hit if AutoEditMode and (oldMode = modeNone) then
for i := i1 downto i0 do
begin
for j := 0 to 2 do // -- detect edge hit
begin begin
if abs(line_dist(fx, fy, MainTriangles[i].x[j], MainTriangles[i].y[j], if abs(line_dist(fx, fy, MainTriangles[i].x[j], MainTriangles[i].y[j],
MainTriangles[i].x[(j+1) mod 3], MainTriangles[i].y[(j+1) mod 3]) MainTriangles[i].x[(j+1) mod 3], MainTriangles[i].y[(j+1) mod 3])
) * GraphZoom * 50 < 2 then ) * GraphZoom * 50 < 3 then
begin begin
mouseOverTriangle:=i; mouseOverTriangle:=i;
mouseOverEdge := j; mouseOverEdge := j;
@ -1860,17 +1919,23 @@ begin
oldy := MainTriangles[SelectedTriangle].y[j] - Pivot.Y; oldy := MainTriangles[SelectedTriangle].y[j] - Pivot.Y;
olddist := sqrt(oldx*oldx + oldy*oldy); olddist := sqrt(oldx*oldx + oldy*oldy);
MainForm.UpdateUndo; HasChanged := false;
//MainForm.UpdateUndo;
ShowSelectedInfo; ShowSelectedInfo;
TriangleView.Invalidate; TriangleView.Invalidate;
exit; exit;
end; end;
end; end;
if oldMode = modeNone then {hmm} for j := 0 to 2 do // -- detect edge hit end;
if AutoEditMode and (oldMode = modeNone) then
for i := i1 downto i0 do
begin
for j := 0 to 2 do // -- detect edge hit
begin begin
if abs(line_dist(fx, fy, MainTriangles[i].x[j], MainTriangles[i].y[j], if abs(line_dist(fx, fy, MainTriangles[i].x[j], MainTriangles[i].y[j],
MainTriangles[i].x[(j+1) mod 3], MainTriangles[i].y[(j+1) mod 3]) MainTriangles[i].x[(j+1) mod 3], MainTriangles[i].y[(j+1) mod 3])
) * GraphZoom * 50 < 2 then ) * GraphZoom * 50 < 3 then
begin begin
SelectedTriangle := i; SelectedTriangle := i;
modeHack := true; modeHack := true;
@ -1898,7 +1963,8 @@ FoundTriangle:
TriangleCaught := True; TriangleCaught := True;
OldTriangle := MainTriangles[SelectedTriangle]; OldTriangle := MainTriangles[SelectedTriangle];
MainForm.UpdateUndo; //MainForm.UpdateUndo;
HasChanged := false;
Pivot := GetPivot; Pivot := GetPivot;
oldx := fx-Pivot.X; oldx := fx-Pivot.X;
@ -1938,6 +2004,7 @@ begin
TriangleCaught := False; TriangleCaught := False;
if HasChanged then if HasChanged then
begin begin
MainForm.UpdateUndo;
UpdateFlame(true); UpdateFlame(true);
HasChanged := False; HasChanged := False;
end end
@ -1997,13 +2064,9 @@ begin
else mnuResetLoc.checked := true; else mnuResetLoc.checked := true;
//tbResetLoc.Down := mnuResetLoc.checked; //tbResetLoc.Down := mnuResetLoc.checked;
if Registry.ValueExists('HelpersEnabled') then if Registry.ValueExists('HelpersEnabled') then
begin HelpersEnabled := Registry.ReadBool('HelpersEnabled')
HelpersEnabled := Registry.ReadBool('HelpersEnabled');
end
else else
begin
HelpersEnabled := true; HelpersEnabled := true;
end;
if Registry.ValueExists('VariationPreview') then if Registry.ValueExists('VariationPreview') then
begin begin
@ -2014,6 +2077,7 @@ begin
showVarPreview := false; showVarPreview := false;
tbVarPreview.Down := false; tbVarPreview.Down := false;
end; end;
if Registry.ValueExists('VariationPreviewRange') then if Registry.ValueExists('VariationPreviewRange') then
trkVarPreviewRange.Position := Registry.ReadInteger('VariationPreviewRange'); trkVarPreviewRange.Position := Registry.ReadInteger('VariationPreviewRange');
if Registry.ValueExists('VariationPreviewDensity') then if Registry.ValueExists('VariationPreviewDensity') then
@ -2031,12 +2095,14 @@ begin
Registry.Free; Registry.Free;
end; end;
chkUseXFormColor.checked := UseTransformColors; chkUseXFormColor.checked := UseTransformColors;
if AutoEditMode then tbAutoEditMode.Down := true
else tbMove.Down := true;
UpdateDisplay; UpdateDisplay;
end; end;
procedure TEditForm.mnuDeleteClick(Sender: TObject); procedure TEditForm.mnuDeleteClick(Sender: TObject);
begin begin
if (SelectedTriangle > -1) then DeleteTriangle(SelectedTriangle); if (SelectedTriangle >= 0) then DeleteTriangle(SelectedTriangle);
end; end;
procedure TEditForm.mnuAddClick(Sender: TObject); procedure TEditForm.mnuAddClick(Sender: TObject);
@ -2050,10 +2116,10 @@ begin
cp.xform[Transforms+1].Assign(cp.xform[Transforms]); cp.xform[Transforms+1].Assign(cp.xform[Transforms]);
MainTriangles[Transforms] := MainTriangles[-1]; MainTriangles[Transforms] := MainTriangles[-1];
SelectedTriangle := Transforms; SelectedTriangle := Transforms;
cp.xform[Transforms].Clear;
cp.xform[Transforms].density := 0.5; cp.xform[Transforms].density := 0.5;
cp.xform[Transforms].vars[0] := 1; cp.xform[Transforms].vars[0] := 1;
for i := 1 to NRVAR - 1 do // for i := 1 to NRVAR - 1 do cp.xform[Transforms].vars[i] := 0;
cp.xform[Transforms].vars[i] := 0;
Inc(Transforms); Inc(Transforms);
cbTransforms.clear; cbTransforms.clear;
for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i)); for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i));
@ -2586,7 +2652,7 @@ end;
procedure TEditForm.scrlXFormColorScroll(Sender: TObject; procedure TEditForm.scrlXFormColorScroll(Sender: TObject;
ScrollCode: TScrollCode; var ScrollPos: Integer); ScrollCode: TScrollCode; var ScrollPos: Integer);
begin begin
if ScrollCode = scEndScroll then begin if (ScrollCode = scEndScroll) and HasChanged then begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
UpdateFlame(True); UpdateFlame(True);
end; end;
@ -2599,12 +2665,16 @@ begin
if updating then exit; if updating then exit;
v := (scrlXFormColor.Position) / scrlXFormColor.Max; v := (scrlXFormColor.Position) / scrlXFormColor.Max;
cp.xform[SelectedTriangle].color := v; if v <> cp.xform[SelectedTriangle].color then
pnlXFormColor.color := ColorValToColor(MainCp.cmap, v); begin
txtXFormColor.Text := Format('%1.3f', [v]); cp.xform[SelectedTriangle].color := v;
txtXFormColor.Refresh; pnlXFormColor.color := ColorValToColor(MainCp.cmap, v);
txtXFormColor.Text := Format('%1.3f', [v]);
txtXFormColor.Refresh;
DrawPreview; HasChanged := true;
DrawPreview;
end;
end; end;
procedure TEditForm.chkUseXFormColorClick(Sender: TObject); procedure TEditForm.chkUseXFormColorClick(Sender: TObject);
@ -2635,7 +2705,11 @@ begin
if v < 0 then v := 0; if v < 0 then v := 0;
if v <> cp.xform[SelectedTriangle].color then if v <> cp.xform[SelectedTriangle].color then
begin begin
updating := true;
scrlXFormColor.Position := round(v * scrlXFormColor.Max); scrlXFormColor.Position := round(v * scrlXFormColor.Max);
MainForm.UpdateUndo;
cp.xform[SelectedTriangle].color := v;
updating := false;
UpdateFlame(true); UpdateFlame(true);
end; end;
end; end;
@ -2647,21 +2721,7 @@ begin
if key = #13 then if key = #13 then
begin begin
key := #0; key := #0;
try txtXFormColorExit(Sender);
v := StrToFloat(txtXFormColor.Text);
except on EConvertError do
begin
txtXformColor.text := Format('%1.3f', [cp.xform[SelectedTriangle].color]);
exit;
end;
end;
if v > 1 then v := 1;
if v < 0 then v := 0;
if v <> cp.xform[SelectedTriangle].color then
begin
scrlXFormColor.Position := round(v * scrlXFormColor.Max);
UpdateFlame(true);
end;
end; end;
end; end;
@ -2830,13 +2890,14 @@ begin
if Button = mbLeft then begin if Button = mbLeft then begin
varDragOld:=x; varDragOld:=x;
cell := TValueListEditor(Sender).MouseCoord(x, y); cell := TValueListEditor(Sender).MouseCoord(x, y);
varDragIndex := cell.Y-1;
if (cell.y < 1) or (cell.y >= TValueListEditor(Sender).RowCount) or if (cell.y < 1) or (cell.y >= TValueListEditor(Sender).RowCount) or
(cell.x <> 0) then exit; (cell.x <> 0) then exit;
TValueListEditor(Sender).Row := cell.Y; TValueListEditor(Sender).Row := cell.Y;
varDragIndex := cell.Y-1;
Screen.Cursor := crHSplit; Screen.Cursor := crHSplit;
GetCursorPos(mousepos); // hmmm GetCursorPos(mousepos); // hmmm
@ -2923,21 +2984,25 @@ begin
end; end;
procedure TEditForm.VEVarsDblClick(Sender: TObject); procedure TEditForm.VEVarsDblClick(Sender: TObject);
//var var
// v: double; n: integer;
begin begin
if (TValueListEditor(Sender).Values[VarNames(varDragIndex)] = '0') or n := TValueListEditor(Sender).Row - 1;
(varDragOld >= TValueListEditor(Sender).ColWidths[0]) then exit; assert(n >= 0);
assert(n < TValueListEditor(Sender).rowCount);
if {(varDragOld >= TValueListEditor(Sender).ColWidths[0]) or}
(TValueListEditor(Sender).Values[VarNames(n)] = '0') then exit;
MainForm.UpdateUndo; MainForm.UpdateUndo;
if Sender = VEVars then if Sender = VEVars then
begin begin
cp.xform[SelectedTriangle].vars[varDragIndex] := 0; cp.xform[SelectedTriangle].vars[n] := 0;
VEVars.Values[VarNames(varDragIndex)] := '0'; VEVars.Values[VarNames(n)] := '0';
end end
else begin else begin
//v := 0; // hmm //v := 0; // hmm
cp.xform[SelectedTriangle].ResetVariable(vleVariables.Keys[varDragIndex+1]); cp.xform[SelectedTriangle].ResetVariable(vleVariables.Keys[n + 1]);
//vleVariables.Values[vleVariables.Keys[varDragIndex+1]] := '0'; //vleVariables.Values[vleVariables.Keys[varDragIndex+1]] := '0';
end; end;
@ -3103,7 +3168,7 @@ begin
txtTrgScaleValue.ItemIndex := 1; txtTrgScaleValue.ItemIndex := 1;
exit; exit;
end; end;
assert(scale <> 0); if scale = 0 then scale := 1e-6; //assert(scale <> 0);
if GetKeyState(VK_CONTROL) < 0 then scale := sqrt(scale) if GetKeyState(VK_CONTROL) < 0 then scale := sqrt(scale)
else if GetKeyState(VK_SHIFT) < 0 then scale := scale*scale; else if GetKeyState(VK_SHIFT) < 0 then scale := scale*scale;
@ -3355,20 +3420,22 @@ begin
tbRotate.Down := (editMode = modeRotate); tbRotate.Down := (editMode = modeRotate);
tbScale.Down := (editMode = modeScale); tbScale.Down := (editMode = modeScale);
} }
AutoEditMode := (Sender = tbAutoEditMode);
if Sender = tbRotate then if Sender = tbRotate then
begin begin
editMode := modeRotate; editMode := modeRotate;
tbRotate.Down := true; //tbRotate.Down := true;
end end
else if Sender = tbScale then else if Sender = tbScale then
begin begin
editMode := modeScale; editMode := modeScale;
tbScale.Down := true; //tbScale.Down := true;
end end
else begin else begin
editMode := modeMove; editMode := modeMove;
tbMove.Down := true; //tbMove.Down := true;
end; end;
TToolButton(Sender).Down := true;
end; end;
procedure TEditForm.tbFullViewClick(Sender: TObject); procedure TEditForm.tbFullViewClick(Sender: TObject);
@ -3472,8 +3539,9 @@ begin
SelectedTriangle := 1; SelectedTriangle := 1;
MainTriangles[0] := MainTriangles[-1]; MainTriangles[0] := MainTriangles[-1];
MainTriangles[1] := MainTriangles[-1]; MainTriangles[1] := MainTriangles[-1];
MainTriangles[2] := MainTriangles[-1]; MainTriangles[2] := MainTriangles[-1]; // kinda reset finalxform
EnableFinalXform := false;
assert(cp.HasFinalXForm = false); assert(cp.HasFinalXForm = false);
cbTransforms.clear; cbTransforms.clear;
@ -3912,8 +3980,8 @@ begin
updating := false; updating := false;
end end
else assert(false); else assert(false);
pEdit^.Text := FloatToStr(v); // Format('%.6g', [v]) pEdit^.Text := FloatToStr(v);
//pEdit.Refresh; pEdit.Refresh;
HasChanged := True; HasChanged := True;
DrawPreview; DrawPreview;
end; end;
@ -3957,8 +4025,14 @@ begin
else if (Sender = pnlSymmetry) then else if (Sender = pnlSymmetry) then
begin begin
pValue := @cp.xform[SelectedTriangle].symmetry; pValue := @cp.xform[SelectedTriangle].symmetry;
if pValue^ = 0 then exit; if SelectedTriangle = Transforms then begin
pValue^ := 0; if pValue^ = 1 then exit;
pValue^ := 1;
end
else begin
if pValue^ = 0 then exit;
pValue^ := 0;
end;
pEdit := @txtSymmetry; pEdit := @txtSymmetry;
end end
else if (Sender = pnlXformColor) then else if (Sender = pnlXformColor) then
@ -3975,5 +4049,25 @@ begin
UpdateFlame(true); UpdateFlame(true);
end; end;
procedure TEditForm.mnuResetTrgRotationClick(Sender: TObject);
var
nx, ny: double;
begin
with MainTriangles[SelectedTriangle] do
begin
nx := x[1] + Hypot(x[0] - x[1], y[0] - y[1]);
ny := y[1] + Hypot(x[2] - x[1], y[2] - y[1]);
if (x[0] = nx) and (y[0] = y[1]) and (x[2] = x[1]) and (y[2] = ny) then exit;
MainForm.UpdateUndo;
x[0] := nx;
y[0] := y[1];
x[2] := x[1];
y[2] := ny;
UpdateFlame(True);
end;
end;
end. end.