本文整理汇总了C++中CButton::EnableWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::EnableWindow方法的具体用法?C++ CButton::EnableWindow怎么用?C++ CButton::EnableWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::EnableWindow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDlgItem
void
CDeviceAddWriteKeyDlg::OnWriteKeyChange(UINT /*wNotifyCode*/, int /*wID*/, HWND hWndCtl)
{
CEdit wndWriteKey = hWndCtl;
wndWriteKey.GetWindowText(
m_strWriteKey.GetBuffer(NDAS_DEVICE_WRITE_KEY_LEN + 1),
NDAS_DEVICE_WRITE_KEY_LEN + 1);
m_strWriteKey.ReleaseBuffer();
CButton wndOK = GetDlgItem(IDOK);
if (m_strWriteKey.GetLength() == 5)
{
BOOL fValid = ::NdasValidateStringIdKey(
m_strDeviceId,
m_strWriteKey);
wndOK.EnableWindow(fValid);
}
else
{
wndOK.EnableWindow(FALSE);
}
SetMsgHandled(FALSE);
}
示例2: MessageBox
void CoptimizerDlg::OnBnClickedButton1()
{
CButton *OptimizeButton = (CButton*)GetDlgItem(IDC_BUTTON1);
CButton *CancelButton = (CButton*)GetDlgItem(IDCANCEL);
CProgressCtrl *ProgressBar = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS);
int RetVal;
OptimizeButton->SetWindowText(TEXT("Please wait..."));
OptimizeButton->EnableWindow(FALSE);
CancelButton->EnableWindow(FALSE);
ProgressBar->SetPos(0);
OptimizeBoot(OptimizeButton);
#ifndef LDRONLY
ProgressBar->SetPos(25);
OptimizeRegistry(OptimizeButton);
ProgressBar->SetPos(50);
OptimizeLibraries(OptimizeButton);
ProgressBar->SetPos(75);
OptimizeSystem(OptimizeButton);
#endif
ProgressBar->SetPos(100);
OptimizeButton->SetWindowText(TEXT("Optimize!"));
OptimizeButton->EnableWindow(TRUE);
CancelButton->EnableWindow(TRUE);
RetVal = MessageBox(TEXT("You need to reboot the system for the changes to take effect. Reboot now?"),
TEXT("Done."), MB_OKCANCEL);
if(RetVal == IDOK)
Reboot();
else
InflictLoad();
}
示例3: OnItemchangedListMessage
void CPPageMessage::OnItemchangedListMessage(NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
// IDE generated code - commented because it isn't needed at present.
//NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// If there is a selected item, then it makes sense to keep the "Edit" and
// "Remove" buttons in enabled state.
BOOL bToEnable = ((m_odMsgList.GetNextItem(-1, LVNI_SELECTED)) >= 0);
CButton* pomButton = (CButton*) GetDlgItem(IDC_BUTTON_EDIT);
if (pomButton != nullptr)
{
pomButton->EnableWindow(bToEnable);
}
if (m_bForDBMsg == FALSE)
{
pomButton = (CButton*) GetDlgItem(IDC_BUTTON_REMOVE);
if (pomButton != nullptr)
{
pomButton->EnableWindow(bToEnable);
}
}
*pResult = 0;
}
示例4: EnableControls
void CBidDialogSmall::EnableControls()
{
// enable all controls
for(int i=IDC_BID_LEVEL_1;i<=IDC_BID_LEVEL_7;i++)
{
CButton* pButton = (CButton*) GetDlgItem(i);
pButton->EnableWindow(TRUE);
pButton->SetState(FALSE);
}
for(i=IDC_SUIT_CLUBS;i<=IDC_SUIT_NOTRUMP;i++)
{
CButton* pButton = (CButton*) GetDlgItem(i);
pButton->EnableWindow(TRUE);
pButton->SetState(FALSE);
}
/*
// enable the level & suit buttons
int nLastBid = pDOC->GetLastValidBid();
if (nLastBid == BID_PASS)
{
}
//
int nLevel = BID_LEVEL(nLastBid);
int nSuit = BID_SUIT(nLastBid);
// enable all suits higher than the one bid
for(int i=0;i<nSuit;i++)
GetDlgItem(IDC_SUIT_CLUBS+i)->EnableWindow(TRUE);
*/
}
示例5: OnLbnSelchangeListPage
void CShowPageDlg::OnLbnSelchangeListPage()
{
// TODO: 在此添加控件通知处理程序代码
int index = m_OwnerListBox.GetCurSel();
if(index==CB_ERR)return;
map<int,UINT>::const_iterator itera = m_map_index.find(index);
if(itera!=m_map_index.end())
{
list<CTrackContrl*>::const_iterator trakItera = theApp.m_pView->m_list_trackCtrl.begin();
for(trakItera;trakItera!=theApp.m_pView->m_list_trackCtrl.end();trakItera++)
{
CTrackContrl* ptrackCtr = *trakItera;
if(ptrackCtr->GetSerialID()==itera->second && ptrackCtr->GetSerialID()==0)
{
CButton* pDelButton = (CButton*)GetDlgItem(IDC_BN_DELPAGE);
pDelButton->EnableWindow(FALSE);
// if(theApp.m_pView->m_pTrackCtrl!=NULL)
// theApp.m_pView->m_pTrackCtrl->SetAllCtrlHide();//原来的隐藏
// theApp.m_pView->m_pTrackCtrl = ptrackCtr;
// theApp.m_pView->m_pTrackCtrl->SetAllCtrlShow();
theApp.m_pView->ShowPage(ptrackCtr->GetSerialID());
// theApp.m_pView->Invalidate(TRUE);
break;
}
else if(ptrackCtr->GetSerialID()==itera->second && ptrackCtr->GetSerialID()!=0)
{
theApp.m_pView->ShowPage(ptrackCtr->GetSerialID());
CButton* pDelButton = (CButton*)GetDlgItem(IDC_BN_DELPAGE);
pDelButton->EnableWindow(TRUE);
// if(theApp.m_pView->m_pTrackCtrl!=NULL)
// theApp.m_pView->m_pTrackCtrl->SetAllCtrlHide();//原来的隐藏
// theApp.m_pView->m_pTrackCtrl = ptrackCtr;
// theApp.m_pView->m_pTrackCtrl->SetAllCtrlShow();
// theApp.m_pView->Invalidate(TRUE);
break;
}
/*
if(ptrackCtr->GetSerialID()==0)//主页面不能删除
{
CButton* pDelButton = (CButton*)GetDlgItem(IDC_BN_DELPAGE);
pDelButton->EnableWindow(FALSE);
}
else
{
CButton* pDelButton = (CButton*)GetDlgItem(IDC_BN_DELPAGE);
pDelButton->EnableWindow(TRUE);
}
if(ptrackCtr->GetSerialID()==itera->second)
{
theApp.m_pView->m_pTrackCtrl->SetAllCtrlHide();//原来的隐藏
theApp.m_pView->m_pTrackCtrl = ptrackCtr;
theApp.m_pView->m_pTrackCtrl->SetAllCtrlShow();
theApp.m_pView->Invalidate(TRUE);
break;
}
*/
}
}
}
示例6:
void CProxyInfoDialog::switchOK()
{
CButton *q = (CButton *)GetDlgItem( IDOK );
if ( (m_proxyServerName.GetLength() > 0) && (m_proxyPortNumber > 0) )
q->EnableWindow( TRUE );
else
q->EnableWindow( FALSE );
}
示例7: toggleTimeLapseUI
void CMainDlg::toggleTimeLapseUI(bool timeLapsing)
{
CButton stopTimeLapseButton = (CButton)GetDlgItem(IDC_STOP_TIMELAPSE_BUTTON);
CButton startTimeLapseButton = (CButton)GetDlgItem(IDC_START_TIMELAPSE_BUTTON);
CButton takePictureButton = (CButton)GetDlgItem(ID_TAKE_PICTURE);
stopTimeLapseButton.EnableWindow(timeLapsing);
startTimeLapseButton.EnableWindow(!timeLapsing);
takePictureButton.EnableWindow(!timeLapsing);
}
示例8: beRunning
void TestRunnerDlg::beRunning ()
{
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
runButton->EnableWindow (FALSE);
closeButton->EnableWindow (FALSE);
}
示例9: beIdle
void TestRunnerDlg::beIdle ()
{
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
runButton->EnableWindow (TRUE);
closeButton->EnableWindow (TRUE);
}
示例10: beRunDisabled
void TestRunnerDlg::beRunDisabled ()
{
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
CButton *stopButton = (CButton *)GetDlgItem (ID_STOP);
runButton->EnableWindow (FALSE);
stopButton->EnableWindow (FALSE);
closeButton->EnableWindow (TRUE);
}
示例11: OnBnClickedAddSetmskBt
void CAddCamDlg::OnBnClickedAddSetmskBt()
{
// TODO: 在此添加控件通知处理程序代码
mRangeIndex = 0;
char filepath[256];
Mat mMat;
CString FilePathName;
CFileDialog dlg(TRUE, //TRUE为OPEN对话框,FALSE为SAVE AS对话框
NULL,
NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
(LPCTSTR)_TEXT("JPG Files (*.jpg)|*.jpg|BMP Files (*.bmp)|*.bmp|"),
NULL);
if (dlg.DoModal() == IDOK)
{
FilePathName = dlg.GetPathName(); //文件名保存在了FilePathName里
CCommonFunc::UnicodeToAnsi(FilePathName.GetBuffer(), filepath, 256);
mMat = imread(filepath);
if(mMat.empty()) return;
cv::Size mSize = cv::Size(mImgRect.Width(), mImgRect.Height());
Mat image2 = Mat(mSize, CV_32S);
resize(mMat, image2, mSize);
CvImage::Mat2CImage(image2, mimg);
if (mimg.IsNull())
{
CButton* pBt = (CButton*)GetDlgItem(IDC_ADD_REDRAW_BT);
pBt->EnableWindow(FALSE);
pBt = (CButton*)GetDlgItem(IDC_ADD_ADDRANGE_BT);
pBt->EnableWindow(FALSE);
isDrawImg = false;
return;
}
int nBPP = mMat.channels()*8;
if (!maskimg.IsNull()) maskimg.Destroy();
maskimg.Create(mMat.cols, mMat.rows,nBPP );
CButton* pBt = (CButton*)GetDlgItem(IDC_ADD_REDRAW_BT);
pBt->EnableWindow(TRUE);
pBt = (CButton*)GetDlgItem(IDC_ADD_ADDRANGE_BT);
pBt->EnableWindow(TRUE);
mRangeIndex = 0;
for (int i = 0; i < MAX_RANGE_NUM; i++)
{
mWarnRange[i].clear();
}
}
else
{
return;
}
DrawImg();
isDrawImg = true;
}
示例12: OnShowWindow
void CDeleteTagsDialog::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
if ( bShow ) {
CButton *p = (CButton *)GetDlgItem( IDC_BUTTON_GET_TAGS );
p->EnableWindow( FALSE );
p = (CButton *)GetDlgItem( IDOK );
p->EnableWindow( FALSE );
}
}
示例13: _SetVerifyState
void CVNOCLoginDlg::_SetVerifyState( BOOL bVerifying )
{
m_bVerifying = bVerifying;
CEdit* pEditun = (CEdit*)GetDlgItem(IDC_LoginDlg_EDIT_USERNAME); ATLASSERT(pEditun);
CEdit* pEditpw = (CEdit*)GetDlgItem(IDC_LoginDlg_EDIT_PWD); ATLASSERT(pEditpw);
CButton* pBtnrp = (CButton*)GetDlgItem(IDC_LoginDlg_CHECKBOX_R); ATLASSERT(pBtnrp);
CButton* pBtnLogin = (CButton*)GetDlgItem(IDOK); ATLASSERT(pBtnLogin);
pEditun->EnableWindow(!bVerifying);
pEditpw->EnableWindow(!bVerifying);
pBtnrp->EnableWindow(!bVerifying);
pBtnLogin->EnableWindow(!bVerifying);
}
示例14: OnEdit
void CWSPrintDialog::OnEdit()
{
CButton *pCheck = (CButton *)GetDlgItem( 1041 );
CString sText;
CEdit *pNumber = (CEdit *)GetDlgItem( 1154 );
pNumber->GetWindowText(sText);
int iCopies = _ttoi(sText);
if(iCopies > 1)
pCheck->EnableWindow(TRUE);
else
pCheck->EnableWindow(FALSE);
m_bCollate = pCheck->GetCheck();
}
示例15: OnSelchangeComboDeleteTaglist
void CDeleteTagsDialog::OnSelchangeComboDeleteTaglist()
{
int location = m_tagList.GetCurSel();
CButton *p = (CButton *)GetDlgItem( IDOK );
if ( location == LB_ERR ) {
p->EnableWindow( FALSE );
return;
}
m_tagList.GetLBText( location, m_tag );
m_tagIndex = location;
p->EnableWindow( TRUE );
}