本文整理汇总了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);
//
}
示例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;
}
示例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
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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 );
}
示例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);
}