本文整理汇总了C++中CButton::GetCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::GetCheck方法的具体用法?C++ CButton::GetCheck怎么用?C++ CButton::GetCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::GetCheck方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBnClickedAutorun
void TestRunnerDlg::OnBnClickedAutorun()
{
CButton *autoRunBtn = (CButton *)GetDlgItem (IDC_CHK_AUTORUN);
CWinApp* pApp = AfxGetApp();
pApp->WriteProfileInt("Tests", "autoRun", autoRunBtn->GetCheck());
}
示例2: Onconnect
void Display::Onconnect()
{
int port;
CString sername,username,mesg;
//Write to log file
log.WriteString("\n Connecting to Server");
//Get data from dialog box
GetDlgItemText(IDC_EDIT1,sername);
GetDlgItemText(IDC_EDIT3,username);
port=GetDlgItemInt(IDC_EDIT2);
if(username=="" || sername=="" )
{
AfxMessageBox("Please Enter the data properly");
return;
}
if(success)
{
anicon->Play(0,-1,-1);
log.WriteString("\n Playing data");
}
//Connect the client to server
username.MakeUpper();
sockclt.name=username;
///fix doan nay lai
//B0 kiem tra checkbox
CButton *x = (CButton*)GetDlgItem(IDC_CHECK);
CString strKey;
if (x->GetCheck()==1)
{
GetDlgItemText(IDC_EDIT_KEY,strKey);
if(strKey=="" )
{
AfxMessageBox("Please Enter the key");
return;
}
isKey=true;
char key[129];
HashSCKey (key,strKey);
if (radio3->GetCheck())
{
bcpTemp1=new CBlockCipherProvider;
bcpTemp2=new CBlockCipherProvider;
bcpTemp1->Init(key);
bcpTemp2->Init(key);
isStream=false;
}
else
{
scpTemp1=new CStreamCipherProvider;
scpTemp2=new CStreamCipherProvider;
scpTemp1->CMInit(key);
scpTemp2->CMInit(key);
isStream=true;
}
}
else
isKey=false;
//B1 nhap thong tin tu textbox
//B2 bung key
//B3 chuyen thanh khoa
SetDlgItemText(IDC_BUTTON1,"Connecting");
if(sockclt.Connect(sername,port))
log.WriteString("\n Successfully Connected to Server");
else
{
SetDlgItemText(IDC_BUTTON1,"&Connect");
if(success)
anicon->Stop();
MessageBox("Unable to Connect to Server\nVerify if Server name and Port are correct");
log.WriteString("\n Unable to connect to Server");
return;
}
isconnected=TRUE;
if(success)
anicon->Stop();
//Send the login message to server
mesg="NEW:"+username;
if(sockclt.Send(mesg,mesg.GetLength()))
log.WriteString("\n login Mesg sent to Server");
else
//.........这里部分代码省略.........
示例3: OnBtnStarttalk
void CClientDlg::OnBtnStarttalk()
{
// TODO: Add your control notification handler code here
if(0 != m_lLoginHandle)
{
// First set audio encode format in audio talk
m_curTalkMode.encodeType = DH_TALK_DEFAULT; // DH_TALK_DEFAULT is default way. Usually it is pcm type without head.
m_curTalkMode.dwSampleRate = 8000;
m_curTalkMode.nAudioBit = 8;
int nIndex = m_ctlEncodeType.GetCurSel();
if (-1 != nIndex)
{
DWORD dwItemData = m_ctlEncodeType.GetItemData(nIndex);
m_curTalkMode = m_lstTalkEncode.type[dwItemData];
}
// m_curTalkMode.dwSampleRate = 16000;
// m_curTalkMode.nAudioBit = 16;
BOOL bSuccess = CLIENT_SetDeviceMode(m_lLoginHandle, DH_TALK_ENCODE_TYPE, &m_curTalkMode);
// 设置喊话参数
NET_SPEAK_PARAM stSpeak = {sizeof(NET_SPEAK_PARAM)};
stSpeak.nMode = 0;
stSpeak.nSpeakerChannel = 0;
CButton* pButton = reinterpret_cast<CButton*>(GetDlgItem(IDC_CHECK_SPEAK));
if (0 != pButton)
{
if (BST_CHECKED == pButton->GetCheck())
{
stSpeak.nMode = 1; // 喊话
// 喊话喇嘛通道
int nIndex = m_ctlSpeakerChl.GetCurSel();
if (-1 != nIndex)
{
stSpeak.nSpeakerChannel = m_ctlSpeakerChl.GetItemData(nIndex);
}
}
}
bSuccess = CLIENT_SetDeviceMode(m_lLoginHandle, DH_TALK_SPEAK_PARAM, &stSpeak);
if (!bSuccess)
{
MessageBox(ConvertString("Set speaker param failure!"), ConvertString("Prompt"));
}
// Then enable audio talk
LONG lTalkHandle = CLIENT_StartTalkEx(m_lLoginHandle, AudioDataCallBack, (DWORD)this);
if(0 != lTalkHandle)
{
m_hTalkHandle = lTalkHandle;
GetDlgItem(IDC_BTN_STARTTALK)->EnableWindow(FALSE);
GetDlgItem(IDC_BTN_STOPTALK)->EnableWindow(TRUE);
// Then enbale local record function.(Does not call it if it is a one-direction audio talk.)
BOOL bSuccess = CLIENT_RecordStart();
if(bSuccess)
{
m_bRecordStatus = TRUE;
}
else
{
CLIENT_StopTalkEx(m_hTalkHandle);
MessageBox(ConvertString("Start local record failed!"), ConvertString("Prompt"));
}
}
else
{
MessageBox(ConvertString("Open talk failed!"), ConvertString("Prompt"));
}
}
else
{
MessageBox(ConvertString("Please login first!"), ConvertString("Prompt"));
}
}
示例4: if
void CTxMsgWndJ1939::OnBnClickedSend()
{
UpdateData();
LPARAM lParam = 0;
GetICANDIL()->DILC_GetControllerParams(lParam, 0, NUMBER_HW);
UINT unChannel = (UINT) lParam;
if (m_bNM == TRUE)
{
BYTE byAddress = (BYTE)m_omCurAddress.lGetValue();
BYTE byEcuName = (BYTE)m_omEcuName.lGetValue();
CButton* pButton = (CButton*)GetDlgItem(IDC_CLAIM_ADDRESS);
if (pButton->GetCheck() == BST_CHECKED)
{
for (UINT i = 0; i < unChannel; i++)
{
GetIJ1939DIL()->DILIJ_NM_ClaimAddress(m_sClientParams.m_dwClientId,
i + 1, byAddress);
}
}
pButton = (CButton*)GetDlgItem(IDC_RQST_ADDRESS);
if (pButton->GetCheck() == BST_CHECKED)
{
for (UINT i = 0; i < unChannel; i++)
{
GetIJ1939DIL()->DILIJ_NM_RequestAddress(m_sClientParams.m_dwClientId, i + 1, DEFAULT_PRIORITY, byAddress, byEcuName);
}
}
pButton = (CButton*)GetDlgItem(IDC_CMD_ADDRESS);
if (pButton->GetCheck() == BST_CHECKED)
{
UINT64 unECUNAME = m_omEcuName.lGetValue();
for (UINT i = 0; i < unChannel; i++)
{
GetIJ1939DIL()->DILIJ_NM_CommandAddress(m_sClientParams.m_dwClientId,
i + 1, unECUNAME, byAddress,
DEFAULT_PRIORITY, byAddress,
ADDRESS_ALL);
}
}
}
else
{
if ((eGetTransState() == TRANS_STOPPED) && GetIJ1939DIL()->DILIJ_bIsOnline())
{
m_sMsgToBeSent.m_unChannel = 1;
CString omChannel;
int nIndex = m_omComboChannel.GetCurSel();
if (nIndex != -1)
{
m_omComboChannel.GetLBText(m_omComboChannel.GetCurSel(), omChannel);
m_sMsgToBeSent.m_unChannel = _ttoi(omChannel);
}
//Check for DLC length
if (m_unDataLength > MAX_DATA_LEN_J1939)
{
CString omInvDLCMsg;
omInvDLCMsg.Format("Invalid DLC value: %d, Please enter a value between 0 and %d",
m_unDataLength, MAX_DATA_LEN_J1939);
vSetStatusBarText(omInvDLCMsg);
return;
}
//Data bytes
if (m_omMsgDataEditVal.GetLength() > (INT)(2 * m_unDataLength))
{
m_omMsgDataEditVal = m_omMsgDataEditVal.Left(2 * m_unDataLength);
}
//DLC
m_sMsgToBeSent.m_unDLC = CString_2_ByteArray(m_omMsgDataEditVal, m_sMsgToBeSent.m_abyData, MAX_DATA_LEN_J1939);
//Msg type
m_sMsgToBeSent.m_eMsgType = eGetCurrMsgType();
//Destination address
m_sMsgToBeSent.m_byDest = (BYTE)m_omTOEdit.lGetValue();
//Source address
m_sMsgToBeSent.m_bySrc = (BYTE)m_omFromEdit.lGetValue();
//Priority
m_sMsgToBeSent.m_byPriority = (BYTE)m_omPriorityEdit.lGetValue();
//PGN value
CString omPGN;
nIndex = m_omComboPGN.GetCurSel();
if (nIndex != -1)
{
m_omComboPGN.GetLBText(m_omComboPGN.GetCurSel(), omPGN);
}
else
{
m_omComboPGN.GetWindowText(omPGN);
omPGN = "0x" + omPGN;
}
m_sMsgToBeSent.m_unPGN = unGetMsgIDFromName(omPGN);
if (m_sMsgToBeSent.m_unPGN > MAX_LMT_FOR_PGN)
{
CString omPGN;
omPGN.Format("Invalid PGN value: %x, Please enter a value between 0 and 0x%x",
m_sMsgToBeSent.m_unPGN, MAX_LMT_FOR_PGN);
vSetStatusBarText(omPGN);
return;
}
//Now send the message
//Check for cyclic transmission
//.........这里部分代码省略.........
示例5: OnDCClicked
void CSearchAdvancedBox::OnDCClicked()
{
CButton* pBox = &m_wndCheckBoxDC;
pBox->SetCheck( pBox->GetCheck() == BST_CHECKED ? BST_UNCHECKED : BST_CHECKED );
}
示例6: OnCheckChanges
void CWSPrintDialog::OnCheckChanges()
{
CButton *pButton;
pButton = (CButton*)GetDlgItem(IDC_CHECK_CHANGES);
m_bChangesOnly = pButton->GetCheck();
}
示例7: OnCheckBw
void CWSPrintDialog::OnCheckBw()
{
CButton *pButton;
pButton = (CButton*)GetDlgItem(IDC_CHECK_BW);
m_bBlackAndWhite = pButton->GetCheck();
}
示例8: OnInitDialog
BOOL CBusEventHandlerDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CStringArray* pomStrArrayHandlerName = nullptr;
CDialog::OnInitDialog();
if(m_eBus == LIN)
{
GetDlgItem(IDC_CHKB_BUSEV_PRECONNECT_HANDLER)->ShowWindow(TRUE);
}
if( m_pDoc != nullptr )
{
CButton* pomButton = nullptr;
CString omStrHandlerName = "" ;
CString omStrControl = "" ;
INT nCheck = 0;
// get the pointer to CStringArray of error handlers prototypes
pomStrArrayHandlerName = m_pDoc->pomStrGetBusEventHandlerPrototypes();
if(pomStrArrayHandlerName != nullptr )
{
// Check for the handlers already added.
for(INT i = 0; i<defBUSEV_HANDLER_NUMBER; i++)
{
for(INT j =0; j<pomStrArrayHandlerName->GetSize(); j++)
{
pomButton = (CButton*)GetDlgItem(IDC_CHKB_BUSEV_CONNECT_HANDLER+i);
if(pomButton != nullptr )
{
omStrHandlerName = pomStrArrayHandlerName->GetAt(j);
pomButton->GetWindowText(omStrControl);
omStrControl.Replace(' ','_');
omStrControl.Replace('-','_');
omStrControl = "OnBus_"+ omStrControl;
// The find the control text in added handlers text
if( omStrHandlerName.Find(omStrControl) != -1 )
{
// If the dialog box is invoked for delete, check
// the box of already added handlers else check and
// disable
if(m_bIsDelete == TRUE )
{
pomButton->SetCheck(TRUE);
}
else
{
pomButton->SetCheck(TRUE);
pomButton->EnableWindow(FALSE);
}
}
}
}
}
}
// Disable all other check box corresponding to which the handlers
// are not added and dialog box in invoked to delete the handlers
if(m_bIsDelete == TRUE )
{
for(INT i = 0; i<defBUSEV_HANDLER_NUMBER; i++)
{
pomButton = (CButton*)GetDlgItem(IDC_CHKB_BUSEV_CONNECT_HANDLER+i);
if(pomButton != nullptr )
{
nCheck = pomButton->GetCheck();
if(nCheck == 0 )
{
pomButton->EnableWindow(FALSE);
}
}
}
// Set the dialog caption text to indicate user is deleting
// the handlers
SetWindowText(defBUSEV_HANDLER_TEXT_DEL);
}
else
{
// Set the dialog caption text to indicate user is adding
// the handlers
SetWindowText(defBUSEV_HANDLER_TEXT_ADD);
}
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例9: IsAddMode
bool xTerrainVegDlg::IsAddMode()
{
CButton * btn = (CButton *)GetDlgItem(IDC_TV_AddVeg);
return btn->GetCheck() == BST_CHECKED;
}