本文整理汇总了C++中GetSafeComboBoxSelection函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSafeComboBoxSelection函数的具体用法?C++ GetSafeComboBoxSelection怎么用?C++ GetSafeComboBoxSelection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSafeComboBoxSelection函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateData
/*
================
DialogAFConstraintSpring::SaveConstraint
================
*/
void DialogAFConstraintSpring::SaveConstraint( void ) {
CString str;
if ( !file || !constraint ) {
return;
}
UpdateData( TRUE );
// save first anchor to the current idDeclAF_Constraint
GetSafeComboBoxSelection( &m_comboAnchorJoint, str, -1 );
constraint->anchor.joint1 = str;
constraint->anchor.ToVec3().x = m_anchor_x;
constraint->anchor.ToVec3().y = m_anchor_y;
constraint->anchor.ToVec3().z = m_anchor_z;
// save second anchor to the current idDeclAF_Constraint
GetSafeComboBoxSelection( &m_comboAnchor2Joint, str, -1 );
constraint->anchor2.joint1 = str;
constraint->anchor2.ToVec3().x = m_anchor2_x;
constraint->anchor2.ToVec3().y = m_anchor2_y;
constraint->anchor2.ToVec3().z = m_anchor2_z;
// spring settings
constraint->stretch = m_stretch;
constraint->compress = m_compress;
constraint->damping = m_damping;
constraint->restLength = m_restLength;
// spring limits
constraint->minLength = m_minLength;
constraint->maxLength = m_maxLength;
AFDialogSetFileModified();
}
示例2: UpdateData
/*
================
DialogAFConstraintBallAndSocket::SaveConstraint
================
*/
void DialogAFConstraintBallAndSocket::SaveConstraint( void ) {
int s1, s2;
CString str;
idAngles angles;
if ( !file || !constraint ) {
return;
}
UpdateData( TRUE );
// anchor
GetSafeComboBoxSelection( &m_comboAnchorJoint, str, -1 );
constraint->anchor.joint1 = str;
constraint->anchor.ToVec3().x = m_anchor_x;
constraint->anchor.ToVec3().y = m_anchor_y;
constraint->anchor.ToVec3().z = m_anchor_z;
// limit
if ( constraint->limit == idDeclAF_Constraint::LIMIT_CONE ) {
constraint->limitAngles[0] = m_coneAngle;
}
else {
constraint->limitAngles[0] = m_pyramidAngle1;
}
constraint->limitAngles[1] = m_pyramidAngle2;
constraint->limitAngles[2] = m_limitRoll;
angles.pitch = m_limitPitch;
angles.yaw = m_limitYaw;
angles.roll = 0.0f;
constraint->limitAxis.ToVec3() = angles.ToForward();
s1 = GetSafeComboBoxSelection( &m_comboLimitJoint1, str, -1 );
constraint->limitAxis.joint1 = str;
s2 = GetSafeComboBoxSelection( &m_comboLimitJoint2, str, s1 );
constraint->limitAxis.joint2 = str;
// limit axis
if ( constraint->shaft[0].type == idAFVector::VEC_BONEDIR ) {
s1 = GetSafeComboBoxSelection( &m_comboLimitAxisJoint1, str, -1 );
constraint->shaft[0].joint1 = str;
s2 = GetSafeComboBoxSelection( &m_comboLimitAxisJoint2, str, s1 );
constraint->shaft[0].joint2 = str;
}
else {
constraint->shaft[0].ToVec3() = idAngles( m_limitAxisPitch, m_limitAxisYaw, 0.0f ).ToForward();
}
AFDialogSetFileModified();
}
示例3: UpdateData
/*
================
DialogAFConstraintSlider::SaveConstraint
================
*/
void DialogAFConstraintSlider::SaveConstraint( void ) {
int s1, s2;
CString str;
if ( !file || !constraint ) {
return;
}
UpdateData( TRUE );
// slider axis
if ( constraint->axis.type == idAFVector::VEC_BONEDIR ) {
s1 = GetSafeComboBoxSelection( &m_comboAxisJoint1, str, -1 );
constraint->axis.joint1 = str;
s2 = GetSafeComboBoxSelection( &m_comboAxisJoint2, str, s1 );
constraint->axis.joint2 = str;
}
else {
constraint->axis.ToVec3() = idAngles( m_axisPitch, m_axisYaw, 0.0f ).ToForward();
}
AFDialogSetFileModified();
}
示例4: UpdateData
/*
================
DialogAFConstraint::SaveConstraint
================
*/
void DialogAFConstraint::SaveConstraint( void ) {
int s1, s2;
CString str;
if ( !file || !constraint ) {
return;
}
UpdateData( TRUE );
// save constraint type to the current idDeclAF_Constraint
GetSafeComboBoxSelection( &m_comboConstraintType, str, -1 );
constraint->type = StringToConstraintType( str );
// save constrained bodies to the current idDeclAF_Constraint
s1 = GetSafeComboBoxSelection( &m_comboBody1List, str, -1 );
constraint->body1 = str;
s2 = GetSafeComboBoxSelection( &m_comboBody2List, str, s1 );
constraint->body2 = str;
// save friction to the current idDeclAF_Constraint
constraint->friction = m_friction;
AFDialogSetFileModified();
}
示例5: GetSafeComboBoxSelection
void DialogAFConstraintUniversal::OnCbnSelchangeComboUniversalLimitJoint2() {
CString str;
GetSafeComboBoxSelection( &m_comboLimitJoint2, str, -1 );
UnsetSafeComboBoxSelection( &m_comboLimitJoint1, str );
UpdateFile();
}
示例6: GetSafeComboBoxSelection
void DialogAFConstraintBallAndSocket::OnCbnSelchangeComboBasLimitAxisJoint2() {
CString str;
GetSafeComboBoxSelection( &m_comboLimitAxisJoint2, str, -1 );
UnsetSafeComboBoxSelection( &m_comboLimitAxisJoint1, str );
UpdateFile();
}
示例7: GetSafeComboBoxSelection
void DialogAFConstraint::OnCbnSelchangeComboConstraintBody2() {
CString str;
GetSafeComboBoxSelection( &m_comboBody2List, str, -1 );
UnsetSafeComboBoxSelection( &m_comboBody1List, str );
UpdateFile();
}
示例8: GetSafeComboBoxSelection
void DialogAFBody::OnCbnSelchangeComboBoneJoint2() {
CString str;
GetSafeComboBoxSelection( &cm_comboBoneJoint2, str, -1 );
UnsetSafeComboBoxSelection( &cm_comboBoneJoint1, str );
UpdateFile();
}
示例9: UpdateData
/*
================
DialogAFBody::SaveBody
================
*/
void DialogAFBody::SaveBody( void ) {
int s1, s2;
CString str;
if( !file || !body ) {
return;
}
UpdateData( TRUE );
// save the collision model to the current idDeclAF_Body
cm_comboType.GetLBText( cm_comboType.GetCurSel(), str );
body->modelType = StringToModelType( str );
if( body->modelType == TRM_BONE ) {
body->origin.type = idAFVector::VEC_BONECENTER;
s1 = GetSafeComboBoxSelection( &cm_comboBoneJoint1, str, -1 );
body->v1.type = idAFVector::VEC_JOINT;
body->v1.joint1 = str;
body->origin.joint1 = str;
s2 = GetSafeComboBoxSelection( &cm_comboBoneJoint2, str, s1 );
body->v2.type = idAFVector::VEC_JOINT;
body->v2.joint1 = str;
body->origin.joint2 = str;
body->width = cm_width;
body->angles.Zero();
} else {
body->v1.type = idAFVector::VEC_COORDS;
body->v1.ToVec3().x = -0.5f * cm_length;
body->v1.ToVec3().y = -0.5f * cm_width;
body->v1.ToVec3().z = -0.5f * cm_height;
body->v2.type = idAFVector::VEC_COORDS;
body->v2.ToVec3().x = 0.5f * cm_length;
body->v2.ToVec3().y = 0.5f * cm_width;
body->v2.ToVec3().z = 0.5f * cm_height;
body->origin.ToVec3().x = cm_origin_x;
body->origin.ToVec3().y = cm_origin_y;
body->origin.ToVec3().z = cm_origin_z;
body->angles.pitch = cm_angles_pitch;
body->angles.yaw = cm_angles_yaw;
body->angles.roll = cm_angles_roll;
if( body->origin.type == idAFVector::VEC_JOINT ) {
s1 = GetSafeComboBoxSelection( &cm_originJoint, str, -1 );
body->origin.joint1 = str;
} else {
s1 = GetSafeComboBoxSelection( &cm_originBoneCenterJoint1, str, -1 );
body->origin.joint1 = str;
}
s2 = GetSafeComboBoxSelection( &cm_originBoneCenterJoint2, str, s1 );
body->origin.joint2 = str;
}
body->numSides = cm_numSides;
body->density = cm_density;
cm_inertiaScale.GetWindowText( str );
if( idStr::Icmp( str, "none" ) == 0 ) {
body->inertiaScale.Identity();
} else {
idLexer src( str, str.GetLength(), "inertiaScale" );
src.SetFlags( LEXFL_NOERRORS | LEXFL_NOWARNINGS );
for( int i = 0; i < 3; i++ ) {
for( int j = 0; j < 3; j++ ) {
body->inertiaScale[i][j] = src.ParseFloat();
}
}
}
// save the collision detection settings to the current idDeclAF_Body
body->selfCollision = ( m_selfCollision != FALSE );
m_editContents.GetWindowText( str );
body->contents = idDeclAF::ContentsFromString( str );
m_editClipMask.GetWindowText( str );
body->clipMask = idDeclAF::ContentsFromString( str );
// save friction settings to the current idDeclAF_Body
body->linearFriction = m_linearFriction;
body->angularFriction = m_angularFriction;
body->contactFriction = m_contactFriction;
// friction direction and contact motor direction
m_frictionDirection.GetWindowText( str );
if( str.GetLength() != 0 ) {
body->frictionDirection.ToVec3().Zero();
sscanf( str, "%f %f %f", &body->frictionDirection.ToVec3().x, &body->frictionDirection.ToVec3().y, &body->frictionDirection.ToVec3().z );
}
m_contactMotorDirection.GetWindowText( str );
if( str.GetLength() != 0 ) {
body->contactMotorDirection.ToVec3().Zero();
sscanf( str, "%f %f %f", &body->contactMotorDirection.ToVec3().x, &body->contactMotorDirection.ToVec3().y, &body->contactMotorDirection.ToVec3().z );
}
// save joint settings to the current idDeclAF_Body
GetSafeComboBoxSelection( &m_comboModifiedJoint, str, -1 );
body->jointName = str;
m_editContainedJoints.GetWindowText( str );
body->containedJoints = str;
AFDialogSetFileModified();
}