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


C++ CComboBox类代码示例

本文整理汇总了C++中CComboBox的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox类的具体用法?C++ CComboBox怎么用?C++ CComboBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CComboBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IsShowCtrl

void CModifyDlg::IsShowCtrl()
{
	CComboBox* combo = (CComboBox*)GetDlgItem(IDC_COMBOX1);
	int selItem = combo->GetCurSel()+1;
	switch(selItem)
	{
	case TP_TIME:
		IsShowTimeTP(TRUE);
		IsShowProblemTP(FALSE);
		IsShowInterfaceTP(FALSE);
		IsShowDirectCustomerTP(FALSE);
		//IsShowExTP(FALSE);
		break;
	case TP_PROBLEM:
		IsShowTimeTP(FALSE);
		IsShowProblemTP(TRUE);
		IsShowInterfaceTP(FALSE);
		IsShowDirectCustomerTP(FALSE);
		//IsShowExTP(FALSE);
		break;
	case TP_INTERFACE:
		IsShowTimeTP(FALSE);
		IsShowProblemTP(FALSE);
		IsShowInterfaceTP(TRUE);
		IsShowDirectCustomerTP(FALSE);
		//IsShowExTP(FALSE);
		break;
	case TP_CUSTOMERSERVICE:
		IsShowTimeTP(FALSE);
		IsShowProblemTP(FALSE);
		IsShowInterfaceTP(FALSE);
		IsShowDirectCustomerTP(TRUE);
		//IsShowExTP(FALSE);
		break;
	case TP_OTHER:
		IsShowTimeTP(FALSE);
		IsShowProblemTP(FALSE);
		IsShowInterfaceTP(FALSE);
		IsShowDirectCustomerTP(FALSE);
		//IsShowExTP(TRUE);
		break;
	default:
		break;
	}
}
开发者ID:obabywawa,项目名称:UPIM,代码行数:45,代码来源:ModifyDlg.cpp

示例2: SetIcon

BOOL CQuoteTesterDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// 設定此對話方塊的圖示。當應用程式的主視窗不是對話方塊時,
	// 框架會自動從事此作業
	SetIcon(m_hIcon, TRUE);			// 設定大圖示
	SetIcon(m_hIcon, FALSE);		// 設定小圖示

	// TODO: 在此加入額外的初始設定

	CComboBox   *pComboBox   =   (CComboBox *)GetDlgItem(IDC_COMBO_KLine); 

	pComboBox->AddString(_T("1分鐘線"));
	pComboBox->AddString(_T("5分鐘線"));
	pComboBox->AddString(_T("30分鐘線"));
	pComboBox->AddString(_T("日線228天"));
	pComboBox->AddString(_T("完整日線"));
	pComboBox->AddString(_T("週線"));
	pComboBox->AddString(_T("月線"));

	pComboBox->SetCurSel(0);


	return TRUE;  // 傳回 TRUE,除非您對控制項設定焦點
}
开发者ID:weini2,项目名称:Capital,代码行数:26,代码来源:QuoteTesterDlg.cpp

示例3: if

BOOL shield_sys_dlg::OnInitDialog() 
{
	int i, z;
	int teams[MAX_TEAM_NAMES];
	int types[MAX_SHIP_TYPES];
	CComboBox *box;

	for (i=0; i<MAX_TEAM_NAMES; i++)
		teams[i] = 0;

	for (i=0; i<MAX_SHIP_TYPES; i++)
		types[i] = 0;

	for (i=0; i<MAX_SHIPS; i++)
		if (Ships[i].objnum >= 0) {
			z = (Objects[Ships[i].objnum].flags & OF_NO_SHIELDS) ? 1 : 0;
			if (!teams[Ships[i].team])
				Shield_sys_teams[Ships[i].team] = z;
			else if (Shield_sys_teams[Ships[i].team] != z)
				Shield_sys_teams[Ships[i].team] = 2;

			if (!types[Ships[i].ship_info_index])
				Shield_sys_types[Ships[i].ship_info_index] = z;
			else if (Shield_sys_types[Ships[i].ship_info_index] != z)
				Shield_sys_types[Ships[i].ship_info_index] = 2;

			teams[Ships[i].team]++;
			types[Ships[i].ship_info_index]++;
		}

	box = (CComboBox *) GetDlgItem(IDC_TYPE);
	box->ResetContent();
	for (i=0; i<Num_ship_types; i++)
		box->AddString(Ship_info[i].name);

	box = (CComboBox *) GetDlgItem(IDC_TEAM);
	box->ResetContent();
	for (i=0; i<Num_team_names; i++)
		box->AddString(Team_names[i]);

	CDialog::OnInitDialog();
	set_team();
	set_type();
	return TRUE;
}
开发者ID:chief1983,项目名称:Imperial-Alliance,代码行数:45,代码来源:ShieldSysDlg.cpp

示例4: SetIcon

BOOL CSummonDlg::OnInitDialog()
{
	
	
	CDialog::OnInitDialog();

	
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标

	m_SummonLame_Progress.SetRange( 0, 100 );
	m_SummonLame_Progress.SetPos(0);

	CComboBox *cBox;
	cBox=(CComboBox *)GetDlgItem( IDC_COMBO_SUMMON_OUTPUT_MPEG_VERSION);
	//init AAC
	cBox->AddString((LPCTSTR)"MPEG4");
	cBox->AddString((LPCTSTR)"MPEG2");
	cBox->SetCurSel(1);
	
	cBox=(CComboBox *)GetDlgItem( IDC_COMBO_SUMMON_OUTPUT_AAC_VERSION);
	cBox->AddString((LPCTSTR)"Main");
	cBox->AddString((LPCTSTR)"Low Complexity");
	cBox->AddString((LPCTSTR)"LTP");
	cBox->SetCurSel(1);
	m_ScrollBar_Summon_Mp3_ABR.EnableScrollBar(ESB_ENABLE_BOTH );
	m_ScrollBar_Summon_Mp3_ABR.ShowScrollBar(TRUE);
	m_ScrollBar_Summon_Mp3_ABR.SetScrollRange(8,310,TRUE);
	
	
	return TRUE;  
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:32,代码来源:CSummonDlg.cpp

示例5: OnInitDialog

BOOL NetCfg::OnInitDialog()
{
	CComboBox *hCombo;
	CEdit *hEdit;

	hCombo = (CComboBox*)GetDlgItem(IDC_COMBO_THREAD);
	hCombo->InsertString(-1,"1");
	// 	hCombo->InsertString(-1,"2");
	// 	hCombo->InsertString(-1,"3");
	// 	hCombo->InsertString(-1,"4");
	hCombo->SetCurSel(0);

	hCombo = (CComboBox*)GetDlgItem(IDC_COMBO_TICK);
	hCombo->InsertString(-1,"10");
	hCombo->InsertString(-1,"100");
	hCombo->InsertString(-1,"500");
	hCombo->InsertString(-1,"1000");
	hCombo->SetCurSel(3);


	hEdit = (CEdit*)GetDlgItem(IDC_EDIT_TICK);
	hEdit->SetWindowText("10");


	CIPAddressCtrl *hip;
	hip = (CIPAddressCtrl *)GetDlgItem(IDC_IP_TARGET);
	hip->SetWindowText(m_ini.ip);

	
	hEdit = (CEdit*)GetDlgItem(IDC_EDIT_BROWSE);
	hEdit->SetWindowText(m_ini.def_file);

	GetDlgItem(IDC_BTN_TRANSFER)->EnableWindow(FALSE);
	return TRUE;
}
开发者ID:MenglongWu,项目名称:NetStrong,代码行数:35,代码来源:NetCfg.cpp

示例6: onSpeedChanged

LRESULT SpeedPage::onSpeedChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/)
{
	tstring speed;
	speed.resize(1024);
	speed.resize(GetDlgItemText(wID, &speed[0], 1024));
	if (!speed.empty() && wNotifyCode != CBN_SELENDOK) {
		boost::wregex reg;
		if(speed[speed.size() -1] == '.')
			reg.assign(_T("(\\d+\\.)"));
		else
			reg.assign(_T("(\\d+(\\.\\d+)?)"));
		if (!regex_match(speed, reg)) {
			CComboBox tmp;
			tmp.Attach(hWndCtl);
			DWORD dwSel;
			if ((dwSel = tmp.GetEditSel()) != CB_ERR) {
				tstring::iterator it = speed.begin() +  HIWORD(dwSel)-1;
				speed.erase(it);
				tmp.SetEditSel(0,-1);
				tmp.SetWindowText(speed.c_str());
				tmp.SetEditSel(HIWORD(dwSel)-1, HIWORD(dwSel)-1);
				tmp.Detach();
			}
		}
	}

	updateValues(wNotifyCode);
	validateMCNLimits(wNotifyCode);
	return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:airdc-svn,代码行数:30,代码来源:SpeedPage.cpp

示例7: AddNewTimeServer

void CNetworkControllView::AddNewTimeServer(const CString& strTimeServer)
{
	BOOL bFind = FALSE;
	UINT i =0;
	for (i = 0; i < m_szServers.size(); i++)
	{
		if (strTimeServer.CompareNoCase(m_szServers[i]) == 0)
		{
			bFind = TRUE;
		}
	}

	if (!bFind)  // new time server
	{		
				
		CComboBox* pCbx = (CComboBox*)GetDlgItem(IDC_COMBO_TIMESERVERLIST);
		if(m_szServers.size() >= 10)
		{
			for (UINT j =5; j < 9; j++)
			{
				m_szServers[j] = m_szServers[j+1];
			}
			m_szServers[9]=strTimeServer;
			pCbx->DeleteString(5);
		}
		else
		{
			m_szServers.push_back(strTimeServer);
		}
		// 
		

		// write to register
		for (UINT i = 5; i < m_szServers.size(); i++)
		{	
			CString strIndex;
			int nsize = m_szServers.size();
			strIndex.Format(_T("server%d"), i+1);
			SaveTimeServerToRegister(m_szServers[i], strIndex);
		}

		pCbx->AddString(strTimeServer);
	}

}
开发者ID:ALEXLCC,项目名称:T3000_Building_Automation_System,代码行数:45,代码来源:NetworkControllView.cpp

示例8: CBTexture2

void CTextureTool::SetBrightness (int nBrightness)
{
	static	BOOL	bSemaphore = FALSE;

if (!bSemaphore) {
	bSemaphore = TRUE;

	CComboBox	*pcb = (m_bUse2nd && !m_bUse1st) ? CBTexture2 () : CBTexture1 ();
	int			index = pcb->GetCurSel ();
	INT16			texture = (INT16) pcb->GetItemData (index);

	if (texture >= 0) {
		m_nBrightness = nBrightness;
		lightMap [texture] = ((nBrightness == 100) ? MAX_BRIGHTNESS : nBrightness * (MAX_BRIGHTNESS / 100));
		}
	bSemaphore = FALSE;
	}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:18,代码来源:texturedlg.cpp

示例9: OnSelchangePropname

void CStockPropPage::OnSelchangePropname(CComboBox& combo)
{
	int iPropNameNew = combo.GetCurSel();

	if (iPropNameNew != m_iPropName)
	{
		UpdateData(TRUE);

		if (iPropNameNew != CB_ERR)
			combo.GetLBText(iPropNameNew, m_strPropName);
		else
			m_strPropName = _T("");

		m_iPropName = iPropNameNew;
		UpdateData(FALSE);
		SetModifiedFlag(FALSE);
	}
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:18,代码来源:ppgstock.cpp

示例10: FindDupCrnr

int CPolyDlg::FindDupCrnr( Vector3D crnr, CComboBox& combo )
{
	//06/20/03 don't allow duplicate points
	int numsegs = combo.GetCount() ;
	for (int i = 0; i < numsegs; i++ )
	{
		CString csInstr;
		combo.GetLBText(i, csInstr );
		int nCornerNum = GetItemNum( csInstr ) ;
		Vector3D v = GetCnrVector( csInstr ) ;
		if (v.x == crnr.x && v.y == crnr.y )//Matching coordinate set found
		{	//If match found, return corner number
			return nCornerNum ;
		}
	}

	return -1 ; //no match found
}
开发者ID:pvaut,项目名称:Z-Flux,代码行数:18,代码来源:PolyDlg.cpp

示例11: Enum

void CAntiVirus::Enum(CComboBox& wndAntiVirus)
{
	if ( ! ::IsWindow( wndAntiVirus.GetSafeHwnd() ) )
		return;

	wndAntiVirus.ResetContent();

	// No anti-virus
	int nAntiVirus = wndAntiVirus.AddString( _T("") );
	wndAntiVirus.SetItemDataPtr( nAntiVirus, (LPVOID)new CString() );

	// Enum available anti-viruses
	CComPtr< ICatInformation > pInfo;
	HRESULT hr = pInfo.CoCreateInstance( CLSID_StdComponentCategoriesMgr );
	if ( SUCCEEDED( hr ) )
	{
		const CATID IDs[ 1 ] = { CATID_MSOfficeAntiVirus };
        CComPtr< IEnumCLSID > pEnum;
        hr = pInfo->EnumClassesOfCategories( 1, IDs, 0, NULL, &pEnum );
		if ( SUCCEEDED( hr ) )
		{
			CLSID clsid;
			while ( pEnum->Next( 1, &clsid, NULL ) == S_OK )
			{
				const CString sCLSID = Hashes::toGuid( clsid, true );
				HKEY hClass = NULL;
				if ( ERROR_SUCCESS == RegOpenKeyEx( HKEY_CLASSES_ROOT, _T("CLSID\\") + sCLSID, 0, KEY_READ, &hClass ) )
				{
					// Get it name
					TCHAR szValue[ MAX_PATH ] = {};
					DWORD nValue = MAX_PATH, nType = REG_SZ;
					if ( ERROR_SUCCESS == RegQueryValueEx( hClass, NULL, NULL, &nType, (LPBYTE)szValue, &nValue ) )
					{
						const int nIndex = wndAntiVirus.AddString( szValue );
						wndAntiVirus.SetItemDataPtr( nIndex, (LPVOID)new CString( sCLSID ) );
						if ( Settings.General.AntiVirus.CompareNoCase( sCLSID ) == 0 )
						{
							nAntiVirus = nIndex;
						}
					}
					RegCloseKey( hClass );
				}
			}
		}
	}

	wndAntiVirus.SetCurSel( nAntiVirus );
	wndAntiVirus.EnableWindow( wndAntiVirus.GetCount() > 1 );
}
开发者ID:ivan386,项目名称:Shareaza,代码行数:49,代码来源:AntiVirus.cpp

示例12: GetDlgItem

BOOL SoundEnvironment::OnInitDialog()
{
	m_play_bm.LoadBitmap(IDB_PLAY);
	((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);

	// fill environment list ...

	CComboBox *box = (CComboBox *) GetDlgItem(IDC_SOUND_ENVIRONMENT);

	// add empty default string (for no environment set)
	box->AddString("");

	for (size_t i = 0; i < EFX_presets.size(); i++) {
		box->AddString(EFX_presets[i].name.c_str());
	}

	// set values ...

	sound_env *m_env = &The_mission.sound_environment;

	// make sure we are set by default to mission values
	if (m_env->id >= 0) {
		m_environment = m_env->id + 1;

		m_volume = m_env->volume;
		m_damping = m_env->damping;
		m_decay_time = m_env->decay;

		// make it active
		sound_env_set(m_env);
	} else {
		m_environment = 0;

		m_volume = 0.0f;
		m_damping = 0.1f;
		m_decay_time = 0.1f;

		sound_env_disable();
	}

	CDialog::OnInitDialog();
	UpdateData(FALSE);
	return TRUE;
}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:44,代码来源:soundenvironmentdlg.cpp

示例13:

void CInstrumentEditorN163Wave::SelectInstrument(int Instrument)
{
	m_pInstrument = (CInstrumentN163*)GetDocument()->GetInstrument(Instrument);

	CComboBox *pSizeBox = (CComboBox*)GetDlgItem(IDC_WAVE_SIZE);
	CComboBox *pPosBox = (CComboBox*)GetDlgItem(IDC_WAVE_POS);

	CString SizeStr;
	SizeStr.Format(_T("%i"), m_pInstrument->GetWaveSize());
	pSizeBox->SelectString(0, SizeStr);

	FillPosBox(m_pInstrument->GetWaveSize());

	CString PosStr;
	PosStr.Format(_T("%i"), m_pInstrument->GetWavePos());
	pPosBox->SetWindowText(PosStr);

	/*
	if (m_pInstrument->GetAutoWavePos()) {
		CheckDlgButton(IDC_POSITION, 1);
		GetDlgItem(IDC_WAVE_POS)->EnableWindow(FALSE);
	}
	else {
		CheckDlgButton(IDC_POSITION, 0);
		GetDlgItem(IDC_WAVE_POS)->EnableWindow(TRUE);
	}
	*/

	if (m_pWaveEditor) {
		m_pWaveEditor->SetInstrument(m_pInstrument);
		m_pWaveEditor->SetLength(m_pInstrument->GetWaveSize());
	}

	CSpinButtonCtrl *pIndexSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_INDEX_SPIN);
	CSpinButtonCtrl *pWavesSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_WAVES_SPIN);

	int WaveCount = m_pInstrument->GetWaveCount();

	pIndexSpin->SetRange(0, WaveCount - 1);
	pIndexSpin->SetPos(0);
	pWavesSpin->SetPos(WaveCount - 1);

	m_iWaveIndex = 0;
}
开发者ID:bigjt2,项目名称:nesicide,代码行数:44,代码来源:InstrumentEditorN163Wave.cpp

示例14: GetDC

BOOL CConfigAppearance::OnInitDialog()
{
	CPropertyPage::OnInitDialog();

	const CSettings *pSettings = theApp.GetSettings();
	m_strFont = pSettings->Appearance.strFont;		// // //

	CDC *pDC = GetDC();
	if (pDC != NULL) {
		LOGFONTW LogFont = { };		// // //
		LogFont.lfCharSet = ANSI_CHARSET;
		EnumFontFamiliesExW(pDC->m_hDC, &LogFont, (FONTENUMPROC)EnumFontFamExProc, (LPARAM)this, 0);
		ReleaseDC(pDC);
	}

	CComboBox *pFontSizeList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT_SIZE));
	CComboBox *pItemsBox = static_cast<CComboBox*>(GetDlgItem(IDC_COL_ITEM));

	for (int i = 0; i < COLOR_ITEM_COUNT; ++i) {
		pItemsBox->AddString(conv::to_wide(COLOR_ITEMS[i]).data());
	}

	pItemsBox->SelectString(0, conv::to_wide(COLOR_ITEMS[0]).data());

	m_iSelectedItem = 0;

	m_iColors[COL_BACKGROUND]			= pSettings->Appearance.iColBackground;
	m_iColors[COL_BACKGROUND_HILITE]	= pSettings->Appearance.iColBackgroundHilite;
	m_iColors[COL_BACKGROUND_HILITE2]	= pSettings->Appearance.iColBackgroundHilite2;
	m_iColors[COL_PATTERN_TEXT]			= pSettings->Appearance.iColPatternText;
	m_iColors[COL_PATTERN_TEXT_HILITE]	= pSettings->Appearance.iColPatternTextHilite;
	m_iColors[COL_PATTERN_TEXT_HILITE2]	= pSettings->Appearance.iColPatternTextHilite2;
	m_iColors[COL_PATTERN_INSTRUMENT]	= pSettings->Appearance.iColPatternInstrument;
	m_iColors[COL_PATTERN_VOLUME]		= pSettings->Appearance.iColPatternVolume;
	m_iColors[COL_PATTERN_EFF_NUM]		= pSettings->Appearance.iColPatternEffect;
	m_iColors[COL_SELECTION]			= pSettings->Appearance.iColSelection;
	m_iColors[COL_CURSOR]				= pSettings->Appearance.iColCursor;
	m_iColors[COL_CURRENT_ROW_NORMAL]	= pSettings->Appearance.iColCurrentRowNormal;		// // //
	m_iColors[COL_CURRENT_ROW_EDIT]		= pSettings->Appearance.iColCurrentRowEdit;
	m_iColors[COL_CURRENT_ROW_PLAYING]	= pSettings->Appearance.iColCurrentRowPlaying;

	m_iFontSize	= pSettings->Appearance.iFontSize;		// // //

	m_bPatternColors = pSettings->Appearance.bPatternColor;		// // //
	m_bDisplayFlats = pSettings->Appearance.bDisplayFlats;		// // //

	pItemsBox = static_cast<CComboBox*>(GetDlgItem(IDC_SCHEME));

	for (auto *scheme : COLOR_SCHEMES)
		pItemsBox->AddString(scheme->NAME);

	for (int pt : FONT_SIZES)		// // //
		pFontSizeList->AddString(conv::to_wide(conv::from_int(pt)).data());
	pFontSizeList->SetWindowTextW(conv::to_wide(conv::from_int(m_iFontSize)).data());

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:jpmac26,项目名称:0CC-FamiTracker,代码行数:58,代码来源:ConfigAppearance.cpp

示例15: nUpdateLinSettings

int CChannelConfigurationDlg::nUpdateLinSettings()
{
    CComboBox* pomCombo = (CComboBox*)GetDlgItem(IDC_COMBO_LIN_PROTOCOL);

    if ( pomCombo != nullptr )
    {
        for ( int i = 0 ; i < ( sizeof(sg_LINPROTOCOL_BAUD)/ sizeof(sg_LINPROTOCOL_BAUD[0])); i++ )
        {
            pomCombo->InsertString(i, sg_LINPROTOCOL_BAUD[i].m_strProtocol.c_str());
        }
        pomCombo->SetCurSel(0);
    }

    m_nLinBaudRate = 1900;
    UpdateData(FALSE);
    OnOverwriteCheckBoxClick();

    return 0;
}
开发者ID:GT-Derka,项目名称:busmaster,代码行数:19,代码来源:ChannelConfigurationDlg.cpp


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