本文整理汇总了C++中CComboBox::GetCurSel方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::GetCurSel方法的具体用法?C++ CComboBox::GetCurSel怎么用?C++ CComboBox::GetCurSel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::GetCurSel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCbnSelchangeComboSource
void CEasyClientDlg::OnCbnSelchangeComboSource()
{
CComboBox* pComboxMediaSource = (CComboBox*)GetDlgItem(IDC_COMBO_SOURCE);
CComboBox* pVideoCombo = (CComboBox*)GetDlgItem(IDC_COMBO_CAMERA) ;
CComboBox* pComboxAudioSource = (CComboBox*)GetDlgItem(IDC_COMBO_MIC) ;
CEdit* pEdtRtspSource = (CEdit*)GetDlgItem(IDC_EDIT_SREAM_URL);
if (NULL == pComboxMediaSource) return;
int iCount = pComboxMediaSource->GetCount();
int iSel = pComboxMediaSource->GetCurSel();
if (iSel == 0)
{
pVideoCombo->EnableWindow(TRUE);
pComboxAudioSource->EnableWindow(TRUE);
pEdtRtspSource->SetReadOnly(TRUE);
}
else
{
pVideoCombo->EnableWindow(FALSE);
pComboxAudioSource->EnableWindow(FALSE);
pEdtRtspSource->SetReadOnly(FALSE);
}
// if (NULL != pComboxAudioSource) pComboxAudioSource->ShowWindow(iSel == iCount-1?SW_HIDE:SW_SHOW);
// if (NULL != pEdtRtspSource) pEdtRtspSource->ShowWindow(iSel == iCount-1?SW_SHOW:SW_HIDE);
//
}
示例2: OnCbnSelchangeWield
void WeaponPage::OnCbnSelchangeWield()
{
// TODO: 在此加入控制項告知處理常式程式碼
CComboBox* pTB = (CComboBox*) GetDlgItem(IDC_Wield);
m_pCW->m_wield = ((WeaponWieldType) pTB->GetCurSel());
}
示例3: OnCloseupDgname
void CDGProp::OnCloseupDgname()
{
UpdateData(TRUE);
CComboBox* box = (CComboBox*)GetDlgItem(IDC_DGNAME);
int i = box->GetCurSel();
box->GetLBText(i, m_dgName);
}
示例4: OnCbnSelchangeSamples
void CInstrumentEditorDPCM::OnCbnSelchangeSamples()
{
CComboBox *m_pSampleBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_SAMPLES));
CComboBox *pPitchBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_PITCH));
int PrevSample = m_pInstrument->GetSample(m_iOctave, m_iSelectedKey);
int Sample = m_pSampleBox->GetCurSel();
if (Sample > 0) {
char Name[256];
m_pSampleBox->GetLBText(Sample, Name);
Name[2] = 0;
if (Name[0] == _T('0')) {
Name[0] = Name[1];
Name[1] = 0;
}
Sample = atoi(Name);
Sample++;
if (PrevSample == 0) {
int Pitch = pPitchBox->GetCurSel();
m_pInstrument->SetSamplePitch(m_iOctave, m_iSelectedKey, Pitch);
}
}
m_pInstrument->SetSample(m_iOctave, m_iSelectedKey, Sample);
UpdateKey(m_iSelectedKey);
}
示例5: GetFindText
int FindReplDlg::GetFindText(CComboBox& wnd, bsString& text)
{
int len;
char *tp;
int sel = wnd.GetCurSel();
if (sel == -1)
{
len = wnd.GetWindowTextLength()+1;
tp = new char[len];
wnd.GetWindowText(tp, len);
sel = wnd.FindStringExact(-1, tp);
if (sel == -1)
{
sel = wnd.InsertString(0, tp);
wnd.SetCurSel(sel);
}
int cnt;
while ((cnt = wnd.GetCount()) >= 20)
wnd.DeleteString(cnt-1);
}
else
{
len = wnd.GetLBTextLen(sel)+1;
tp = new char[len];
wnd.GetLBText(sel, tp);
}
text.Attach(tp);
return sel;
}
示例6: OnBnClickedAdd
void CInstrumentEditorDPCM::OnBnClickedAdd()
{
// Add sample to key list
CComboBox *pPitchBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_PITCH));
int Pitch = pPitchBox->GetCurSel();
if (GetDocument()->GetSampleSize(m_iSelectedSample) > 0) {
m_pInstrument->SetSample(m_iOctave, m_iSelectedKey, m_iSelectedSample + 1);
m_pInstrument->SetSamplePitch(m_iOctave, m_iSelectedKey, Pitch);
UpdateKey(m_iSelectedKey);
}
m_pSampleListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_SAMPLE_LIST));
m_pTableListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_TABLE));
if (m_iSelectedKey < 12 && m_iSelectedSample < MAX_DSAMPLES) {
m_pSampleListCtrl->SetItemState(m_iSelectedSample, 0, LVIS_FOCUSED | LVIS_SELECTED);
m_pTableListCtrl->SetItemState(m_iSelectedKey, 0, LVIS_FOCUSED | LVIS_SELECTED);
if (m_iSelectedSample < m_pSampleListCtrl->GetItemCount() - 1)
m_iSelectedSample++;
m_iSelectedKey++;
m_pSampleListCtrl->SetSelectionMark(m_iSelectedSample);
m_pTableListCtrl->SetSelectionMark(m_iSelectedKey);
m_pSampleListCtrl->SetItemState(m_iSelectedSample, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
m_pTableListCtrl->SetItemState(m_iSelectedKey, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
}
}
示例7: OnCbnSelchangeFont
void CConfigAppearance::OnCbnSelchangeFont()
{
CComboBox *pFontList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT));
pFontList->GetLBText(pFontList->GetCurSel(), m_strFont.data());
RedrawWindow();
SetModified();
}
示例8: GetDlgItem
void CDisplayResolutionPane::OnSelchangeCombo1() {
char str[32];
CComboBox* pCB = (CComboBox*) GetDlgItem(IDC_COMBO1);
pCB->GetLBText(pCB->GetCurSel(), str);
VisualGraphics* theVisualGraphics = VisualGraphics::getInstance();
UInt16 horizontalPixels;
UInt16 verticalPixels;
UInt16 bitsPerPixel;
UInt16 refreshRate;
theVisualGraphics->matchDisplayResolutionShowStrWithPrefs(str, horizontalPixels, verticalPixels, bitsPerPixel, refreshRate);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenWidth, horizontalPixels);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenHeight, verticalPixels);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenBitsPerPixel, bitsPerPixel);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenRefreshRate, refreshRate);
VisualDataStore::storePreferences();
UInt16 minBitsPerPixel = 24;
UInt16 maxBitsPerPixel = 32;
VisualDataStore::setPreferredDisplayResolution(minBitsPerPixel, maxBitsPerPixel, bitsPerPixel, horizontalPixels, verticalPixels);
}
示例9: GetDlgItem
void CID3v2Page1::OnSelchangeCmbRating()
{
CComboBox *pCBox = (CComboBox*) GetDlgItem(IDC_LIST_RATING);
int nIndex = pCBox->GetCurSel();
m_nRating = pCBox->GetItemData( nIndex );
}
示例10: OnCbnSelchangeQuality
void WeaponPage::OnCbnSelchangeQuality()
{
// TODO: 在此加入控制項告知處理常式程式碼
CComboBox* pTB = (CComboBox*) GetDlgItem(IDC_Quality);
m_pCW->setQuality((EquipQuality) pTB->GetCurSel());
}
示例11: OnCbnSelchangeReaderMembankData
//===========================================================================
void CFAVReaderDlg::OnCbnSelchangeReaderMembankData()
//===========================================================================
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CComboBox* pCbox = (CComboBox*)GetDlgItem(IDC_READER_MEMBANK_DATA);
CEdit* pEditAddress = (CEdit*)GetDlgItem(IDC_READER_ADDRESS_DATA);
CEdit* pEditLength = (CEdit*)GetDlgItem(IDC_READER_LENGTH_DATA);
switch (pCbox->GetCurSel()){
case 0:
pEditAddress->SetWindowText(_T("0"));
pEditLength->SetWindowText(_T("4"));
break;//0
case 1:
pEditAddress->SetWindowText(_T("2"));
pEditLength->SetWindowText(_T("6"));
break;//1
case 2:
pEditAddress->SetWindowText(_T("0"));
pEditLength->SetWindowText(_T("4"));
break;//2
case 3:
pEditAddress->SetWindowText(_T("0"));
pEditLength->SetWindowText(_T("1"));
break;//3
}
}
示例12: GetModelInput
void CModelInputDlg::GetModelInput(CModelInput& modelInput)
{
ASSERT(m_titleCtrlArray.GetSize() == m_varCtrlArray.GetSize());
ASSERT(m_titleCtrlArray.GetSize() == (int)m_variables.size());
ASSERT(m_bDefault == false);
modelInput = m_modelInput;
modelInput.clear();
for (int i = 0; i < m_varCtrlArray.GetSize(); i++)
{
int type = m_variables[i].GetType();
if (type != CModelInputParameterDef::kMVTitle &&
type != CModelInputParameterDef::kMVLine &&
type != CModelInputParameterDef::kMVStaticText)
{
string value;
switch (type)
{
case CModelInputParameterDef::kMVBool:
{
CComboBox* pCombo = (CComboBox*)m_varCtrlArray[i];
value = WBSF::ToString(pCombo->GetCurSel() == 0);
break;
}
case CModelInputParameterDef::kMVInt:
case CModelInputParameterDef::kMVReal:
case CModelInputParameterDef::kMVString:
case CModelInputParameterDef::kMVFile:
{
CCFLEdit* pEdit = (CCFLEdit*)m_varCtrlArray[i];
value = pEdit->GetString();
break;
}
case CModelInputParameterDef::kMVListByPos:
{
CCFLComboBox* pCombo = (CCFLComboBox*)m_varCtrlArray[i];
value = WBSF::ToString(pCombo->GetCurItemData());
break;
}
case CModelInputParameterDef::kMVListByString:
case CModelInputParameterDef::kMVListByCSV:
{
CCFLComboBox* pCombo = (CCFLComboBox*)m_varCtrlArray[i];
value = pCombo->GetString();
break;
}
default: ASSERT(false);
}
modelInput.push_back(CModelInputParam(m_variables[i].GetName(),/* m_variables[i].GetType(),*/ value));
}
}
}
示例13: OnOK
void CServiceManage::OnOK()
{
BOOL rc;
// TODO: Add extra validation here
UpdateData(TRUE);
CComboBox *cbStartup = (CComboBox *)GetDlgItem(IDC_COMBO_STARTUP);
if (cbStartup) {
m_nStartmode = cbStartup->GetCurSel();
} else {
m_nStartmode = CB_ERR;
}
if (m_nStartmode == CB_ERR) {
AfxMessageBox("Invalid startup mode !", MB_OK|MB_ICONWARNING);
return;
}
if (m_Codepage.IsEmpty()) {
AfxMessageBox("You must select a codepage type.", MB_OK|MB_ICONWARNING);
return;
}
CComboBox *cbCodepage = (CComboBox *)GetDlgItem(IDC_COMBO_CODEPAGE);
if (cbCodepage) {
int rc = cbCodepage->FindStringExact(-1, m_Codepage);
if (rc == CB_ERR) {
AfxMessageBox("Invalid codepage type: "+m_Codepage, MB_OK|MB_ICONWARNING);
return;
}
}
if (AfxMessageBox("Current service settings will be overwritten,\ndo you want continue ?",
MB_YESNO | MB_ICONQUESTION) != IDYES) {
return;
}
rc = Ext2SetGlobalProperty(
m_nStartmode,
(BOOLEAN)m_bReadonly,
(BOOLEAN)m_bExt3Writable,
m_Codepage.GetBuffer(CODEPAGE_MAXLEN),
m_sPrefix.GetBuffer(HIDINGPAT_LEN),
m_sSuffix.GetBuffer(HIDINGPAT_LEN),
(BOOLEAN)m_bAutoMount
);
if (rc) {
/*
AfxMessageBox("Ext2 service settings updated successfully !",
MB_OK | MB_ICONINFORMATION);
*/
CDialog::OnOK();
} else {
AfxMessageBox("Failed to save the service settings !",
MB_OK | MB_ICONWARNING);
}
}
示例14: 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);
}
示例15: GetSelectedDeviceName
CString COptsAudioDlg::GetSelectedDeviceName(CComboBox& Combo, const CDSDeviceInfoArray& DevInfo)
{
CString name;
int iSelDev = Combo.GetCurSel();
if (iSelDev >= 0 && iSelDev < DevInfo.GetSize()) // if valid selection
name = DevInfo[iSelDev].m_Description;
return(name);
}