本文整理汇总了C++中CButton::SetCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::SetCheck方法的具体用法?C++ CButton::SetCheck怎么用?C++ CButton::SetCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::SetCheck方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnActivate
void CFindItemDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CDialog::OnActivate(nState, pWndOther, bMinimized);
if(CSettingsSM::GetInstance()->GetDefaultSearchDirection() == DefaultSearchDir_UP)
{
CButton* checkbtn = (CButton*)GetDlgItem(IDC_CHECK3);
if(checkbtn)
{
checkbtn->SetCheck(1);
}
}
else
{
CButton* checkbtn = (CButton*)GetDlgItem(IDC_CHECK4);
if(checkbtn)
{
checkbtn->SetCheck(1);
}
}
CButton* checkbtnMatchEx = (CButton*)GetDlgItem(IDC_CHECK1);
if(checkbtnMatchEx && CSettingsSM::GetInstance()->MatchExact())
{
checkbtnMatchEx->SetCheck(1);
}
CEdit* e = (CEdit*)GetDlgItem(IDC_EDIT_KEYWORD);
if(e)
{
std::wstring wstr = CSettingsSM::GetInstance()->GetUserString();
m_KeywordStringValue.SetString(wstr.c_str());
e->SetWindowTextW(m_KeywordStringValue);
e->SetFocus();
e->SetSel(0,-1);
e->SetSel(-1);
}
}
示例2: OnInitDialog
/**
@brief
@author BHK
@date 2009-06-09 오후 2:39:55
@param
@return
*/
BOOL CControlCableCreationDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CELoadDocData& docData = CELoadDocData::GetInstance();
CProjectSettingTable* pSettingTable = (CProjectSettingTable*)docData.GetTableOf(CProjectSettingTable::GetTableName());
if(pSettingTable)
{
m_nLoadControlCableRadio = atoi(pSettingTable->m_RecordEntry[0].FieldValueMap[_T("C_LOAD_CONTROL_CABLE_RADIO")].c_str());
if(0 == m_nLoadControlCableRadio)
{
CButton* pButton = (CButton*)GetDlgItem(IDC_RADIO_ALL_CONTROL_CABLE);
if(pButton) pButton->SetCheck(TRUE);
}
else
{
CButton* pButton = (CButton*)GetDlgItem(IDC_RADIO_UNSIZED_CONTROL_CABLE_ONLY);
if(pButton) pButton->SetCheck(TRUE);
}
UpdateData(FALSE);
const string rDesignLength = pSettingTable->m_RecordEntry[0].FieldValueMap[_T("C_DCS_IO_TYPE_DESIGN_LENGTH")];
SetDlgItemText(IDC_EDIT_DCS_DESIGN_LENGTH , rDesignLength.c_str());
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例3: ShowCurrentStatus
void TwitterAuthSelectDialog::ShowCurrentStatus( bool rescan /* = FALSE */ )
{
CButton *bp = (CButton *)GetDlgItem( IDC_BUTTON_GET_TOKEN );
bp->EnableWindow( m_useOAuth );
bp = (CButton *)GetDlgItem( IDC_RADIO_OAUTH );
bp->SetCheck( m_useOAuth ? 1 : 0 );
bp = (CButton *)GetDlgItem( IDC_RADIO_BASIC );
bp->SetCheck( m_useBASIC ? 1 : 0 );
CString status;
CStatic *sp = (CStatic *)GetDlgItem( IDC_TOKEN_STATUS );
if ( (m_oauthToken.GetLength() > 0) &&
(m_oauthTokenSecret.GetLength() > 0) )
status.LoadString( IDS_ACCESSTOKEN_ACQUIRED );
else
status.LoadString( IDS_ACCESSTOKEN_UNTAKEN );
sp->SetWindowText( status );
CEdit *p = (CEdit *)GetDlgItem(IDC_EDIT_USERNAME);
if ( rescan )
p->GetWindowText( m_username );
p->SetWindowText( m_username );
p->EnableWindow( m_useBASIC );
p = (CEdit *)GetDlgItem(IDC_EDIT_PASSWORD);
if ( rescan )
p->GetWindowText( m_password );
p->SetWindowText( m_password );
p->EnableWindow( m_useBASIC );
}
示例4: OnStop
// 停止
void CTabSample::OnStop(void)
{
CButton* iconbutton = NULL;
CStatic* iconstatic = NULL;
CButton* pButton = NULL;
iconstatic =(CStatic*)this->GetDlgItem(IDC_STATIC_LAUX);
iconstatic->SetIcon(m_iconLAUXDisconnected);
iconstatic = NULL;
for (int i=0; i<GraphViewNum; i++)
{
ProcessMessages();
iconbutton = (CButton*)this->GetDlgItem(m_iButtonIDFDU[i]);
iconbutton->SetIcon(m_iconFDUDisconnected);
iconbutton = NULL;
pButton = (CButton*)GetDlgItem(m_iCheckIDInstrumentFDU[i]);
pButton->SetCheck(0);
pButton = NULL;
pButton = (CButton*)GetDlgItem(m_iCheckIDNoiseFDU[i]);
pButton->SetCheck(0);
pButton = NULL;
}
delete iconstatic;
delete iconbutton;
delete pButton;
GetDlgItem(IDC_EDIT_SENDPORT)->EnableWindow(TRUE);
GetDlgItem(IDC_CHECK_HEARTBEAT)->EnableWindow(FALSE);
}
示例5: initChecks
/////////////////////////////////////////////////////////////////////////////
// set up stuff, turn things on and off
/////////////////////////////////////////////////////////////////////////////
void CNetworkAIDialog::initChecks()
{
int i, j;
CButton *pCheck;
CString str;
//traverse controls
for(i = 0; i < AI_DATABASE->numAI(); i++)
{
//set variables
pCheck = &m_AI1Check + i;
//set checkbox text
str.Format("Use %s", AI_DATABASE->getAIName(i));
pCheck->SetWindowText(str);
//see if it's already being used
for(j = 0; j < (int) GAME->m_players.size(); j++)
{
//find it
if(GAME->m_players[j].m_player.getID() == AI_DATABASE->getAIID(i))
{
pCheck->SetCheck(TRUE);
}
else
{
pCheck->SetCheck(FALSE);
}
}
}
}
示例6: OnInitDialog
/////////////////////////////////////////////////////////////////////////////
// set initial checkboxes
/////////////////////////////////////////////////////////////////////////////
BOOL CNetworkMessageDialog::OnInitDialog()
{
int i;
CButton *pButton;
CHelpDialog::OnInitDialog();
//help system
m_strHelp = HELP_SYSMESS;
//run through the list and turn on checks
for(i = 0; i < SYS_NOTIFY_SIZE; i++)
{
pButton = &m_Check1 + i;
if(GAME->m_iSysNotify & (1 << i))
{
pButton->SetCheck(TRUE);
}
else
{
pButton->SetCheck(FALSE);
}
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例7:
bool CFolderSet::Initial()
{
CComboBox* pComboPack = (CComboBox*)GetDlgItem(IDC_COMBO_PACKAGE_TYPE);
if( pComboPack == NULL) return false;
pComboPack->Clear();
itTypeInfo it = m_PackageSets.begin();
for(;it != m_PackageSets.end();it++)
{
pComboPack->AddString( (*it).strFileName.c_str());
}
UpdatePackSet();
CButton* pForcePack = (CButton*)GetDlgItem(IDC_CHECK_FORCE_MODIFY_PACKTYPE);
if(pForcePack)
pForcePack->SetCheck(m_bForceModifyPackType);
CComboBox* pComboCompress= (CComboBox*)GetDlgItem(IDC_COMBO_COMPRESS_TYPE);
if(pComboCompress == NULL) return false;
pComboCompress->Clear();
it = m_CompresSets.begin();
for(;it != m_CompresSets.end();it++)
{
pComboCompress->AddString( (*it).strFileName.c_str());
}
UpdateCompressSet();
CButton* pForceCompress = (CButton*)GetDlgItem(IDC_CHECK_FORCE_MODIFY_COMPRESSTYPE);
if(pForceCompress)
pForceCompress->SetCheck(m_bForceModifyCompressType);
return true;
}
示例8: OnInitDialog
BOOL CFindDialog::OnInitDialog()
{
CFindReplaceDialog::OnInitDialog();
CEdit* pEdit = (CEdit *)GetDlgItem(IDC_FIND_EDIT);
if(pEdit)
pEdit->SetWindowText(m_csSearchStr);
CButton* pChk = (CButton *)GetDlgItem(IDC_MATCH_CASE);
if(pChk)
pChk->SetCheck(m_bMatchCase);
pChk = (CButton *)GetDlgItem(IDC_MATCH_WHOLE_WORD);
if(pChk)
pChk->SetCheck(m_bMatchWholeWord);
pChk = (CButton *)GetDlgItem(IDC_WRAP_AROUND);
if(pChk)
pChk->SetCheck(m_bWrapAround);
pChk = (CButton *)GetDlgItem(IDC_SEARCH_BACKWARDS);
if(pChk)
pChk->SetCheck(m_bSearchBackwards);
return TRUE;
}
示例9: LoadFromReg
void CConfigDlg::LoadFromReg()
{
SelectPlaylist();
CButton *shuffle = (CButton*)GetDlgItem( IDC_CHECK_SHUFFLE );
shuffle->SetCheck( (((bool)m_reg[_T("Shuffle")])?BST_CHECKED:BST_UNCHECKED) );
m_secondsSlider.SetPos( m_reg[_T("IncreaseTime")] );
m_increase.SetCheck( (((bool)m_reg[_T("IncreaseVolume")]) ? BST_CHECKED : BST_UNCHECKED) );
OnBnClickedIncreaseCheck();
((CButton*)GetDlgItem(IDC_DO_MUTE))->SetCheck( (((bool)m_reg[_T("MuteOnReturn")]) ? BST_CHECKED : BST_UNCHECKED) );
((CButton*)GetDlgItem(IDC_ENABLE_SNOOZE))->SetCheck( (((bool)m_reg[_T("EnableSnooze")]) ? BST_CHECKED : BST_UNCHECKED) );
OnBnClickedEnableSnooze();
CButton *runatstartup = (CButton*)GetDlgItem( IDC_STARTUP_CHECK );
RegMap t(HKEY_CURRENT_USER);
t = t[_T("Software")][_T("Microsoft")][_T("Windows")][_T("CurrentVersion")][_T("Run")];
runatstartup->SetCheck( ((t.has_key(_T("iSnooze")))?BST_CHECKED:BST_UNCHECKED) );
long st = 0xff & (long)m_reg[_T("SnoozeTime")];
if( st < 1 ) st = 1; if( st > 60 ) st = 60;
TCHAR tm[4];
_stprintf( tm, _T("%d"), st );
GetDlgItem(IDC_SNOOZE_TIME)->SetWindowText( tm );
m_minimize.SetCheck( (((bool)m_reg[_T("MinimizeOnAlarm")])?BST_CHECKED:BST_UNCHECKED) );
//LoadTimeFromReg();
LoadAlarmsFromReg();
FillAlarmsList();
SetTimeDlg();
}
示例10: OnInitDialog
BOOL CNewsHubDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
CButton* pServerTcp = (CButton*)GetDlgItem(IDC_SERVER_TCP);
pServerTcp->SetCheck(true);
CEdit* pServerPort = (CEdit*)GetDlgItem(IDC_SERVER_PORT);
pServerPort->SetWindowText(CString("12345"));
CButton* pClientTcp = (CButton*)GetDlgItem(IDC_CLIENT_TCP);
pClientTcp->SetCheck(true);
CEdit* pHost = (CEdit*)GetDlgItem(IDC_HOST);
pHost->SetWindowText(CString("localhost"));
CEdit* pPort = (CEdit*)GetDlgItem(IDC_PORT);
pPort->SetWindowText(CString("12345"));
CEdit* pTimeout = (CEdit*)GetDlgItem(IDC_TIMEOUT);
pTimeout->SetWindowText(CString("1"));
CButton* pSendDeliveryConfirmation = (CButton*)GetDlgItem(IDC_SEND_DELIVERY_CONFIRMATION);
pSendDeliveryConfirmation->SetCheck(BST_CHECKED);
return TRUE; // return TRUE unless you set the focus to a control
}
示例11: OnInitDialog
BOOL CLogin::OnInitDialog()
{
CDialog::OnInitDialog();
CWinApp* pApp = AfxGetApp();
//determine range of accounts in history.
//range begins at 1 and ends at and includes latest. Bing: "latest" is actually the count for previous logins.
//
//in this case, if 0 is the latest, then there is no history
//and thus, don't do anything.
UINT latest = pApp->GetProfileInt("History", "Latest", 0);
m_ListBox.SetExtendedStyle( m_ListBox.GetExtendedStyle() | LVS_EX_FULLROWSELECT );
m_ListBox.InsertColumn(0, "Name", LVCFMT_LEFT, 75);
m_ListBox.InsertColumn(1, "Zone", LVCFMT_LEFT, 75);
m_ListBox.InsertColumn(2, "Server Host", LVCFMT_LEFT, 110);
m_ListBox.InsertColumn(3, "Port", LVCFMT_LEFT, 75);
for(UINT i = 1; i <= latest; i++)
{
FillBoxes(i, true);
}
int count = m_ListBox.GetItemCount();
if(count > 0)
{
VERIFY(m_ListBox.SetItemState(count-1, 0xFFFFFFFF, LVIS_SELECTED));
}
// set the last login
int last_login = pApp->GetProfileInt("History", "LastLogin", 0);
if(last_login == 0) /* no last login */
{
if(latest > 0)
{
last_login = latest;
}
}
if(last_login > 0)
{
FillBoxes(last_login, false);
}
CButton *cbox = (CButton *)GetDlgItem(IDC_CHECK_PRELOGINS);
if(pApp->GetProfileInt("ShowPreviousLogins", "YesNo", 1) == 0)
{
cbox->SetCheck(BST_UNCHECKED);
}
else
{
cbox->SetCheck(BST_CHECKED);
}
OnBnClickedCheckPrelogins();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例12: UpdateDialogData
/////////////////////////////////////////////////////////////////////////////
// CMouse message handlers
void CMouse::UpdateDialogData()
{
TCHAR TCValue[MAX_KEYVALUELEN];
m_invert=bInvert;
// UpdateData(FALSE);
CButton* pCheck;
pCheck = (CButton*) GetDlgItem(IDC_INVERT);
if(pCheck!=NULL)
{
if(bInvert)
pCheck->SetCheck(1);
else
pCheck->SetCheck(0);
}
m_mousexscale.SetPos(iMouselookXscale);
m_mouseyscale.SetPos(iMouselookYscale);
sprintf(TCValue,"%d",iMouselookXscale);
SetDlgItemText(IDC_MOUSEXSCALEVALUE,TCValue);
sprintf(TCValue,"%d",iMouselookYscale);
SetDlgItemText(IDC_MOUSEYSCALEVALUE,TCValue);
}
示例13: OnInitDialog
BOOL CDlgRazmGroup::OnInitDialog()
{
CDialog::OnInitDialog();
CButton *b = (CButton*)GetDlgItem(IDC_RADIO1);
ASSERT(b);
b->SetCheck(1);
m_EdD1.QInit(20);
m_EdD2.QInit(20);
b = (CButton*)GetDlgItem(IDC_RADIO3);
b->SetCheck(1);
m_Dat1.SetMode(1);
m_Dat2.SetMode(1);
x = 1;
m_EdD1.EnableWindow(FALSE);
m_EdD2.EnableWindow(FALSE);
// b->
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例14: GetDlgItem
void CTxMsgWndJ1939::vInitializeNmFields(void)
{
//Set the properties of the field first
m_omCurAddress.vSetBase(BASE_HEXADECIMAL);
m_omCurAddress.vSetSigned(false);
m_omCurAddress.LimitText(2);
m_omEcuName.vSetBase(BASE_HEXADECIMAL);
m_omEcuName.vSetSigned(false);
m_omEcuName.LimitText(16);
m_omDLCEdit.LimitText(4);
m_bNM = TRUE;
CButton* pButton = (CButton*) GetDlgItem(IDC_RADIO_NM);
pButton->SetCheck(BST_CHECKED);
//Populate the values
pButton = (CButton*)GetDlgItem(IDC_RQST_ADDRESS);
pButton->SetCheck(BST_UNCHECKED);
pButton = (CButton*)GetDlgItem(IDC_CMD_ADDRESS);
pButton->SetCheck(BST_UNCHECKED);
pButton = (CButton*)GetDlgItem(IDC_CLAIM_ADDRESS);
pButton->SetCheck(BST_CHECKED);
CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_NODE);
int nIndex = pComboBox->AddString(m_sClientParams.m_acName);
pComboBox->SetItemData(nIndex, m_sClientParams.m_byAddress);
pComboBox->SetCurSel(nIndex);
m_omEcuName.vSetValue(m_sClientParams.m_unEcuName);
m_omCurAddress.vSetValue(m_sClientParams.m_byAddress);
UpdateData(TRUE);
}
示例15: init
void CInsertDlg::init()
{
ImageInfo item = album.record(fileno[cur]);
SetDlgItemText(IDC_EDIT1, CString(item.filename().c_str()));
SetDlgItemText(IDC_EDIT2, CString(item.textcn().c_str()));
SetDlgItemText(IDC_EDIT3, CString(item.texten().c_str()));
SetDlgItemText(IDC_EDIT4, CString(item.postion().c_str()));
SetDlgItemText(IDC_EDIT5, CString(item.posl().c_str()));
SetDlgItemText(IDC_EDIT6, CString(item.lname().c_str()));
SetDlgItemText(IDC_EDIT7, CString(item.uper().c_str()));
CButton* radio;
radio = (CButton*)GetDlgItem(IDC_RADIO_1);
radio->SetCheck(0);
radio = (CButton*)GetDlgItem(IDC_RADIO_2);
radio->SetCheck(0);
radio = (CButton*)GetDlgItem(IDC_RADIO_3);
radio->SetCheck(0);
if (item.map().find("中国") != -1){
radio = (CButton*)GetDlgItem(IDC_RADIO_1);
}
else if (item.map() == "华师大"){
radio = (CButton*)GetDlgItem(IDC_RADIO_2);
}
else{
radio = (CButton*)GetDlgItem(IDC_RADIO_3);
}
radio->SetCheck(1);
}