本文整理汇总了C++中CComboBox::GetLBText方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::GetLBText方法的具体用法?C++ CComboBox::GetLBText怎么用?C++ CComboBox::GetLBText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::GetLBText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnButtonPrg
// 連携プログラム設定ボタン
void CRsfSimpleForm::OnButtonPrg()
{
// TODO: この位置にコントロール通知ハンドラ用のコードを追加してください
CString str;
UpdateData(TRUE); // DDX更新
// 連携プログラムID
CString strPrgId = m_aryPrgId.GetAt(m_idxPrg);
/// プログラムCSVファイルの特定
CTPsetup tps(theApp.m_strDataFolder);
tps.SetCallerId(m_strSenderId);
CString strFile = tps.RsfPrgFileName(_T("$$$$"), strPrgId);
/// 画面の表示
CComboBox *pcmb;
pcmb = (CComboBox*)GetDlgItem(IDC_CMB_PRG);
pcmb->GetLBText(m_idxPrg, str);
CRsfPrgDialog dlg(this, str);
dlg.SetFile(strFile);
if (dlg.DoModal() == IDOK) {
/// RSFファイルの更新
if (!UpdateFile()) return;
/// 画面の更新
UpdateForm();
}
}
示例2: OnCloseupDgname
void CDGProp::OnCloseupDgname()
{
UpdateData(TRUE);
CComboBox* box = (CComboBox*)GetDlgItem(IDC_DGNAME);
int i = box->GetCurSel();
box->GetLBText(i, m_dgName);
}
示例3: 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;
}
示例4: OnCbnSelchangeFont
void CConfigAppearance::OnCbnSelchangeFont()
{
CComboBox *pFontList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT));
pFontList->GetLBText(pFontList->GetCurSel(), m_strFont.data());
RedrawWindow();
SetModified();
}
示例5: OnCbnSelchangeScriptList
void CCgxDlg::OnCbnSelchangeScriptList()
{
TCHAR fileName[MAX_PATH] = {0};
TCHAR path[MAX_PATH] = {0};
CComboBox* scriptList = (CComboBox *)GetDlgItem(IDC_SCRIPT_LIST);
CEdit* script = (CEdit *)GetDlgItem(IDC_SCRIPT);
int idx = scriptList->GetCurSel();
scriptList->GetLBText(idx, fileName);
swprintf(path, sizeof(TCHAR)*MAX_PATH, TEXT("script\\%s"), fileName);
CFile file;
file.Open(path, CFile::modeRead);
if(file.GetLength() < 1)
{
return;
}
ULONGLONG fileSize = file.GetLength();
char* buff = new char[fileSize];
file.Read(buff, fileSize);
int size = MultiByteToWideChar(CP_ACP, NULL, buff, fileSize, NULL, 0);
TCHAR* text = new TCHAR[size+1];
MultiByteToWideChar(CP_ACP, NULL, buff, fileSize, text, size);
text[size] = '\0';
script->SetWindowTextW(text);
//TRACE(text);
delete[] buff;
delete[] text;
file.Close();
}
示例6: 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;
}
示例7: 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);
}
示例8: OnSelchangeUrl
void CUrlBar::OnSelchangeUrl()
{
// TODO: Add your control notification handler code here
#if 0
CString strText;
CString strItem;
CComboBox* pCBox = (CComboBox*)GetDlgItem(IDC_URL);
int nIndex = pCBox->GetCurSel();
if (nIndex == CB_ERR)
return;
pCBox->GetLBText(nIndex, strItem);
//AfxFormatString1(strText, IDS_SELECTED_PROMPT, (LPCTSTR)strItem);
TRACE("On Sel Change URL %s \n",(const char *) strItem);
#endif
CString url;
int nIndex = m_url.GetCurSel();
if (nIndex == CB_ERR)
return;
m_url.m_curSel = nIndex;
m_url.GetText(nIndex,url);
CMyglView* pView = ((CMyglApp *) AfxGetApp())->GetActiveView();
if (pView) { pView->ReadUrl( url); }
// SetMessageText(strItem);
}
示例9: FillComboToolTip
bool CPPageBase::FillComboToolTip(CComboBox& comboBox, TOOLTIPTEXT* pTTT)
{
bool bNeedTooltip = false;
CDC* pDC = comboBox.GetDC();
CFont* pFont = comboBox.GetFont();
CFont* pOldFont = pDC->SelectObject(pFont);
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
CRect comboBoxRect;
comboBox.GetWindowRect(comboBoxRect);
comboBoxRect.right -= GetSystemMetrics(SM_CXVSCROLL) + 2 * GetSystemMetrics(SM_CXEDGE);
int i = comboBox.GetCurSel();
CString str;
comboBox.GetLBText(i, str);
CSize textSize;
textSize = pDC->GetTextExtent(str);
pDC->SelectObject(pOldFont);
comboBox.ReleaseDC(pDC);
textSize.cx += tm.tmAveCharWidth;
if (textSize.cx > comboBoxRect.Width()) {
bNeedTooltip = true;
if (str.GetLength() > _countof(pTTT->szText) - 1) {
str.Truncate(_countof(pTTT->szText) - 1);
}
_tcscpy_s(pTTT->szText, str);
pTTT->hinst = nullptr;
}
return bNeedTooltip;
}
示例10:
//确定交易场次
void CHorseRaceMainDlg::OnBnClickedButton3()
{
// TODO: 在此添加控件通知处理程序代码
CComboBox* pcombox = (CComboBox*)(GetDlgItem(IDC_COMBO2));
pcombox->GetLBText(pcombox->GetCurSel(),m_TradeRace);
TRACE(m_TradeRace);
return ;
}
示例11: OnxxxSelChange
void OnxxxSelChange(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
{
CString strText;
m_wndCboxxx.GetLBText(m_wndCboxxx.GetCurSel(), strText);
SetItemText(101, strText);
return;
}
示例12: OnSelchangeCOMBORate
void CADHistFrm::OnSelchangeCOMBORate()
{
// TODO: Add your control notification handler code here
CADHistDoc* pDoc = (CADHistDoc*)GetActiveDocument(); // 在Frame中取得当前文档指针
CComboBox* pRate = (CComboBox*)(m_wndSetupBar.GetDlgItem(IDC_COMBO_Rate));
CString strRate;
int Index = pRate->GetCurSel(); // 取得当前选择索引号
pRate->GetLBText(Index, strRate); // 根据选择,取得所选择项文本
pDoc->m_Rate = wcstol(strRate, NULL, 10); // 将字符转换成数字
}
示例13: RenameParam
void CDlgForEach::RenameParam( LPCTSTR strOld, LPCTSTR strNew )
{
BOOL bSelectParam = FALSE;
CComboBox* pBox;
CString str;
int n;
pBox = (CComboBox*)GetDlgItem(IDC_COMBO_PARAM);
n = pBox->GetCurSel();
if(n != -1)
{
pBox->GetLBText(n, str);
if(str == strOld) bSelectParam = TRUE;
}
DeleteStringFromComboBox(pBox, strOld);
AddStringToComboBox(pBox, strNew);
if(bSelectParam) SelectStringFromComboBox(pBox, strNew);
for(int i = 0; i < (int)m_vpComboBox.size(); i++)
{
BOOL bSelect = FALSE;
pBox = m_vpComboBox[i];
n = pBox->GetCurSel();
if(n != -1)
{
pBox->GetLBText(n, str);
if(str == strOld) bSelect = TRUE;
}
DeleteStringFromComboBox(pBox, strOld);
AddStringToComboBox(pBox, strNew);
if(bSelect) SelectStringFromComboBox(pBox, strNew);
}
}
示例14: GetSelectedFontName
CString CFcFontBar::GetSelectedFontName() const
{
CComboBox* pCb = (CComboBox*)GetDlgItem(ID_FORMAT_FONTNAME);
ASSERT_VALID(pCb);
CString fontName;
int selIndex = pCb->GetCurSel();
if (selIndex != CB_ERR)
pCb->GetLBText(selIndex, fontName);
return fontName;
}
示例15: SelectCombo
void CEditListEditor::SelectCombo(LPCTSTR strValue, CComboBox& combo)
{
for (int i = 0; i < combo.GetCount(); i++) {
CString strTemp;
combo.GetLBText(i, strTemp);
if (strTemp == strValue) {
combo.SetCurSel(i);
break;
}
}
}