当前位置: 首页>>代码示例>>C++>>正文


C++ CComboBox::GetLBText方法代码示例

本文整理汇总了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();
	}
}
开发者ID:yamamoto123,项目名称:tapur_open,代码行数:29,代码来源:RsfSimpleForm.cpp

示例2: OnCloseupDgname

void CDGProp::OnCloseupDgname() 
{
	UpdateData(TRUE);	
	CComboBox* box = (CComboBox*)GetDlgItem(IDC_DGNAME);
	int i = box->GetCurSel();
	box->GetLBText(i, m_dgName);
}
开发者ID:JackJone,项目名称:opencv,代码行数:7,代码来源:DGProp.cpp

示例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;
}
开发者ID:jellyfunk,项目名称:aoia-hack,代码行数:27,代码来源:FindPanel.cpp

示例4: OnCbnSelchangeFont

void CConfigAppearance::OnCbnSelchangeFont()
{
	CComboBox *pFontList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT));
	pFontList->GetLBText(pFontList->GetCurSel(), m_strFont.data());
	RedrawWindow();
	SetModified();
}
开发者ID:jpmac26,项目名称:0CC-FamiTracker,代码行数:7,代码来源:ConfigAppearance.cpp

示例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();
}
开发者ID:donilan,项目名称:study,代码行数:29,代码来源:CgxDlg.cpp

示例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;
}
开发者ID:travisgoodspeed,项目名称:basicsynth,代码行数:29,代码来源:FindReplDlg.cpp

示例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);

}
开发者ID:Room1337,项目名称:projectM-update,代码行数:25,代码来源:DisplayResolutionPane.cpp

示例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);

   
}
开发者ID:deepmatrix,项目名称:blaxxun-cc3d,代码行数:35,代码来源:mainfrm.cpp

示例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;
}
开发者ID:hiplayer,项目名称:mpc_hc,代码行数:35,代码来源:PPageBase.cpp

示例10:

//确定交易场次
void CHorseRaceMainDlg::OnBnClickedButton3()
{
	// TODO: 在此添加控件通知处理程序代码
	CComboBox* pcombox = (CComboBox*)(GetDlgItem(IDC_COMBO2));
	pcombox->GetLBText(pcombox->GetCurSel(),m_TradeRace);
	TRACE(m_TradeRace);
	return ;
}
开发者ID:a382793896,项目名称:horseRace1,代码行数:9,代码来源:HorseRaceMainDlg.cpp

示例11: OnxxxSelChange

    void OnxxxSelChange(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
    {
        CString strText;

        m_wndCboxxx.GetLBText(m_wndCboxxx.GetCurSel(), strText);

        SetItemText(101, strText);

        return;
    }
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:10,代码来源:demomain.cpp

示例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);  // 将字符转换成数字
}
开发者ID:alone888,项目名称:fengfang,代码行数:10,代码来源:ADHistFrm.cpp

示例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);
	}

}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:43,代码来源:DlgForEach.cpp

示例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;
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:11,代码来源:FcFontBar.cpp

示例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;
        }
    }
}
开发者ID:Murder66,项目名称:mpc-hc-master,代码行数:11,代码来源:EditListEditor.cpp


注:本文中的CComboBox::GetLBText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。