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


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

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


在下文中一共展示了CComboBox::EnableWindow方法的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);
// 
}
开发者ID:js86531255,项目名称:EasyClient,代码行数:28,代码来源:EasyClientDlg.cpp

示例2: OnTextChanged

LRESULT FavHubProperties::OnTextChanged(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
	if (!loaded)
		return 0;
	
	if (wID == IDC_HUBADDR) {
		CComboBox combo;
		combo.Attach(GetDlgItem(IDC_ENCODING));
		tstring address;
		address.resize(1024);
		address.resize(GetDlgItemText(IDC_HUBADDR, &address[0], 1024));

		if(AirUtil::isAdcHub(Text::fromT(address))) {
			if (!hideShare)
				ctrlProfile.EnableWindow(true);
			combo.SetCurSel(4); // select UTF-8 for ADC hubs
			::EnableWindow(GetDlgItem(IDC_STEALTH),	0);
			combo.EnableWindow(false);
		} else {
			ctrlProfile.EnableWindow(false);
			::EnableWindow(GetDlgItem(IDC_STEALTH),	1);
			combo.EnableWindow(true);
		}
		combo.Detach();
	}

	return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:airdc-svn,代码行数:27,代码来源:FavHubProperties.cpp

示例3: OnInitDialog

BOOL DlgEditCustomEvent::OnInitDialog() 
{
	CDialog::OnInitDialog();
	TString str;
	
// TODO: Add extra initialization here
	CComboBox * p;
	int i;

	p = (CComboBox *)GetDlgItem(IDC_COMBO1);
	for(i =0; i < 30; i++)
	{
		str.Format("%s Tithi (%s Paksa)", GCStrings::GetTithiName(i), GCStrings::GetPaksaName(i/15));
		p->AddString(str);
	}
	p->SetCurSel(this->m_nTithi);
	if (m_nClass != 6)
		p->EnableWindow(FALSE);

	p = (CComboBox *)GetDlgItem(IDC_COMBO2);
	for(i = 0; i < 12; i++)
	{
		p->AddString(GCStrings::GetMasaName(i));
	}
	p->SetCurSel(this->m_nMasa);
	if (m_nClass != 6)
		p->EnableWindow(FALSE);

	p = (CComboBox *)GetDlgItem(IDC_COMBO3);
	for(i = 0; i <= 6; i++)
	{
		p->AddString(GCStrings::GetEventClassText(i));
	}
	p->SetCurSel(this->m_nClass);
	if (m_nClass != 6)
		p->EnableWindow(FALSE);
	else
		p->EnableWindow(GCDisplaySettings::getValue(44)==1);
	
	p = (CComboBox *)GetDlgItem(IDC_COMBO4);
	p->AddString("no fast");
	p->AddString(GCStrings::GetFastingName(0x201));
	p->AddString(GCStrings::GetFastingName(0x202));
	p->AddString(GCStrings::GetFastingName(0x203));
	p->AddString(GCStrings::GetFastingName(0x204));
	p->AddString(GCStrings::GetFastingName(0x205));
	p->SetCurSel(this->m_nFastType);
	if (m_nClass != 6)
		p->EnableWindow(FALSE);

	if (m_nClass != 6)
		GetDlgItem(IDC_EDIT2)->EnableWindow(FALSE);

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:gopa810,项目名称:SamskaraTimes,代码行数:57,代码来源:DlgEditCustomEvent.cpp

示例4: SetValue

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);
}
开发者ID:devurandom,项目名称:shadowkeeper,代码行数:15,代码来源:TabCharacteristicsDlg.cpp

示例5: OnSelchangeDepartureLocation

void wing_editor::OnSelchangeDepartureLocation() 
{
	CComboBox *box;

	box = (CComboBox *)GetDlgItem(IDC_DEPARTURE_TARGET);
	UpdateData();
	if (m_departure_location) {
		GetDlgItem(IDC_DEPARTURE_TARGET)->EnableWindow(TRUE);
		if (m_departure_target < 0) {
			m_departure_target = 0;
		}
		// we need to build up the list box content based on the departure type.  When
		// from a docking bay, only show ships in the list which have them.  Show all ships otherwise
		if ( m_departure_location == DEPART_AT_DOCK_BAY ) {
			management_add_ships_to_combo( box, SHIPS_2_COMBO_DOCKING_BAY_ONLY );
		} else {
			// I think that this section is currently illegal
			Int3();
		}
	} else {
		box->ResetContent();
		box->EnableWindow(TRUE);
		if ( m_departure_target < 0 )
			m_departure_target = -1;
		m_departure_target = 0;
		box->AddString("None");
		for (int i=0; i<Num_jump_nodes; i++)  
			box->AddString(Jumppoint_lists[i].name);
		//GetDlgItem(IDC_DEPARTURE_TARGET)->EnableWindow(FALSE);
	}
	UpdateData(FALSE);
}
开发者ID:chief1983,项目名称:Imperial-Alliance,代码行数:32,代码来源:wing_editor.cpp

示例6: OnBnClickedRadioCustom

void CoptimizerDlg::OnBnClickedRadioCustom()
{
	CSliderCtrl *Slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER_CUSTOM);
	CComboBox *CBox = (CComboBox *)GetDlgItem(IDC_COMBO_PRESET);

	CBox->EnableWindow(FALSE);
	Slider->EnableWindow(TRUE);
}
开发者ID:DrAnon,项目名称:Optimizer,代码行数:8,代码来源:optimizerDlg.cpp

示例7: OnUpdateFontName

void CMainFrame::OnUpdateFontName(CCmdUI* /*pCmdUI*/)
{
	CComboBox *pCombo = (CComboBox*)GetFontNameCombo();
	ASSERT_VALID(pCombo);

	//If Source View, don't display the font name combobox
	if(m_dwCurrentView == ID_VIEW_SOURCE)
	{
		pCombo->EnableWindow(FALSE);
		return;
	}
	else
	{
		if(m_pWebView->QueryStatus(IDM_BLOCKFMT) & OLECMDF_ENABLED)
			pCombo->EnableWindow();
		else
			pCombo->EnableWindow(FALSE);
	}
}
开发者ID:jetlive,项目名称:skiaming,代码行数:19,代码来源:MainFrm.cpp

示例8: SelectAAC

void CSummonDlg::SelectAAC(BOOL check)
{
	CComboBox *cBox;
	CButton *cBut;
	cBox=(CComboBox *)GetDlgItem( IDC_COMBO_SUMMON_OUTPUT_MPEG_VERSION);
	cBox->EnableWindow(check);
	cBox->ResetContent();
	cBox->AddString((LPCTSTR)"MPEG4");
	cBox->AddString((LPCTSTR)"MPEG2");
	cBox->SetCurSel(1);
	cBox=(CComboBox *)GetDlgItem( IDC_COMBO_SUMMON_OUTPUT_AAC_VERSION);
	cBox->EnableWindow(check);
	cBox=(CComboBox *)GetDlgItem( IDC_COMBO_SUMMON_AAC_BANDWIDTH);
	cBox->EnableWindow(check);
	cBut=(CButton *)GetDlgItem( IDC_RADIO_SUMMON_AAC_BANDWIDTH);
	cBut->EnableWindow(check);
	
	
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:19,代码来源:CSummonDlg.cpp

示例9: InitNibbleParmList

void DiskEditDialog::InitNibbleParmList(void)
{
    ASSERT(fpDiskFS != NULL);
    DiskImg* pDiskImg = fpDiskFS->GetDiskImg();
    CComboBox* pCombo;

    pCombo = (CComboBox*) GetDlgItem(IDC_DISKEDIT_NIBBLE_PARMS);
    ASSERT(pCombo != NULL);

    if (pDiskImg->GetHasNibbles()) {
        const DiskImg::NibbleDescr* pTable;
        const DiskImg::NibbleDescr* pCurrent;
        int i, count;

        pTable = pDiskImg->GetNibbleDescrTable(&count);
        if (pTable == NULL || count <= 0) {
            LOGI("WHOOPS: nibble parm got table=0x%08lx, count=%d",
                (long) pTable, count);
            return;
        }
        pCurrent = pDiskImg->GetNibbleDescr();

        /* configure the selection to match the disk analysis */
        int dflt = -1;
        if (pCurrent != NULL) {
            for (i = 0; i < count; i++) {
                if (memcmp(&pTable[i], pCurrent, sizeof(*pCurrent)) == 0) {
                    LOGI("  NibbleParm match on entry %d", i);
                    dflt = i;
                    break;
                }
            }

            if (dflt == -1) {
                LOGI("  GLITCH: no match on nibble descr in table?!");
                dflt = 0;
            }
        }

        for (i = 0; i < count; i++) {
            if (pTable[i].numSectors > 0) {
                CString description(pTable[i].description);
                pCombo->AddString(description);
            } else {
                /* only expecting this on the last, "custom" entry */
                ASSERT(i == count-1);
            }
        }
        pCombo->SetCurSel(dflt);
    } else {
        pCombo->AddString(L"Nibble Parms");
        pCombo->SetCurSel(0);
        pCombo->EnableWindow(FALSE);
    }
}
开发者ID:rostamn739,项目名称:ciderpress,代码行数:55,代码来源:DiskEditDialog.cpp

示例10: SetSelectedFontSize

void CFcFontBar::SetSelectedFontSize(int Size, BOOL bEnable) 
{
	CComboBox* pCb = (CComboBox*)GetDlgItem(ID_FORMAT_FONTSIZE);
	ASSERT_VALID(pCb);

	if (Size > 0)
		pCb->SetCurSel(Size -1);
	else
		pCb->SetCurSel(-1);

	pCb->EnableWindow(bEnable);
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:12,代码来源:FcFontBar.cpp

示例11: SetSelectedFontName

void CFcFontBar::SetSelectedFontName(const CString& SelectString, BOOL bEnable) 
{
	CComboBox* pCb = (CComboBox*)GetDlgItem(ID_FORMAT_FONTNAME);
	ASSERT_VALID(pCb);

	if (SelectString.GetLength() > 0)
		pCb->SelectString(-1, SelectString);
	else
		pCb->SetCurSel(-1);

	pCb->EnableWindow(bEnable);
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:12,代码来源:FcFontBar.cpp

示例12: OnBnClickedRadioPreset

void CoptimizerDlg::OnBnClickedRadioPreset()
{	
	CComboBox *CBox = (CComboBox *)GetDlgItem(IDC_COMBO_PRESET);
	CSliderCtrl *Slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER_CUSTOM);
	int Sel;

	Sel = CBox->GetCurSel();
	CBox->EnableWindow(TRUE);
	
	SetSlider(Slider, Sel);
	Slider->EnableWindow(FALSE);
}
开发者ID:DrAnon,项目名称:Optimizer,代码行数:12,代码来源:optimizerDlg.cpp

示例13: UpdatePackSet

void CFolderSet::UpdatePackSet()
{
	CButton* pPack = (CButton*)GetDlgItem(IDC_RADIO_PACK);
	CButton* pUnPack = (CButton*)GetDlgItem(IDC_RADIO_UNPACK);
	CComboBox* pComboPack = (CComboBox*)GetDlgItem(IDC_COMBO_PACKAGE_TYPE);	
	if(pPack == NULL || pUnPack == NULL || pComboPack == NULL)	return;

	CButton* pCompress = (CButton*)GetDlgItem(IDC_RADIO_COMPRESS);
	CButton* pUnCompress = (CButton*)GetDlgItem(IDC_RADIO_UNCOMPRESS);
	CComboBox* pComboCompress= (CComboBox*)GetDlgItem(IDC_COMBO_COMPRESS_TYPE);
	if(pCompress == NULL || pUnCompress == NULL || pComboCompress == NULL)	return;

	if( (m_nPackType & 0x1) == 1)
	{
		pPack->SetCheck(BST_UNCHECKED);
		pUnPack->SetCheck(BST_CHECKED);
		pComboPack->EnableWindow(false);
		pComboPack->SetCurSel(-1);
		//设置为不压缩
		pCompress->SetCheck(BST_UNCHECKED);
		pCompress->EnableWindow(false);
		pUnCompress->SetCheck(BST_CHECKED);
		pComboCompress->EnableWindow(false);
	}
	else
	{
		pPack->SetCheck(BST_CHECKED);
		pUnPack->SetCheck(BST_UNCHECKED);
		pComboPack->EnableWindow(true);
		int nPos = GetComcoPackPosByID(m_nPackType);
		pComboPack->SetCurSel(nPos);

		//设置为不压缩
		pCompress->EnableWindow(true);
		pComboCompress->EnableWindow(true);
	}
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:37,代码来源:FolderSet.cpp

示例14: 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

示例15: SetComboBoxValue

BOOL CValueList::SetComboBoxValue(CComboBox &cb, int nValue, BOOL bDisableOnNoMatch)
{
	CValueItem vi;

	int nCount = cb.GetCount();
	for (int i=0;i<nCount;i++)
		if ((int)cb.GetItemData(i) == nValue)
		{
			cb.SetCurSel(i);
			if (bDisableOnNoMatch)
				cb.EnableWindow(TRUE);
			return(TRUE);
		}

	cb.SetCurSel(-1);
	if (bDisableOnNoMatch)
		cb.EnableWindow(FALSE);
	return(FALSE);

	cb.SetCurSel(-1);
	if (bDisableOnNoMatch)
		cb.EnableWindow(FALSE);
	return(FALSE);
}
开发者ID:devurandom,项目名称:shadowkeeper,代码行数:24,代码来源:ValueList.cpp


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