From: Piotr B. <ut...@us...> - 2005-06-28 20:06:55
|
Update of /cvsroot/apophysis/2.10/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30724 Modified Files: Editor.pas Editor.dfm Log Message: + Added triangle scale buttons in editor. + Shift-Alt-Ctrl mouse actions in editor are bound to the values on the triangle tab. Index: Editor.dfm =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Editor.dfm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Editor.dfm 19 Jun 2005 05:47:55 -0000 1.5 --- Editor.dfm 28 Jun 2005 20:06:46 -0000 1.6 *************** *** 1,5 **** object EditForm: TEditForm ! Left = 392 ! Top = 208 Width = 582 Height = 471 --- 1,5 ---- object EditForm: TEditForm ! Left = 398 ! Top = 205 Width = 582 Height = 471 *************** *** 53,57 **** Top = 0 Width = 394 ! Height = 422 Align = alClient BevelOuter = bvLowered --- 53,57 ---- Top = 0 Width = 394 ! Height = 429 Align = alClient BevelOuter = bvLowered *************** *** 73,77 **** object StatusBar: TStatusBar Left = 0 ! Top = 422 Width = 574 Height = 15 --- 73,77 ---- object StatusBar: TStatusBar Left = 0 ! Top = 429 Width = 574 Height = 15 *************** *** 91,95 **** Top = 0 Width = 180 ! Height = 422 Align = alRight Alignment = taLeftJustify --- 91,95 ---- Top = 0 Width = 180 ! Height = 429 Align = alRight Alignment = taLeftJustify *************** *** 98,102 **** DesignSize = ( 180 ! 422) object lblTransform: TLabel Left = 10 --- 98,102 ---- DesignSize = ( 180 ! 429) object lblTransform: TLabel Left = 10 *************** *** 137,141 **** Height = 21 Style = csDropDownList ! ItemHeight = 0 TabOrder = 1 OnChange = cbTransformsChange --- 137,141 ---- Height = 21 Style = csDropDownList ! ItemHeight = 13 TabOrder = 1 OnChange = cbTransformsChange *************** *** 159,162 **** --- 159,163 ---- Height = 231 HorzScrollBar.Visible = False + VertScrollBar.Position = 121 VertScrollBar.Smooth = True VertScrollBar.Style = ssFlat *************** *** 169,175 **** object TrianglePanel: TPanel Left = 0 ! Top = 0 Width = 155 ! Height = 302 BevelOuter = bvNone TabOrder = 0 --- 170,176 ---- object TrianglePanel: TPanel Left = 0 ! Top = -121 Width = 155 ! Height = 352 BevelOuter = bvNone TabOrder = 0 *************** *** 221,224 **** --- 222,226 ---- Width = 33 Height = 24 + Hint = 'Rotate triangle clockwise around its center' Flat = True Glyph.Data = { *************** *** 231,234 **** --- 233,238 ---- 0FFFFF770000000000FFFFF770000000000FFFFF777000000078FFFFF8777770 078FFFFFFFFF870078FFFFFFFFFFFF778FFFFFFFFFFFFF78FFFF} + ParentShowHint = False + ShowHint = True OnClick = btTrgRotateRightClick end *************** *** 238,241 **** --- 242,246 ---- Width = 33 Height = 24 + Hint = 'Rotate triangle counter clockwise around its center' Flat = True Glyph.Data = { *************** *** 266,269 **** --- 271,276 ---- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0808080FFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentShowHint = False + ShowHint = True OnClick = btTrgRotateLeftClick end *************** *** 273,276 **** --- 280,284 ---- Width = 33 Height = 24 + Hint = 'Move triangle up' Flat = True Glyph.Data = { *************** *** 301,304 **** --- 309,314 ---- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFF808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentShowHint = False + ShowHint = True OnClick = btTrgMoveUpClick end *************** *** 308,311 **** --- 318,322 ---- Width = 33 Height = 24 + Hint = 'Move triangle right' Flat = True Glyph.Data = { *************** *** 336,339 **** --- 347,352 ---- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentShowHint = False + ShowHint = True OnClick = btTrgMoveRightClick end *************** *** 343,346 **** --- 356,360 ---- Width = 33 Height = 24 + Hint = 'Move triangle left' Flat = True Glyph.Data = { *************** *** 371,374 **** --- 385,390 ---- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentShowHint = False + ShowHint = True OnClick = btTrgMoveLeftClick end *************** *** 378,381 **** --- 394,398 ---- Width = 33 Height = 24 + Hint = 'Move triangle down' Flat = True Glyph.Data = { *************** *** 406,416 **** FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C000 0000404040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} OnClick = btTrgMoveDownClick end object txtTrgRotateValue: TEdit Left = 56 Top = 184 Width = 33 ! Height = 24 TabOrder = 7 Text = '5' --- 423,475 ---- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C000 0000404040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentShowHint = False + ShowHint = True OnClick = btTrgMoveDownClick end + object btTrgScaleUp: TSpeedButton + Left = 90 + Top = 318 + Width = 33 + Height = 24 + Hint = 'Scale triangle up' + Flat = True + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFF00000000000000FF00000000000000FFF000FFFFFFFF00FFFF000FFFFFF + F00FFFFF000FFFFFF00FFFFFF000FFFFF00FFFFFFF000FFFF00FFFFFFFF000FF + F00FFFFFFFFF000FF00FFFFFFFFFF000F00FFFFFFFFFFF00000FFFFFFFFFFFF0 + 000FFFFFFFFFFFFF000FFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFF} + ParentShowHint = False + ShowHint = True + OnClick = btTrgScaleUpClick + end + object btTrgScaleDown: TSpeedButton + Left = 22 + Top = 318 + Width = 33 + Height = 24 + Hint = 'Scale triangle down' + Flat = True + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000 + 0FFFF000000000000FFFFF0000FFFFF00FFFFFF0000FFFF00FFFFFFFF000FFF0 + 0FFFFFFFFF000FF00FFFFFFFFFF000000FFFFFFFFFFF00000FFFFFFFFFFFFF00 + 0FFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentShowHint = False + ShowHint = True + OnClick = btTrgScaleDownClick + end object txtTrgRotateValue: TEdit Left = 56 Top = 184 Width = 33 ! Height = 21 TabOrder = 7 Text = '5' *************** *** 420,424 **** Top = 250 Width = 33 ! Height = 24 TabOrder = 8 Text = '0.05' --- 479,483 ---- Top = 250 Width = 33 ! Height = 21 TabOrder = 8 Text = '0.05' *************** *** 500,503 **** --- 559,570 ---- TabOrder = 6 end + object txtTrgScaleValue: TEdit + Left = 56 + Top = 320 + Width = 33 + Height = 21 + TabOrder = 9 + Text = '0.1' + end end end Index: Editor.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Editor.pas,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Editor.pas 19 Jun 2005 05:47:55 -0000 1.5 --- Editor.pas 28 Jun 2005 20:06:46 -0000 1.6 *************** *** 125,128 **** --- 125,131 ---- btTrgMoveLeft: TSpeedButton; btTrgMoveDown: TSpeedButton; + txtTrgScaleValue: TEdit; + btTrgScaleUp: TSpeedButton; + btTrgScaleDown: TSpeedButton; procedure FormCreate(Sender: TObject); procedure GraphImageMouseMove(Sender: TObject; Shift: TShiftState; X, *************** *** 188,191 **** --- 191,196 ---- procedure btTrgMoveUpClick(Sender: TObject); procedure btTrgMoveDownClick(Sender: TObject); + procedure btTrgScaleUpClick(Sender: TObject); + procedure btTrgScaleDownClick(Sender: TObject); private bm: TBitmap; *************** *** 981,984 **** --- 986,990 ---- fx, fy: double; i: integer; + transformvalue: double; begin Scale(fx, fy, x, y, EditForm.GraphImage.Width, EditForm.GraphImage.Height); *************** *** 1003,1027 **** if Shift = [ssAlt] then begin ! MainTriangles[i] := RotateTriangleCenter(MainTriangles[i], -(PI / 20)); ! HasChanged := True; ! UpdateFlame(False); end else if Shift = [ssCtrl, ssAlt] then begin ! MainTriangles[i] := RotateTriangleCenter(MainTriangles[i], PI / 20); ! HasChanged := True; ! UpdateFlame(False); end else if Shift = [ssShift] then begin ! MainTriangles[i] := ScaleTriangleCenter(MainTriangles[i], 1.1); ! HasChanged := True; ! UpdateFlame(False); end else if Shift = [ssCtrl, ssShift] then begin ! MainTriangles[i] := ScaleTriangleCenter(MainTriangles[i], 0.9); ! HasChanged := True; ! UpdateFlame(False); end; end; --- 1009,1065 ---- if Shift = [ssAlt] then begin ! try ! transformvalue := StrToFloat(txtTrgRotateValue.Text); ! except ! transformvalue := 0; ! txtTrgRotateValue.Text := '0'; ! end; ! if transformvalue <> 0 then ! begin ! MainTriangles[i] := RotateTriangleCenter(MainTriangles[i], -((PI/180) * transformvalue)); ! HasChanged := True; ! end; end else if Shift = [ssCtrl, ssAlt] then begin ! try ! transformvalue := StrToFloat(txtTrgRotateValue.Text); ! except ! transformvalue := 0; ! txtTrgRotateValue.Text := '0'; ! end; ! if transformvalue <> 0 then ! begin ! MainTriangles[i] := RotateTriangleCenter(MainTriangles[i], (PI/180) * transformvalue); ! HasChanged := True; ! end; end else if Shift = [ssShift] then begin ! try ! transformvalue := StrToFloat(txtTrgScaleValue.Text); ! except ! transformvalue := 0.0; ! txtTrgScaleValue.Text := '0.0'; ! end; ! if transformvalue <> 0 then ! begin ! MainTriangles[i] := ScaleTriangleCenter(MainTriangles[i], transformvalue+1.0); ! HasChanged := True; ! end; end else if Shift = [ssCtrl, ssShift] then begin ! try ! transformvalue := StrToFloat(txtTrgScaleValue.Text); ! except ! transformvalue := 0.0; ! txtTrgScaleValue.Text := '0.0'; ! end; ! if transformvalue <> 0 then ! begin ! MainTriangles[i] := ScaleTriangleCenter(MainTriangles[i], 1.0-transformvalue); ! HasChanged := True; ! end; end; end; *************** *** 1036,1064 **** procedure TEditForm.mnuRotateRightClick(Sender: TObject); begin ! MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], -(PI / 20)); ! HasChanged := True; ! UpdateFlame(true); end; procedure TEditForm.mnuRotateLeftClick(Sender: TObject); begin ! MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], PI / 20); ! HasChanged := True; ! UpdateFlame(true); end; procedure TEditForm.mnuScaleUpClick(Sender: TObject); begin ! MainTriangles[SelectedTriangle] := ScaleTriangleCenter(MainTriangles[SelectedTriangle], 1.1); ! HasChanged := True; ! UpdateFlame(true); end; procedure TEditForm.mnuScaleDownClick(Sender: TObject); begin ! MainTriangles[SelectedTriangle] := ScaleTriangleCenter(MainTriangles[SelectedTriangle], 0.9); ! HasChanged := True; ! UpdateFlame(true); end; --- 1074,1146 ---- procedure TEditForm.mnuRotateRightClick(Sender: TObject); + var + offset: double; begin ! try ! offset := StrToFloat(txtTrgRotateValue.Text); ! except ! offset := 0; ! txtTrgRotateValue.Text := '0'; ! end; ! if offset <> 0 then ! begin ! MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], -((PI/180) * offset)); ! HasChanged := True; ! UpdateFlame(true); ! end; end; procedure TEditForm.mnuRotateLeftClick(Sender: TObject); + var + offset: double; begin ! try ! offset := StrToFloat(txtTrgRotateValue.Text); ! except ! offset := 0; ! txtTrgRotateValue.Text := '0'; ! end; ! if offset <> 0 then ! begin ! MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], (PI/180) * offset); ! HasChanged := True; ! UpdateFlame(true); ! end; end; procedure TEditForm.mnuScaleUpClick(Sender: TObject); + var + scale: double; begin ! try ! scale := StrToFloat(txtTrgScaleValue.Text); ! except ! scale := 0.0; ! txtTrgScaleValue.Text := '0.0'; ! end; ! if scale <> 0 then ! begin ! MainTriangles[SelectedTriangle] := ScaleTriangleCenter(MainTriangles[SelectedTriangle], scale+1.0); ! HasChanged := True; ! UpdateFlame(true); ! end; end; procedure TEditForm.mnuScaleDownClick(Sender: TObject); + var + scale: double; begin ! try ! scale := StrToFloat(txtTrgScaleValue.Text); ! except ! scale := 0.0; ! txtTrgScaleValue.Text := '0.0'; ! end; ! if scale <> 0 then ! begin ! MainTriangles[SelectedTriangle] := ScaleTriangleCenter(MainTriangles[SelectedTriangle], 1.0-scale); ! HasChanged := True; ! UpdateFlame(true); ! end; end; *************** *** 1964,1968 **** if offset <> 0 then begin ! MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], (PI/180) * offset); HasChanged := True; UpdateFlame(true); end; --- 2046,2051 ---- if offset <> 0 then begin ! MainTriangles[SelectedTriangle] := RotateTriangleCenter(MainTriangles[SelectedTriangle], (PI/180) * offset); ! HasChanged := True; UpdateFlame(true); end; *************** *** 2071,2074 **** --- 2154,2193 ---- end; + procedure TEditForm.btTrgScaleUpClick(Sender: TObject); + var + scale: double; + begin + try + scale := StrToFloat(txtTrgScaleValue.Text); + except + scale := 0.0; + txtTrgScaleValue.Text := '0.0'; + end; + if scale <> 0 then + begin + MainTriangles[SelectedTriangle] := ScaleTriangleCenter(MainTriangles[SelectedTriangle], scale+1.0); + HasChanged := True; + UpdateFlame(true); + end; + end; + + procedure TEditForm.btTrgScaleDownClick(Sender: TObject); + var + scale: double; + begin + try + scale := StrToFloat(txtTrgScaleValue.Text); + except + scale := 0.0; + txtTrgScaleValue.Text := '0.0'; + end; + if scale <> 0 then + begin + MainTriangles[SelectedTriangle] := ScaleTriangleCenter(MainTriangles[SelectedTriangle], 1.0-scale); + HasChanged := True; + UpdateFlame(true); + end; + end; + end. |