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); }
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; }
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); }
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; }
DWORD CTabCharacteristicsDlg::GetValue(CComboBox &cb) { int nIndex = cb.GetCurSel(); if (nIndex == CB_ERR) return(-1); return(cb.GetItemData(nIndex)); }
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; } } }
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); }
// 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(); }
// 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(); }
DWORD CValueList::GetComboBoxValue(CComboBox &cb) { int nIndex = cb.GetCurSel(); if (nIndex == CB_ERR) return(-1); return(cb.GetItemData(nIndex)); }
void CID3v2Page1::OnSelchangeCmbRating() { CComboBox *pCBox = (CComboBox*) GetDlgItem(IDC_LIST_RATING); int nIndex = pCBox->GetCurSel(); m_nRating = pCBox->GetItemData( nIndex ); }
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(); }
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; }
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; }
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); }
int GetItemData(CComboBox& wnd, BOOL* pError) { int nCur = wnd.GetCurSel(); if(pError) *pError = nCur>=0; if(nCur>=0) return wnd.GetItemData(nCur); return 0; }
//------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ int FindComboItemByData ( CComboBox & ComboBox, DWORD Value ) { for ( int i = 0; i < ComboBox.GetCount (); ++i ) { if (ComboBox.GetItemData (i) == Value) return i; } return CB_ERR; }
static void SelectLanguage(CComboBox &combobox, LONG langueage) { for (int i = 0; i < combobox.GetCount(); ++i) { if (combobox.GetItemData(i) == langueage) { combobox.SetCurSel(i); break; } } }
void CImageProcessDlg::OnCbnSelchangeCmbFrameSpeed() { if(m_pDevice != NULL) { CComboBox *pComboSpeed = (CComboBox *)GetDlgItem(IDC_CMB_FRAMESPEED); int nCurSel = pComboSpeed->GetCurSel(); emDeviceFrameSpeed dSpeed = (emDeviceFrameSpeed)pComboSpeed->GetItemData(nCurSel); if(FAILED(m_pDevice->SetFrameSpeed(dSpeed))) { ::AfxMessageBox(_T("当前设备不支持该速度模式,或者请切换数据类型后再试!"), MB_ICONERROR|MB_OK); UpdateControls(); } } }
void SetCurSelItemData(CComboBox& wnd, DWORD_PTR nItemData) { int nItems = wnd.GetCount(); for(int i=0;i<nItems;i++) { if(wnd.GetItemData(i) == nItemData) { wnd.SetCurSel(i); return; } } }
void CBerkeleyView::OnBnClickedButton1() { CString csDbFile; GetDlgItem(IDC_DB_FILE)->GetWindowTextW(csDbFile); if (!csDbFile.IsEmpty()) { if (m_spDb.get() != NULL) { m_spDb->DestroyDb(); } m_spDb.reset(new CDbLayer_Test()); m_spDb->InitDb(csDbFile); CComboBox* pBox = (CComboBox*)GetDlgItem(IDC_DATA_TYPE); m_spDb->SetDecoder((DataDecoder::DataEncodeType)pBox->GetItemData(pBox->GetCurSel())); CListBox* pList = (CListBox*)GetDlgItem(IDC_LIST_DB_CONTENT); pList->ResetContent(); std::vector<tstring> data = m_spDb->GetFirstData(); if (data.size() > 0) { tstring line = _T("1 "); for(int i = 0; i < data.size(); ++i) { line.append(data[i].size() > 50 ? data[i].substr(0, 50) + _T("...") : data[i]); line.append(_T(" ")); } pList->AddString(line.c_str()); } int nLine = 1; data = m_spDb->GetNextData(); while(nLine < 1000 && data.size() > 0) { CString csNum; csNum.Format(_T("%d "), nLine+1); tstring line = csNum; for(int i = 0; i < data.size(); ++i) { line.append(data[i].size() > 50 ? data[i].substr(0, 50) + _T("...") : data[i]); line.append(_T(" ")); } pList->AddString(line.c_str()); data = m_spDb->GetNextData(); ++nLine; } } }
inline long finditemdata( CComboBox& cb, DWORD dwItemdata ) { long n = cb.GetCount(); long i; for( i = 0; i < n; i++ ) { if( cb.GetItemData( i ) == dwItemdata ) return i; } return LB_ERR; }
void CDlgRename::OnFormatPredefined() { CComboBox* pCBox = (CComboBox *) GetDlgItem( IDC_CMB_FORMATS ); int nIndex = pCBox->GetCurSel(); if( nIndex != CB_ERR ) { CFormat* pFormat = (CFormat *) pCBox->GetItemData( nIndex ); GetDlgItem( IDC_EDIT_NEW_NAME )->SetWindowText( pFormat->GetFilename( m_pMp3 )); } SetMode(FORMAT_PREDEFINED); }
UINT CLogClassFilterEditDlg::GetLogClass(int comboID) { CComboBox combo = (HWND)GetDlgItem(comboID); int index = combo.GetCurSel(); if (index >= 0) { return combo.GetItemData(index); } CStringW text; combo.GetWindowText(text); return wcstoul(text, NULL, 10); }
void CImageProcessDlg::UpdateControls() { BOOL bMonochrome = m_pDevice->IsMonochromeDevice(); UCHAR RGain = 0, GGain = 0, BGain = 0; if(!bMonochrome) m_pDevice->GetGain(&RGain, &GGain, &BGain); SetGainCtrl(RGain, GGain, BGain); FLOAT fGamma; m_pDevice->GetGamma(&fGamma); SetGammaCtrl(fGamma); SHORT shContrast = 0; if(!bMonochrome) m_pDevice->GetContrast(&shContrast); SetContrastCtrl(shContrast); BOOL bEnable = FALSE; BYTE Saturation = 0; if(!bMonochrome) m_pDevice->GetSaturation(&Saturation); if(!bMonochrome) m_pDevice->GetSaturationState(&bEnable); CheckDlgButton(IDC_CHK_SATURATION, bEnable); m_ctrlSaturation.EnableWindow(bEnable); SetSaturationCtrl(Saturation); m_pDevice->GetMirror(MD_HORIZONTAL, &bEnable); CheckDlgButton(IDC_HFLIP, bEnable); m_pDevice->GetMirror(MD_VERTICAL, &bEnable); CheckDlgButton(IDC_VFLIP, bEnable); if(!bMonochrome) m_pDevice->GetMonochrome(&bEnable); else bEnable = FALSE; CheckDlgButton(IDC_MONO, bEnable); m_pDevice->GetInverse(&bEnable); CheckDlgButton(IDC_INVERSE, bEnable); emDeviceFrameSpeed devSpeed = HIGH_SPEED; m_pDevice->GetFrameSpeed(&devSpeed); CComboBox *pComboSpeed = (CComboBox *)GetDlgItem(IDC_CMB_FRAMESPEED); if(pComboSpeed != NULL) { int nCount = pComboSpeed->GetCount(); for(int i = 0; i < nCount; ++i) { if(pComboSpeed->GetItemData(i) == devSpeed) { pComboSpeed->SetCurSel(i); break; } } } float fSpeedTune; m_pDevice->GetFrameSpeedTune(&fSpeedTune); SetSpeedTuneCtrl(fSpeedTune); }
void CDlgRename::OnDestroy() { CDialog::OnDestroy(); // Destruction des formats CComboBox* pCBox = (CComboBox *) GetDlgItem( IDC_CMB_FORMATS ); for( int i = 0 ; i < pCBox->GetCount() ; i++ ) { CFormat* pFormat = (CFormat *) pCBox->GetItemData( i ); delete pFormat; } }
CString CRcGen::GetCtrlValueByName(LPCTSTR szIdCtrl) { CString sVal; int idx; CTelaAtual *pTa = NULL; mapTelaAtual.Lookup(CString(szIdCtrl), pTa); //cControles ctrl = arrControles[pTa->nIdCtrlArray]; if(!pTa) return L""; CComboBox* cmbCtrl; CButton* button; switch(pTa->tipoCtrl) { case TEXTO: case TEXTO_MULTILINHA: pTa->wndControl->GetWindowText(sVal); return sVal; break; case COMBO: case COMBO_EDITAVEL: cmbCtrl = (CComboBox*)pTa->wndControl; idx = cmbCtrl->GetCurSel(); if(idx != CB_ERR) { sVal.Format(L"%d", cmbCtrl->GetItemData(idx)); return sVal; } else return L""; break; case CHECK: case RADIO: //sVal = ctrl.sBDValue; button = (CButton*)pTa->wndControl; if(button->GetCheck() == TRUE) return L"1"; else return L"0"; break; } return L""; }
void CPreferencesOnlinePage::OnSelchangeDialupConnections() { BOOL bEnableAdvanced = FALSE; CComboBox *pDialupsCombo; CConnectionSettings::Type connectType = CConnectionSettings::typeNone; UpdateData(TRUE); pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS); connectType = (CConnectionSettings::Type) pDialupsCombo->GetItemData(m_nCurDialup); if(connectType != CConnectionSettings::typeModemDialup) bEnableAdvanced = TRUE; m_btnAdvanced.EnableWindow(bEnableAdvanced); m_pConnSettings->SetType(connectType); m_pConnSettings->GetSettings(); }
BOOL CTabCharacteristicsDlg::SetValue(int nValue, CComboBox &cb) { int nCount = cb.GetCount(); for (int i=0;i<nCount;i++) if ((int)cb.GetItemData(i) == nValue) { cb.SetCurSel(i); cb.EnableWindow(TRUE); return(TRUE); } cb.SetCurSel(-1); cb.EnableWindow(FALSE); return(FALSE); }
//================================================= // Message Handlers //================================================= void CMainDlg::OnDestroy() { CDialog::OnDestroy(); GetControlValues(); // Clean up CLSIDs in combobox CComboBox* pCombo = NULL; VERIFY(pCombo = (CComboBox*)GetDlgItem(IDC_IMAGE_EXT)); while(pCombo->GetCount() > 0) { CLSID* pCLSID = (CLSID*)pCombo->GetItemData(0); delete pCLSID; pCombo->DeleteString(0); } }