fixed a scrollbar bug,

disabled postcoefs (again)
This commit is contained in:
zueuk 2006-03-18 18:05:15 +00:00
parent a9aeab94ad
commit ff2002f7d2
2 changed files with 45 additions and 21 deletions

View File

@ -1229,8 +1229,10 @@ object EditForm: TEditForm
Height = 21
Hint = 'Reset vector X'
Caption = 'X'
Enabled = False
ParentShowHint = False
ShowHint = True
Visible = False
OnClick = btnXpostClick
end
object btnYpost: TSpeedButton
@ -1240,8 +1242,10 @@ object EditForm: TEditForm
Height = 21
Hint = 'Reset vector Y'
Caption = 'Y'
Enabled = False
ParentShowHint = False
ShowHint = True
Visible = False
OnClick = btnYpostClick
end
object btnOpost: TSpeedButton
@ -1251,8 +1255,10 @@ object EditForm: TEditForm
Height = 21
Hint = 'Reset vector O'
Caption = 'O'
Enabled = False
ParentShowHint = False
ShowHint = True
Visible = False
OnClick = btnOpostClick
end
object btnResetPostXForm: TSpeedButton
@ -1262,8 +1268,10 @@ object EditForm: TEditForm
Height = 22
Hint = 'Reset post-transform vectors to defaults'
Caption = 'Reset post-transform'
Enabled = False
ParentShowHint = False
ShowHint = True
Visible = False
OnClick = btnResetPostXFormClick
end
object btnSwapXforms: TSpeedButton
@ -1273,6 +1281,7 @@ object EditForm: TEditForm
Height = 22
Hint = 'Swap Xform with PostXform'
Caption = '[ Xform <-> PostXform ]'
Enabled = False
Flat = True
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
@ -1282,6 +1291,7 @@ object EditForm: TEditForm
ParentFont = False
ParentShowHint = False
ShowHint = True
Visible = False
OnClick = btnSwapXformsClick
end
object pnlWeight: TPanel
@ -1393,8 +1403,10 @@ object EditForm: TEditForm
Top = 188
Width = 57
Height = 21
Enabled = False
TabOrder = 8
Text = '0'
Visible = False
OnExit = PostCoefValidate
OnKeyPress = PostCoefKeypress
end
@ -1403,8 +1415,10 @@ object EditForm: TEditForm
Top = 188
Width = 57
Height = 21
Enabled = False
TabOrder = 9
Text = '0'
Visible = False
OnExit = PostCoefValidate
OnKeyPress = PostCoefKeypress
end
@ -1413,8 +1427,10 @@ object EditForm: TEditForm
Top = 212
Width = 57
Height = 21
Enabled = False
TabOrder = 10
Text = '0'
Visible = False
OnExit = PostCoefValidate
OnKeyPress = PostCoefKeypress
end
@ -1423,8 +1439,10 @@ object EditForm: TEditForm
Top = 212
Width = 57
Height = 21
Enabled = False
TabOrder = 11
Text = '0'
Visible = False
OnExit = PostCoefValidate
OnKeyPress = PostCoefKeypress
end
@ -1433,8 +1451,10 @@ object EditForm: TEditForm
Top = 236
Width = 57
Height = 21
Enabled = False
TabOrder = 12
Text = '0'
Visible = False
OnExit = PostCoefValidate
OnKeyPress = PostCoefKeypress
end
@ -1443,8 +1463,10 @@ object EditForm: TEditForm
Top = 236
Width = 57
Height = 21
Enabled = False
TabOrder = 13
Text = '0'
Visible = False
OnExit = PostCoefValidate
OnKeyPress = PostCoefKeypress
end

View File

@ -314,7 +314,6 @@ type
private
TriangleView: TCustomDrawControl;
cmap: TColorMap;
// cp1: TControlPoint;
PreviewDensity: double;
// --Z--
@ -322,6 +321,7 @@ type
editMode, oldMode: (modeNone, modeMove, modeRotate, modeScale, modePick);
modeKey: word;
key_handled: boolean;
updating: boolean;
MousePos: TPoint; // in screen coordinates
mouseOverTriangle, mouseOverCorner: integer;
@ -670,6 +670,8 @@ var
v: double;
strval: string;
begin
updating := true;
if (SelectedTriangle > LastTriangle) then SelectedTriangle := LastTriangle;
cbTransforms.ItemIndex := SelectedTriangle;
@ -761,6 +763,8 @@ begin
end;
PageControl.Refresh;
updating := false;
end;
procedure TEditForm.Scale(var fx, fy: double; x, y: integer);
@ -782,7 +786,7 @@ begin
yminz := 0;
xmaxz := 0;
ymaxz := 0;
for i := -1 to Transforms - 1 do
for i := -1 to LastTriangle do
begin
for j := 0 to 2 do
begin
@ -810,19 +814,6 @@ procedure TEditForm.UpdateFlameX;
var
i: integer;
begin
for i := 0 to Transforms do
begin
// CP_compute(cp1, Triangles[i], Triangles[-1], i);
solve3(MainTriangles[-1].x[0], MainTriangles[-1].y[0], MainTriangles[i].x[0],
MainTriangles[-1].x[1], MainTriangles[-1].y[1], MainTriangles[i].x[1],
MainTriangles[-1].x[2], MainTriangles[-1].y[2], MainTriangles[i].x[2],
cp.xform[i].c[0][0], cp.xform[i].c[1][0], cp.xform[i].c[2][0]);
solve3(MainTriangles[-1].x[0], MainTriangles[-1].y[0], MainTriangles[i].y[0],
MainTriangles[-1].x[1], MainTriangles[-1].y[1], MainTriangles[i].y[1],
MainTriangles[-1].x[2], MainTriangles[-1].y[2], MainTriangles[i].y[2],
cp.xform[i].c[0][1], cp.xform[i].c[1][1], cp.xform[i].c[2][1]);
end;
cp.GetFromTriangles(MainTriangles, Transforms);
if not chkPreserve.checked then cp.ComputeWeights(MainTriangles, Transforms);
DrawPreview;
@ -2008,9 +1999,13 @@ begin
MainForm.UpdateUndo;
MainTriangles[Transforms+1] := MainTriangles[Transforms];
cp.xform[Transforms+1].Assign(cp.xform[Transforms]);
MainTriangles[Transforms] := MainTriangles[SelectedTriangle];
cp.xform[Transforms].Assign(cp.xform[SelectedTriangle]);
SelectedTriangle := Transforms;
if SelectedTriangle <> Transforms then
begin
MainTriangles[Transforms] := MainTriangles[SelectedTriangle];
cp.xform[Transforms].Assign(cp.xform[SelectedTriangle]);
SelectedTriangle := Transforms;
end
else cp.xform[Transforms].density := 0.5;
Inc(Transforms);
cbTransforms.clear;
for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i));
@ -2526,6 +2521,8 @@ procedure TEditForm.scrlXFormColorChange(Sender: TObject);
var
v: double;
begin
if updating then exit;
v := (scrlXFormColor.Position) / scrlXFormColor.Max;
cp.xform[SelectedTriangle].color := v;
pnlXFormColor.color := ColorValToColor(MainCp.cmap, v);
@ -3812,7 +3809,8 @@ begin
pnlDragPos := 0;
pnlDragOld := x;
varMM := false;
SetCaptureControl(TControl(Sender));
//SetCaptureControl(TControl(Sender));
Screen.Cursor := crHSplit;
GetCursorPos(mousepos); // hmmm
HasChanged := false;
@ -3862,9 +3860,12 @@ begin
else if v > 1 then v := 1;
cp.xform[SelectedTriangle].color := v;
pnlXFormColor.Color := ColorValToColor(cp.cmap, v);
updating := true;
scrlXformColor.Position := round(v*1000);
pEdit := @txtXformColor;
end;
updating := false;
end
else assert(false);
pEdit^.Text := FloatToStr(v); // Format('%.6g', [v])
//pEdit.Refresh;
HasChanged := True;
@ -3879,7 +3880,8 @@ begin
if pnlDragMode then
begin
SetCaptureControl(nil);
//SetCaptureControl(nil);
pnlDragMode := false;
Screen.Cursor := crDefault;