本文整理汇总了C++中CComboBox::GetItemData方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::GetItemData方法的具体用法?C++ CComboBox::GetItemData怎么用?C++ CComboBox::GetItemData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::GetItemData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSaveTexture
void CTextureTool::OnSaveTexture ()
{
if (!GetMine ())
return;
HINSTANCE hInst = AfxGetApp()->m_hInstance;
char t1Name [20],
t2Name [20];
CDSide *side = m_mine->CurrSide ();
CComboBox *pcb;
save_texture1 = side->nBaseTex & 0x3fff;
save_texture2 = side->nOvlTex & 0x3fff;
int i;
for (i = 0; i < 4; i++)
save_uvls [i].l = side->uvls [i].l;
//CBTexture1 ()->SelectString (-1, texture_name1);
//CBTexture2 ()->SelectString (-1, texture_name2);
pcb = CBTexture1 ();
LoadString (hInst, texture_resource + pcb->GetItemData (pcb->GetCurSel ()), t1Name, sizeof (t1Name));
pcb = CBTexture2 ();
if (i = pcb->GetItemData (pcb->GetCurSel ()))
LoadString (hInst, texture_resource + i, t2Name, sizeof (t2Name));
else
strcpy (t2Name, "(none)");
sprintf(m_szTextureBuf ,"%s,%s", t1Name, t2Name);
UpdateData (FALSE);
//SaveTextureStatic->SetText(message);
}
示例2: OnInitDialog
LRESULT FindView::OnInitDialog(UINT/*uMsg*/, WPARAM/*wParam*/, LPARAM/*lParam*/, BOOL&/*bHandled*/)
{
this->SetWindowText(_T("Find View"));
updateDimensionList();
CComboBox cb = GetDlgItem(IDC_DIMENSION_COMBO);
if (cb.GetCount() > 0)
{
int index = CB_ERR;
if (!m_settings->getValue(_T("DefaultDimension")).empty())
{
index = cb.FindStringExact(-1, m_settings->getValue(_T("DefaultDimension")).c_str());
}
if (index == CB_ERR)
{
index = 0;
}
cb.SetCurSel(index);
updateCharList(cb.GetItemData(index));
m_lastQueryDimension = cb.GetItemData(index);
CComboBox toon_combo = GetDlgItem(IDC_CHARCOMBO);
if (toon_combo.GetCount() > 0)
{
toon_combo.SetCurSel(0);
}
}
DlgResize_Init(false, true, WS_CLIPCHILDREN);
return 0;
}
示例3: Set
void CDlgAdminCharSkillHEAL::Set(CInfoSkillBase *pSrc)
{
int i, nNo, nCount;
DWORD dwTmp;
CComboBox *pCombo;
PCInfoSkillHEAL pSrcTmp = (PCInfoSkillHEAL)pSrc;
m_dwValue1 = pSrcTmp->m_dwValue1; /* 効果1 */
m_dwValue2 = pSrcTmp->m_dwValue2; /* 効果2 */
m_dwDistance = pSrcTmp->m_dwDistance; /* 射程距離 */
/* ヒット時の表示エフェクト */
pCombo = &m_ctlHitEffect;
nNo = 0;
nCount = pCombo->GetCount ();
for (i = 0; i < nCount; i ++) {
dwTmp = pCombo->GetItemData (i);
if (pSrcTmp->m_dwHitEffectID == dwTmp) {
nNo = i;
break;
}
}
pCombo->SetCurSel (nNo);
/* 回復種別 */
pCombo = &m_ctlHealType;
nNo = 0;
nCount = pCombo->GetCount ();
for (i = 0; i < nCount; i ++) {
dwTmp = pCombo->GetItemData (i);
if (pSrcTmp->m_dwHealType == dwTmp) {
nNo = i;
break;
}
}
pCombo->SetCurSel (nNo);
/* 範囲 */
pCombo = &m_ctlArea;
nNo = 0;
nCount = pCombo->GetCount ();
for (i = 0; i < nCount; i ++) {
dwTmp = pCombo->GetItemData (i);
if (pSrcTmp->m_dwArea == dwTmp) {
nNo = i;
break;
}
}
pCombo->SetCurSel (nNo);
UpdateData (FALSE);
}
示例4: OnKillActive
BOOL CPreferencesOnlinePage::OnKillActive()
{
BOOL bValidData = TRUE;
INHERITED::OnKillActive();
if(m_bVisitedThisPage)
{
CConnectionSettings::Type connectType = CConnectionSettings::typeNone;
CComboBox *pDialupsCombo;
CString csFileName;
pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS);
connectType = (CConnectionSettings::Type) pDialupsCombo->GetItemData(m_nCurDialup);
if(m_comboDialups.IsWindowEnabled() &&
connectType == CConnectionSettings::typeModemCustom)
{
csFileName = m_pConnSettings->GetAppFileName();
if(!Util::FileExists(csFileName))
{
CString csResource;
LoadConfigurationString(IDS_ONLINE_MISSING_APPPATH, csResource);
ASSERT(!csResource.IsEmpty());
AfxMessageBox(csResource);
csResource.Empty();
csFileName.Empty();
bValidData = FALSE;
}
}
}
return bValidData;
}
示例5: GetValue
DWORD CTabCharacteristicsDlg::GetValue(CComboBox &cb)
{
int nIndex = cb.GetCurSel();
if (nIndex == CB_ERR)
return(-1);
return(cb.GetItemData(nIndex));
}
示例6: LoadDefaultCodec
static void LoadDefaultCodec(CAtlArray<Codec>& codecs, CComboBox& box, const GUID& cat)
{
int len = box.GetCount();
if (len >= 0) {
box.SetCurSel(0);
}
if (cat == GUID_NULL) {
return;
}
CString DisplayName = AfxGetApp()->GetProfileString(IDS_RS_CAPTURE _T("\\") + CStringFromGUID(cat), _T("DisplayName"));
for (int i = 0; i < len; i++) {
int iSel = box.GetItemData(i);
if (iSel < 0) {
continue;
}
Codec& c = codecs[iSel];
if (DisplayName == c.DisplayName) {
box.SetCurSel(i);
if (!c.pBF) {
c.pMoniker->BindToObject(NULL, NULL, __uuidof(IBaseFilter), (void**)&c.pBF);
}
break;
}
}
}
示例7: EditValue
BOOL CTabCharacteristicsDlg::EditValue(CComboBox &cb, DWORD &dwCurrentValue, BOOL &bKnownFlag, int nPad)
{
CSetValueDlg d;
d.SetCombo(&cb);
if (bKnownFlag)
d.SetCurrentValue(dwCurrentValue,nPad);
else
{
int nIndex = cb.GetCurSel();
if (nIndex == -1)
return(FALSE);
d.SetCurrentValue(cb.GetItemData(nIndex),nPad);
}
if (d.DoModal() != IDOK)
return(FALSE);
dwCurrentValue = d.GetValue();
if (!SetValue(dwCurrentValue,cb))
bKnownFlag = TRUE;
else
bKnownFlag = FALSE;
return(TRUE);
}
示例8: OnRestrictArrival
// Goober5000
void wing_editor::OnRestrictArrival()
{
int arrive_from_ship;
CComboBox *box;
restrict_paths dlg;
// grab stuff from GUI
UpdateData(TRUE);
if (m_arrival_location != ARRIVE_FROM_DOCK_BAY)
{
Int3();
return;
}
box = (CComboBox *) GetDlgItem(IDC_ARRIVAL_TARGET);
if (box->GetCount() == 0)
return;
arrive_from_ship = box->GetItemData(m_arrival_target);
if (!ship_has_dock_bay(arrive_from_ship))
{
Int3();
return;
}
dlg.m_arrival = true;
dlg.m_ship_class = Ships[arrive_from_ship].ship_info_index;
dlg.m_path_mask = &Wings[cur_wing].arrival_path_mask;
dlg.DoModal();
}
示例9: OnRestrictDeparture
// Goober5000
void wing_editor::OnRestrictDeparture()
{
int depart_to_ship;
CComboBox *box;
restrict_paths dlg;
// grab stuff from GUI
UpdateData(TRUE);
if (m_departure_location != DEPART_AT_DOCK_BAY)
{
Int3();
return;
}
box = (CComboBox *) GetDlgItem(IDC_DEPARTURE_TARGET);
if (box->GetCount() == 0)
return;
depart_to_ship = box->GetItemData(m_departure_target);
if (!ship_has_dock_bay(depart_to_ship))
{
Int3();
return;
}
dlg.m_arrival = false;
dlg.m_ship_class = Ships[depart_to_ship].ship_info_index;
dlg.m_path_mask = &Wings[cur_wing].departure_path_mask;
dlg.DoModal();
}
示例10: GetComboBoxValue
DWORD CValueList::GetComboBoxValue(CComboBox &cb)
{
int nIndex = cb.GetCurSel();
if (nIndex == CB_ERR)
return(-1);
return(cb.GetItemData(nIndex));
}
示例11: GetDlgItem
void CID3v2Page1::OnSelchangeCmbRating()
{
CComboBox *pCBox = (CComboBox*) GetDlgItem(IDC_LIST_RATING);
int nIndex = pCBox->GetCurSel();
m_nRating = pCBox->GetItemData( nIndex );
}
示例12: OnOK
void CMidiSetupDlg::OnOK()
//------------------------
{
CComboBox *combo;
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
m_dwMidiSetup = 0;
m_nMidiDevice = MIDI_MAPPER;
if (IsDlgButtonChecked(IDC_CHECK1)) m_dwMidiSetup |= MIDISETUP_RECORDVELOCITY;
if (IsDlgButtonChecked(IDC_CHECK2)) m_dwMidiSetup |= MIDISETUP_RECORDNOTEOFF;
if (IsDlgButtonChecked(IDC_CHECK3)) m_dwMidiSetup |= MIDISETUP_AMPLIFYVELOCITY;
if (IsDlgButtonChecked(IDC_CHECK4)) m_dwMidiSetup |= MIDISETUP_TRANSPOSEKEYBOARD;
if (IsDlgButtonChecked(IDC_MIDI_TO_PLUGIN)) m_dwMidiSetup |= MIDISETUP_MIDITOPLUG;
if (IsDlgButtonChecked(IDC_MIDI_MACRO_CONTROL)) m_dwMidiSetup |= MIDISETUP_MIDIMACROCONTROL;
if (IsDlgButtonChecked(IDC_MIDIVOL_TO_NOTEVOL)) m_dwMidiSetup |= MIDISETUP_MIDIVOL_TO_NOTEVOL;
if (IsDlgButtonChecked(IDC_MIDIPLAYCONTROL)) m_dwMidiSetup |= MIDISETUP_RESPONDTOPLAYCONTROLMSGS;
if (IsDlgButtonChecked(IDC_MIDIPLAYPATTERNONMIDIIN)) m_dwMidiSetup |= MIDISETUP_PLAYPATTERNONMIDIIN;
if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
{
int n = combo->GetCurSel();
if (n >= 0) m_nMidiDevice = combo->GetItemData(n);
}
if (pMainFrm) pMainFrm->SetupMidi(m_dwMidiSetup, m_nMidiDevice);
CPropertyPage::OnOK();
}
示例13: onDimensionSelection
LRESULT FindView::onDimensionSelection(WORD/*wNotifyCode*/, WORD/*wID*/, HWND/*hWndCtl*/, BOOL&/*bHandled*/)
{
CComboBox cb = GetDlgItem(IDC_DIMENSION_COMBO);
unsigned int dimension_id = 0;
int item = -1;
if ((item = cb.GetCurSel()) != CB_ERR)
{
dimension_id = (unsigned int)cb.GetItemData(item);
TCHAR buffer[256];
cb.GetLBText(item, buffer);
m_settings->setValue(_T("DefaultDimension"), buffer);
}
updateCharList(dimension_id);
CComboBox toon_combo = GetDlgItem(IDC_CHARCOMBO);
if (toon_combo.GetCount() > 0)
{
toon_combo.SetCurSel(0);
}
if (dimension_id != m_lastQueryDimension)
{
UpdateFindQuery();
}
return 0;
}
示例14: OnCbnDropdown
LRESULT FindView::OnCbnDropdown(WORD/*wNotifyCode*/, WORD/*wID*/, HWND/*hWndCtl*/, BOOL&/*bHandled*/)
{
CComboBox cb = GetDlgItem(IDC_DIMENSION_COMBO);
int item;
if ((item = cb.GetCurSel()) != CB_ERR)
{
unsigned int dimension_id = (unsigned int)cb.GetItemData(item);
CComboBox toon_combo = GetDlgItem(IDC_CHARCOMBO);
unsigned int char_id = toon_combo.GetItemData(toon_combo.GetCurSel());
updateCharList(dimension_id);
bool found = false;
for (int i = 0; i < toon_combo.GetCount(); ++i)
{
unsigned int data = toon_combo.GetItemData(i);
if (data == char_id)
{
toon_combo.SetCurSel(i);
found = true;
break;
}
}
if (!found)
{
toon_combo.SetCurSel(0);
}
}
return 0;
}
示例15: OnCbnSelchangeImageExt
void CMainDlg::OnCbnSelchangeImageExt()
{
CComboBox* pCombo = NULL;
VERIFY(pCombo = (CComboBox*)GetDlgItem(IDC_IMAGE_EXT));
int iSel = pCombo->GetCurSel();
ASSERT(iSel != -1);
m_clsidImgType = *(CLSID*)pCombo->GetItemData(iSel);
}