本文整理汇总了C++中CComboBox::GetItemDataPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::GetItemDataPtr方法的具体用法?C++ CComboBox::GetItemDataPtr怎么用?C++ CComboBox::GetItemDataPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::GetItemDataPtr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateData
void CAntiVirus::UpdateData(CComboBox& wndAntiVirus)
{
if ( ! ::IsWindow( wndAntiVirus.GetSafeHwnd() ) )
return;
if ( wndAntiVirus.IsWindowEnabled() )
{
Settings.General.AntiVirus = *(CString*)wndAntiVirus.GetItemDataPtr( wndAntiVirus.GetCurSel() );
}
}
示例2: Free
void CAntiVirus::Free(CComboBox& wndAntiVirus)
{
if ( ! ::IsWindow( wndAntiVirus.GetSafeHwnd() ) )
return;
const int nCount = wndAntiVirus.GetCount();
for ( int i = 0; i < nCount; ++i )
{
delete (CString*)wndAntiVirus.GetItemDataPtr( i );
}
}
示例3: OnBnClickedBtConvert
//----- OnBnClickedBtConvert() ----------------------------------------------
void CFormChunkMergeView::OnBnClickedBtConvert()
{
Configuration* pConfig (Configuration::getInstance());
CComboBox* pCBox ((CComboBox*) GetDlgItem(IDC_CB_MAT_SINGLE));
NifCollisionUtility ncUtility(*(NifUtlMaterialList::getInstance()));
map<int, unsigned int> materialMap;
unsigned short ncReturn (NCU_OK);
// store data
UpdateData(TRUE);
// build full texture path and set to utility
ncUtility.setSkyrimPath(pConfig->getPathTextures());
// set callback for log info
ncUtility.setLogCallback(logCallback);
// get material handling
MaterialTypeHandling matHandling((MaterialTypeHandling) (GetCheckedRadioButton(IDC_RD_MAT_SINGLE, IDC_RD_MAT_DEFINE) - IDC_RD_MAT_SINGLE));
// set default material
materialMap[-1] = ((unsigned int) pCBox->GetItemDataPtr(pCBox->GetCurSel()));
// add additional materials in case of special handling
if (matHandling == NCU_MT_MATMAP)
{
// do something special
}
// set flags
ncUtility.setCollisionNodeHandling((CollisionNodeHandling) (GetCheckedRadioButton(IDC_RD_COLL_CDATA, IDC_RD_COLL_MESH) - IDC_RD_COLL_CDATA));
ncUtility.setMaterialTypeHandling (matHandling, materialMap);
ncUtility.setDefaultMaterial (materialMap[-1]);
ncUtility.setMergeCollision (((CButton*) GetDlgItem(IDC_RD_COLL_GLOBAL)) ->GetCheck() == TRUE);
ncUtility.setReorderTriangles (((CButton*) GetDlgItem(IDC_CK_REORDER_TRIS))->GetCheck() == TRUE);
// add collision data to nif
ncReturn = ncUtility.addCollision(CStringA(_fileNameColl).GetString(), CStringA(_fileNameIn).GetString(), pConfig->getPathTemplates() + "\\" + CStringA(_template).GetString());
// decode result
if (ncReturn == NCU_OK)
{
LogMessageObject::LogMessage(NCU_MSG_TYPE_SUCCESS, "Collision data added successfully");
}
else
{
LogMessageObject::LogMessage(NCU_MSG_TYPE_ERROR, "NifCollision returned code: %d", ncReturn);
}
LogMessageObject::LogMessage(NCU_MSG_TYPE_INFO, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
}
示例4: OnSelendokCbParentmodel
// change parent of model instance
void CDlgClient::OnSelendokCbParentmodel()
{
CComboBox *cbParentModel = ((CComboBox*)GetDlgItem(IDC_CB_PARENTMODEL));
wchar_t strParentName[256];
INDEX iCurSelected = cbParentModel->GetCurSel();
// no selection
if(iCurSelected < 0)
return;
// get curent selected in combo box
cbParentModel->GetLBText(iCurSelected,&strParentName[0]);
// curent selected in combo box has pointer of model instance that is selected
CModelInstance *pmiNewParent = (CModelInstance*)cbParentModel->GetItemDataPtr(iCurSelected);
// get curent parent of this model instance
CModelInstance *pmiOldParent = pmiSelected->GetParent(theApp.GetDocument()->m_ModelInstance);
// if no parent
if(pmiOldParent == NULL)
{
theApp.ErrorMessage("Can't move root object!");
return;
}
// old parent is same as new parent
if(pmiNewParent == pmiOldParent)
{
theApp.ErrorMessage("New parent is same as old one");
return;
}
// new parent is same as selected model instance
if(pmiNewParent == pmiSelected)
{
theApp.ErrorMessage("Can't attach object to himself!");
return;
}
// check if pmiNewParent if child of pmiSelected
if(pmiNewParent->GetParent(pmiSelected) != NULL)
{
theApp.ErrorMessage("Can't attach object to his child!");
return;
}
CSkeleton *psklParent = pmiNewParent->mi_psklSkeleton;
SkeletonLOD *psklodParent = NULL;
INDEX iParentBoneID = 0;
if(psklParent != NULL)
{
// if parent has skeleton lods
INDEX ctslod = psklParent->skl_aSkeletonLODs.Count();
if(ctslod > 0)
{
psklodParent = &psklParent->skl_aSkeletonLODs[0];
INDEX ctsb = psklodParent->slod_aBones.Count();
// if parent has any bones
if(ctsb > 0)
{
SkeletonBone &sb = psklodParent->slod_aBones[0];
iParentBoneID = sb.sb_iID;
}
}
}
// change parent of model instance (pmiSelected)
pmiSelected->ChangeParent(pmiOldParent,pmiNewParent);
pmiSelected->mi_iParentBoneID = iParentBoneID;
// if pmiSelected wasn't added as include of parent
if(pmiSelected->mi_fnSourceFile == pmiOldParent->mi_fnSourceFile)
{
pmiSelected->mi_fnSourceFile = pmiNewParent->mi_fnSourceFile;
}
// update model instance
theApp.UpdateRootModelInstance();
CSeriousSkaStudioDoc *pDoc = theApp.GetDocument();
pDoc->MarkAsChanged();
}