2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
26 ===========================================================================
29 #include "../../idlib/precompiled.h"
32 #include "../../sys/win32/rc/AFEditor_resource.h"
35 #include "DialogAFConstraint.h"
36 #include "DialogAFConstraintSpring.h"
39 // DialogAFConstraintSpring dialog
41 toolTip_t DialogAFConstraintSpring::toolTips[] = {
42 { IDC_RADIO_ANCHOR_JOINT, "use the position of a joint for the first anchor" },
43 { IDC_COMBO_ANCHOR_JOINT, "first anchor joint name" },
44 { IDC_RADIO_ANCHOR_COORDINATES, "use absolute coordinates for the first anchor" },
45 { IDC_EDIT_ANCHOR_X, "first anchor x-coordinate" },
46 { IDC_EDIT_ANCHOR_Y, "first anchor y-coordinate" },
47 { IDC_EDIT_ANCHOR_Z, "first anchor z-coordinate" },
48 { IDC_RADIO_ANCHOR2_JOINT, "use the position of a joint for the second anchor" },
49 { IDC_COMBO_ANCHOR2_JOINT, "second anchor joint name" },
50 { IDC_RADIO_ANCHOR2_COORDINATES, "use absolute coordinates for the second anchor" },
51 { IDC_EDIT_ANCHOR2_X, "second anchor x-coordinate" },
52 { IDC_EDIT_ANCHOR2_Y, "second anchor y-coordinate" },
53 { IDC_EDIT_ANCHOR2_Z, "second anchor z-coordinate" },
54 { IDC_EDIT_SPRING_STRETCH, "spring constant when stretched" },
55 { IDC_EDIT_SPRING_COMPRESS, "spring constant when compressed" },
56 { IDC_EDIT_SPRING_DAMPING, "spring damping" },
57 { IDC_EDIT_SPRING_REST_LENGTH, "rest length" },
58 { IDC_RADIO_SPRING_NO_MIN_LENGTH, "no minimum length" },
59 { IDC_RADIO_SPRING_MIN_LENGTH, "minimum length" },
60 { IDC_EDIT_SPRING_MIN_LENGTH, "minimum length" },
61 { IDC_RADIO_SPRING_NO_MAX_LENGTH, "no maximum length" },
62 { IDC_RADIO_SPRING_MAX_LENGTH, "maximum length" },
63 { IDC_EDIT_SPRING_MAX_LENGTH, "maximum length" },
67 IMPLEMENT_DYNAMIC(DialogAFConstraintSpring, CDialog)
71 DialogAFConstraintSpring::DialogAFConstraintSpring
74 DialogAFConstraintSpring::DialogAFConstraintSpring(CWnd* pParent /*=NULL*/)
75 : CDialog(DialogAFConstraintSpring::IDD, pParent)
91 Create( IDD_DIALOG_AF_CONSTRAINT_SPRING, pParent );
92 EnableToolTips( TRUE );
97 DialogAFConstraintSpring::~DialogAFConstraintSpring
100 DialogAFConstraintSpring::~DialogAFConstraintSpring() {
105 DialogAFConstraintSpring::DoDataExchange
108 void DialogAFConstraintSpring::DoDataExchange(CDataExchange* pDX) {
109 CDialog::DoDataExchange(pDX);
110 //{{AFX_DATA_MAP(DialogAFConstraintSpring)
111 DDX_Control(pDX, IDC_COMBO_ANCHOR_JOINT, m_comboAnchorJoint);
112 DDX_Control(pDX, IDC_COMBO_ANCHOR2_JOINT, m_comboAnchor2Joint);
113 DDX_Text(pDX, IDC_EDIT_ANCHOR_X, m_anchor_x);
114 DDX_Text(pDX, IDC_EDIT_ANCHOR_Y, m_anchor_y);
115 DDX_Text(pDX, IDC_EDIT_ANCHOR_Z, m_anchor_z);
116 DDX_Text(pDX, IDC_EDIT_ANCHOR2_X, m_anchor2_x);
117 DDX_Text(pDX, IDC_EDIT_ANCHOR2_Y, m_anchor2_y);
118 DDX_Text(pDX, IDC_EDIT_ANCHOR2_Z, m_anchor2_z);
119 DDX_Text(pDX, IDC_EDIT_SPRING_STRETCH, m_stretch);
120 DDX_Text(pDX, IDC_EDIT_SPRING_COMPRESS, m_compress);
121 DDX_Text(pDX, IDC_EDIT_SPRING_DAMPING, m_damping);
122 DDX_Text(pDX, IDC_EDIT_SPRING_REST_LENGTH, m_restLength);
123 DDX_Text(pDX, IDC_EDIT_SPRING_MIN_LENGTH, m_minLength);
124 DDX_Text(pDX, IDC_EDIT_SPRING_MAX_LENGTH, m_maxLength);
130 DialogAFConstraintSpring::InitJointLists
133 void DialogAFConstraintSpring::InitJointLists( void ) {
134 m_comboAnchorJoint.ResetContent();
135 m_comboAnchor2Joint.ResetContent();
141 const idRenderModel *model = gameEdit->ANIM_GetModelFromName( file->model );
146 int numJoints = model->NumJoints();
147 for ( int i = 0; i < numJoints; i++ ) {
148 const char *jointName = model->GetJointName( (jointHandle_t) i );
149 m_comboAnchorJoint.AddString( jointName );
150 m_comboAnchor2Joint.AddString( jointName );
156 DialogAFConstraintSpring::LoadFile
159 void DialogAFConstraintSpring::LoadFile( idDeclAF *af ) {
167 DialogAFConstraintSpring::SaveFile
170 void DialogAFConstraintSpring::SaveFile( void ) {
176 DialogAFConstraintSpring::LoadConstraint
179 void DialogAFConstraintSpring::LoadConstraint( idDeclAF_Constraint *c ) {
184 // load first anchor from the current idDeclAF_Constraint
185 SetSafeComboBoxSelection( &m_comboAnchorJoint, constraint->anchor.joint1.c_str(), -1 );
186 m_anchor_x = constraint->anchor.ToVec3().x;
187 m_anchor_y = constraint->anchor.ToVec3().y;
188 m_anchor_z = constraint->anchor.ToVec3().z;
189 if ( constraint->anchor.type == idAFVector::VEC_JOINT ) {
190 i = IDC_RADIO_ANCHOR_JOINT;
193 i = IDC_RADIO_ANCHOR_COORDINATES;
195 CheckRadioButton( IDC_RADIO_ANCHOR_JOINT, IDC_RADIO_ANCHOR_COORDINATES, i );
197 // load second anchor from the current idDeclAF_Constraint
198 SetSafeComboBoxSelection( &m_comboAnchor2Joint, constraint->anchor2.joint1.c_str(), -1 );
199 m_anchor2_x = constraint->anchor2.ToVec3().x;
200 m_anchor2_y = constraint->anchor2.ToVec3().y;
201 m_anchor2_z = constraint->anchor2.ToVec3().z;
202 if ( constraint->anchor2.type == idAFVector::VEC_JOINT ) {
203 i = IDC_RADIO_ANCHOR2_JOINT;
206 i = IDC_RADIO_ANCHOR2_COORDINATES;
208 CheckRadioButton( IDC_RADIO_ANCHOR2_JOINT, IDC_RADIO_ANCHOR2_COORDINATES, i );
211 m_stretch = constraint->stretch;
212 m_compress = constraint->compress;
213 m_damping = constraint->damping;
214 m_restLength = constraint->restLength;
217 if ( constraint->minLength > 0.0f ) {
218 i = IDC_RADIO_SPRING_MIN_LENGTH;
221 i = IDC_RADIO_SPRING_NO_MIN_LENGTH;
223 CheckRadioButton( IDC_RADIO_SPRING_NO_MIN_LENGTH, IDC_RADIO_SPRING_MIN_LENGTH, i );
224 m_minLength = constraint->minLength;
226 if ( constraint->maxLength > 0.0f ) {
227 i = IDC_RADIO_SPRING_MAX_LENGTH;
230 i = IDC_RADIO_SPRING_NO_MAX_LENGTH;
232 CheckRadioButton( IDC_RADIO_SPRING_NO_MAX_LENGTH, IDC_RADIO_SPRING_MAX_LENGTH, i );
233 m_maxLength = constraint->maxLength;
235 // update displayed values
241 DialogAFConstraintSpring::SaveConstraint
244 void DialogAFConstraintSpring::SaveConstraint( void ) {
247 if ( !file || !constraint ) {
252 // save first anchor to the current idDeclAF_Constraint
253 GetSafeComboBoxSelection( &m_comboAnchorJoint, str, -1 );
254 constraint->anchor.joint1 = str;
255 constraint->anchor.ToVec3().x = m_anchor_x;
256 constraint->anchor.ToVec3().y = m_anchor_y;
257 constraint->anchor.ToVec3().z = m_anchor_z;
259 // save second anchor to the current idDeclAF_Constraint
260 GetSafeComboBoxSelection( &m_comboAnchor2Joint, str, -1 );
261 constraint->anchor2.joint1 = str;
262 constraint->anchor2.ToVec3().x = m_anchor2_x;
263 constraint->anchor2.ToVec3().y = m_anchor2_y;
264 constraint->anchor2.ToVec3().z = m_anchor2_z;
267 constraint->stretch = m_stretch;
268 constraint->compress = m_compress;
269 constraint->damping = m_damping;
270 constraint->restLength = m_restLength;
273 constraint->minLength = m_minLength;
274 constraint->maxLength = m_maxLength;
276 AFDialogSetFileModified();
281 DialogAFConstraintSpring::UpdateFile
284 void DialogAFConstraintSpring::UpdateFile( void ) {
287 gameEdit->AF_UpdateEntities( file->GetName() );
293 DialogAFConstraintSpring::OnToolHitTest
296 int DialogAFConstraintSpring::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const {
297 CDialog::OnToolHitTest( point, pTI );
298 return DefaultOnToolHitTest( toolTips, this, point, pTI );
302 BEGIN_MESSAGE_MAP(DialogAFConstraintSpring, CDialog)
303 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
304 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
305 ON_BN_CLICKED(IDC_RADIO_ANCHOR_JOINT, OnBnClickedRadioAnchorJoint)
306 ON_BN_CLICKED(IDC_RADIO_ANCHOR_COORDINATES, OnBnClickedRadioAnchorCoordinates)
307 ON_CBN_SELCHANGE(IDC_COMBO_ANCHOR_JOINT, OnCbnSelchangeComboAnchorJoint)
308 ON_EN_CHANGE(IDC_EDIT_ANCHOR_X, OnEnChangeEditAnchorX)
309 ON_EN_CHANGE(IDC_EDIT_ANCHOR_Y, OnEnChangeEditAnchorY)
310 ON_EN_CHANGE(IDC_EDIT_ANCHOR_Z, OnEnChangeEditAnchorZ)
311 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR_X, OnDeltaposSpinAnchorX)
312 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR_Y, OnDeltaposSpinAnchorY)
313 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR_Z, OnDeltaposSpinAnchorZ)
314 ON_BN_CLICKED(IDC_RADIO_ANCHOR2_JOINT, OnBnClickedRadioAnchor2Joint)
315 ON_BN_CLICKED(IDC_RADIO_ANCHOR2_COORDINATES, OnBnClickedRadioAnchor2Coordinates)
316 ON_CBN_SELCHANGE(IDC_COMBO_ANCHOR2_JOINT, OnCbnSelchangeComboAnchor2Joint)
317 ON_EN_CHANGE(IDC_EDIT_ANCHOR2_X, OnEnChangeEditAnchor2X)
318 ON_EN_CHANGE(IDC_EDIT_ANCHOR2_Y, OnEnChangeEditAnchor2Y)
319 ON_EN_CHANGE(IDC_EDIT_ANCHOR2_Z, OnEnChangeEditAnchor2Z)
320 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR2_X, OnDeltaposSpinAnchor2X)
321 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR2_Y, OnDeltaposSpinAnchor2Y)
322 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR2_Z, OnDeltaposSpinAnchor2Z)
323 ON_EN_CHANGE(IDC_EDIT_SPRING_STRETCH, OnEnChangeEditSpringStretch)
324 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_SPRING_STRETCH, OnDeltaposSpinSpringStretch)
325 ON_EN_CHANGE(IDC_EDIT_SPRING_COMPRESS, OnEnChangeEditSpringCompress)
326 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_SPRING_COMPRESS, OnDeltaposSpinSpringCompress)
327 ON_EN_CHANGE(IDC_EDIT_SPRING_DAMPING, OnEnChangeEditSpringDamping)
328 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_SPRING_DAMPING, OnDeltaposSpinSpringDamping)
329 ON_EN_CHANGE(IDC_EDIT_SPRING_REST_LENGTH, OnEnChangeEditSpringRestLength)
330 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_SPRING_REST_LENGTH, OnDeltaposSpinSpringRestLength)
331 ON_BN_CLICKED(IDC_RADIO_SPRING_NO_MIN_LENGTH, OnBnClickedRadioLimitNoMinLength)
332 ON_BN_CLICKED(IDC_RADIO_SPRING_MIN_LENGTH, OnBnClickedRadioLimitMinLength)
333 ON_EN_CHANGE(IDC_EDIT_SPRING_MIN_LENGTH, OnEnChangeEditLimitMinLength)
334 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_SPRING_MIN_LENGTH, OnDeltaposSpinLimitMinLength)
335 ON_BN_CLICKED(IDC_RADIO_SPRING_NO_MAX_LENGTH, OnBnClickedRadioLimitNoMaxLength)
336 ON_BN_CLICKED(IDC_RADIO_SPRING_MAX_LENGTH, OnBnClickedRadioLimitMaxLength)
337 ON_EN_CHANGE(IDC_EDIT_SPRING_MAX_LENGTH, OnEnChangeEditLimitMaxLength)
338 ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_SPRING_MAX_LENGTH, OnDeltaposSpinLimitMaxLength)
342 // DialogAFConstraintSpring message handlers
344 BOOL DialogAFConstraintSpring::OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ) {
345 return DefaultOnToolTipNotify( toolTips, id, pNMHDR, pResult );
348 void DialogAFConstraintSpring::OnBnClickedRadioAnchorJoint() {
349 if ( IsDlgButtonChecked( IDC_RADIO_ANCHOR_JOINT ) ) {
351 constraint->anchor.type = idAFVector::VEC_JOINT;
357 void DialogAFConstraintSpring::OnBnClickedRadioAnchorCoordinates() {
358 if ( IsDlgButtonChecked( IDC_RADIO_ANCHOR_COORDINATES ) ) {
360 constraint->anchor.type = idAFVector::VEC_COORDS;
366 void DialogAFConstraintSpring::OnCbnSelchangeComboAnchorJoint() {
370 void DialogAFConstraintSpring::OnEnChangeEditAnchorX() {
371 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_X ) ) ) {
375 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_X ) );
379 void DialogAFConstraintSpring::OnEnChangeEditAnchorY() {
380 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Y ) ) ) {
384 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Y ) );
388 void DialogAFConstraintSpring::OnEnChangeEditAnchorZ() {
389 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Z ) ) ) {
393 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Z ) );
397 void DialogAFConstraintSpring::OnDeltaposSpinAnchorX(NMHDR *pNMHDR, LRESULT *pResult) {
398 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
399 if ( pNMUpDown->iDelta < 0 ) {
410 void DialogAFConstraintSpring::OnDeltaposSpinAnchorY(NMHDR *pNMHDR, LRESULT *pResult) {
411 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
412 if ( pNMUpDown->iDelta < 0 ) {
423 void DialogAFConstraintSpring::OnDeltaposSpinAnchorZ(NMHDR *pNMHDR, LRESULT *pResult) {
424 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
425 if ( pNMUpDown->iDelta < 0 ) {
436 void DialogAFConstraintSpring::OnBnClickedRadioAnchor2Joint() {
437 if ( IsDlgButtonChecked( IDC_RADIO_ANCHOR2_JOINT ) ) {
439 constraint->anchor2.type = idAFVector::VEC_JOINT;
445 void DialogAFConstraintSpring::OnBnClickedRadioAnchor2Coordinates() {
446 if ( IsDlgButtonChecked( IDC_RADIO_ANCHOR2_COORDINATES ) ) {
448 constraint->anchor2.type = idAFVector::VEC_COORDS;
454 void DialogAFConstraintSpring::OnCbnSelchangeComboAnchor2Joint() {
458 void DialogAFConstraintSpring::OnEnChangeEditAnchor2X() {
459 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR2_X ) ) ) {
463 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR2_X ) );
467 void DialogAFConstraintSpring::OnEnChangeEditAnchor2Y() {
468 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR2_Y ) ) ) {
472 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR2_Y ) );
476 void DialogAFConstraintSpring::OnEnChangeEditAnchor2Z() {
477 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR2_Z ) ) ) {
481 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR2_Z ) );
485 void DialogAFConstraintSpring::OnDeltaposSpinAnchor2X(NMHDR *pNMHDR, LRESULT *pResult) {
486 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
487 if ( pNMUpDown->iDelta < 0 ) {
498 void DialogAFConstraintSpring::OnDeltaposSpinAnchor2Y(NMHDR *pNMHDR, LRESULT *pResult) {
499 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
500 if ( pNMUpDown->iDelta < 0 ) {
511 void DialogAFConstraintSpring::OnDeltaposSpinAnchor2Z(NMHDR *pNMHDR, LRESULT *pResult) {
512 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
513 if ( pNMUpDown->iDelta < 0 ) {
524 void DialogAFConstraintSpring::OnEnChangeEditSpringStretch() {
525 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_STRETCH ) ) ) {
529 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_STRETCH ) );
533 void DialogAFConstraintSpring::OnDeltaposSpinSpringStretch(NMHDR *pNMHDR, LRESULT *pResult) {
534 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
535 m_stretch = EditSpinFloat( (CEdit *)GetDlgItem( IDC_EDIT_SPRING_STRETCH ), pNMUpDown->iDelta < 0 );
540 void DialogAFConstraintSpring::OnEnChangeEditSpringCompress() {
541 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_COMPRESS ) ) ) {
545 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_COMPRESS ) );
549 void DialogAFConstraintSpring::OnDeltaposSpinSpringCompress(NMHDR *pNMHDR, LRESULT *pResult) {
550 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
551 m_compress = EditSpinFloat( (CEdit *)GetDlgItem( IDC_EDIT_SPRING_COMPRESS ), pNMUpDown->iDelta < 0 );
556 void DialogAFConstraintSpring::OnEnChangeEditSpringDamping() {
557 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_DAMPING ) ) ) {
561 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_DAMPING ) );
565 void DialogAFConstraintSpring::OnDeltaposSpinSpringDamping(NMHDR *pNMHDR, LRESULT *pResult) {
566 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
567 m_damping = EditSpinFloat( (CEdit *)GetDlgItem( IDC_EDIT_SPRING_DAMPING ), pNMUpDown->iDelta < 0 );
572 void DialogAFConstraintSpring::OnEnChangeEditSpringRestLength() {
573 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_REST_LENGTH ) ) ) {
577 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_REST_LENGTH ) );
581 void DialogAFConstraintSpring::OnDeltaposSpinSpringRestLength(NMHDR *pNMHDR, LRESULT *pResult) {
582 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
583 if ( pNMUpDown->iDelta < 0 ) {
584 m_restLength += 1.0f;
587 m_restLength -= 1.0f;
594 void DialogAFConstraintSpring::OnBnClickedRadioLimitNoMinLength() {
595 if ( IsDlgButtonChecked( IDC_RADIO_SPRING_NO_MIN_LENGTH ) ) {
597 constraint->minLength = 0.0f;
603 void DialogAFConstraintSpring::OnBnClickedRadioLimitMinLength() {
607 void DialogAFConstraintSpring::OnEnChangeEditLimitMinLength() {
608 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_MIN_LENGTH ) ) ) {
612 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_MIN_LENGTH ) );
616 void DialogAFConstraintSpring::OnDeltaposSpinLimitMinLength(NMHDR *pNMHDR, LRESULT *pResult) {
617 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
618 if ( pNMUpDown->iDelta < 0 ) {
629 void DialogAFConstraintSpring::OnBnClickedRadioLimitNoMaxLength() {
630 if ( IsDlgButtonChecked( IDC_RADIO_SPRING_NO_MAX_LENGTH ) ) {
632 constraint->maxLength = 0.0f;
638 void DialogAFConstraintSpring::OnBnClickedRadioLimitMaxLength() {
642 void DialogAFConstraintSpring::OnEnChangeEditLimitMaxLength() {
643 if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_MAX_LENGTH ) ) ) {
647 EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_SPRING_MAX_LENGTH ) );
651 void DialogAFConstraintSpring::OnDeltaposSpinLimitMaxLength(NMHDR *pNMHDR, LRESULT *pResult) {
652 LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
653 if ( pNMUpDown->iDelta < 0 ) {