FR1183940 Added triangle rotation functions in the editors popup menu.

This commit is contained in:
utak3r 2005-05-02 05:49:35 +00:00
parent f95b97816a
commit ab38cb21bb
2 changed files with 38 additions and 8 deletions

View File

@ -1,6 +1,6 @@
object EditForm: TEditForm object EditForm: TEditForm
Left = 516 Left = 392
Top = 218 Top = 208
Width = 582 Width = 582
Height = 471 Height = 471
Caption = 'Editor' Caption = 'Editor'
@ -52,7 +52,7 @@ object EditForm: TEditForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 394 Width = 394
Height = 422 Height = 429
Align = alClient Align = alClient
BevelOuter = bvLowered BevelOuter = bvLowered
Color = clBlack Color = clBlack
@ -61,7 +61,7 @@ object EditForm: TEditForm
Left = 1 Left = 1
Top = 1 Top = 1
Width = 392 Width = 392
Height = 420 Height = 427
Align = alClient Align = alClient
PopupMenu = EditPopup PopupMenu = EditPopup
OnDblClick = GraphImageDblClick OnDblClick = GraphImageDblClick
@ -72,7 +72,7 @@ object EditForm: TEditForm
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 422 Top = 429
Width = 574 Width = 574
Height = 15 Height = 15
Panels = < Panels = <
@ -90,14 +90,14 @@ object EditForm: TEditForm
Left = 394 Left = 394
Top = 0 Top = 0
Width = 180 Width = 180
Height = 422 Height = 429
Align = alRight Align = alRight
Alignment = taLeftJustify Alignment = taLeftJustify
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 2 TabOrder = 2
DesignSize = ( DesignSize = (
180 180
422) 429)
object lblTransform: TLabel object lblTransform: TLabel
Left = 10 Left = 10
Top = 128 Top = 128
@ -136,7 +136,7 @@ object EditForm: TEditForm
Width = 57 Width = 57
Height = 21 Height = 21
Style = csDropDownList Style = csDropDownList
ItemHeight = 0 ItemHeight = 13
TabOrder = 1 TabOrder = 1
OnChange = cbTransformsChange OnChange = cbTransformsChange
end end
@ -567,6 +567,17 @@ object EditForm: TEditForm
object N4: TMenuItem object N4: TMenuItem
Caption = '-' Caption = '-'
end end
object mnuRotateRight: TMenuItem
Caption = 'Rotate Right'
OnClick = mnuRotateRightClick
end
object mnuRotateLeft: TMenuItem
Caption = 'Rotate Left'
OnClick = mnuRotateLeftClick
end
object N2: TMenuItem
Caption = '-'
end
object mnuFlipVertical: TMenuItem object mnuFlipVertical: TMenuItem
Caption = 'Flip Vertical' Caption = 'Flip Vertical'
OnClick = mnuFlipVerticalClick OnClick = mnuFlipVerticalClick

View File

@ -109,6 +109,9 @@ type
chkUseXFormColor: TCheckBox; chkUseXFormColor: TCheckBox;
chkFlameBack: TCheckBox; chkFlameBack: TCheckBox;
pnlReference: TPanel; pnlReference: TPanel;
N2: TMenuItem;
mnuRotateRight: TMenuItem;
mnuRotateLeft: TMenuItem;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure GraphImageMouseMove(Sender: TObject; Shift: TShiftState; X, procedure GraphImageMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: integer); Y: integer);
@ -162,6 +165,8 @@ type
procedure VEVarsExit(Sender: TObject); procedure VEVarsExit(Sender: TObject);
procedure VEVarsValidate(Sender: TObject; ACol, ARow: Integer; procedure VEVarsValidate(Sender: TObject; ACol, ARow: Integer;
const KeyName, KeyValue: String); const KeyName, KeyValue: String);
procedure mnuRotateRightClick(Sender: TObject);
procedure mnuRotateLeftClick(Sender: TObject);
private private
bm: TBitmap; bm: TBitmap;
cmap: TColorMap; cmap: TColorMap;
@ -1009,6 +1014,20 @@ begin
HasChanged := False; HasChanged := False;
end; end;
procedure TEditForm.mnuRotateRightClick(Sender: TObject);
begin
MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], -(PI / 20));
HasChanged := True;
UpdateFlame(False);
end;
procedure TEditForm.mnuRotateLeftClick(Sender: TObject);
begin
MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], PI / 20);
HasChanged := True;
UpdateFlame(False);
end;
procedure TEditForm.FormShow(Sender: TObject); procedure TEditForm.FormShow(Sender: TObject);
var var
Registry: TRegistry; Registry: TRegistry;