本文整理汇总了C++中CEdit::GetWindowText方法的典型用法代码示例。如果您正苦于以下问题:C++ CEdit::GetWindowText方法的具体用法?C++ CEdit::GetWindowText怎么用?C++ CEdit::GetWindowText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEdit
的用法示例。
在下文中一共展示了CEdit::GetWindowText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}
示例2: GetDlgItem
void CID3v2Page1::OnNormalize()
{
BOOL bReplaceUnderscores = theApp.m_NormeProfile.GetUnderscoresReplacement();
CEdit* pEditTitle = (CEdit*) GetDlgItem( IDC_EDIT_TITLE );
CEdit* pEditComment = (CEdit*) GetDlgItem( IDC_EDIT_COMMENT );
CString strArtist = m_comboArtist.GetText();
CString strAlbum = m_comboAlbum.GetText();
CString strTitle;
CString strComment;
pEditTitle->GetWindowText( strTitle );
pEditComment->GetWindowText( strComment );
strArtist = CAudioFile::Normalize( strArtist, theApp.m_NormeProfile.GetNorm( ARTIST ), bReplaceUnderscores );
strAlbum = CAudioFile::Normalize( strAlbum, theApp.m_NormeProfile.GetNorm( ALBUM ), bReplaceUnderscores );
strTitle = CAudioFile::Normalize( strTitle, theApp.m_NormeProfile.GetNorm( TITLE ), bReplaceUnderscores );
strComment = CAudioFile::Normalize( strComment, theApp.m_NormeProfile.GetNorm( COMMENT ), bReplaceUnderscores );
m_comboArtist.SetText( strArtist );
m_comboAlbum.SetText( strAlbum );
pEditTitle->SetWindowText( strTitle );
pEditComment->SetWindowText( strComment );
}
示例3: OnEnChangeReaderWriteData
//===========================================================================
void CFAVReaderDlg::OnEnChangeReaderWriteData()
//===========================================================================
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialogEx::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
CEdit* pEditW = (CEdit*)GetDlgItem(IDC_READER_WRITE_DATA);
CEdit* pEditL = (CEdit*)GetDlgItem(IDC_READER_LENGTH_DATA);
CString strW = _T("");
CString strL = _T("");
pEditW->GetWindowText(strW);
pEditL->GetWindowText(strL);
int nWriteLength = strW.GetLength();
int nWordsLength = CStringHexToInt(strL);
int nDiff;
nDiff = nWordsLength*4 - nWriteLength;
if(nDiff > 0)
strW.Format(_T("Need to enter the %d text."), nDiff);
else
strW.Format(_T("More than %d text."), -nDiff);
m_ToolTips.AddTool(GetDlgItem(IDC_READER_WRITE_DATA), strW);
}
示例4: OnOK
void EditAmazonAccessKey::OnOK()
{
CEdit *p = (CEdit *)GetDlgItem( IDC_EDIT_ACCESS_KEY_ID );
p->GetWindowText( m_accessKeyID );
p = (CEdit *)GetDlgItem( IDC_EDIT_ACCESS_KEY_SECRET );
p->GetWindowText( m_accessKeySecret );
if ( m_accessKeyID.GetLength() > 0 &&
m_accessKeySecret.GetLength() > 0 )
CDialog::OnOK();
}
示例5: OnBnClickedServerStart
void CNewsHubDlg::OnBnClickedServerStart()
{
CEdit* pPort = (CEdit*)GetDlgItem(IDC_SERVER_PORT);
CString strPort;
pPort->GetWindowText(strPort);
int port = atoi(CT2CA(strPort));
CButton* pServerTcp = (CButton*)GetDlgItem(IDC_SERVER_TCP);
bool bTcp = (pServerTcp->GetCheck() == BST_CHECKED);
ServerLoop* serverLoop;
try
{
NewsHub::Server* server;
if (bTcp)
server = new NewsHub::TcpServer(port);
else
server = new NewsHub::UdpServer(port);
serverLoop = new ServerLoop(server, new NewsHub::ServerThreadLoop(*server, *this, bTcp));
}
catch (std::exception & e)
{
MessageBox(CString(e.what()), _T("Exception"), MB_OK);
return;
}
CString serverDescription = CString(bTcp?"TCP":"UDP") + CString(" server is listening on port ") + strPort;
CListBox* pRunningServers = (CListBox*)GetDlgItem(IDC_RUNNING_SERVERS);
int row = pRunningServers->AddString(serverDescription);
pRunningServers->SetItemDataPtr(row, serverLoop);
}
示例6: 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);
}
示例7: OnDeltaPosFloatSpin
//-----------------------------------------------------------------------------
// Purpose:
// Input : pNMHDR -
// pResult -
//-----------------------------------------------------------------------------
void CFaceEditMaterialPage::OnDeltaPosFloatSpin( NMHDR *pNMHDR, LRESULT *pResult )
{
NM_UPDOWN *pNMUpDown = ( NM_UPDOWN* )pNMHDR;
CEdit *pEdit = NULL;
switch( pNMUpDown->hdr.idFrom )
{
case IDC_SPINSCALEY:
{
pEdit = &m_scaleY;
break;
}
case IDC_SPINSCALEX:
{
pEdit = &m_scaleX;
break;
}
}
if( pEdit != NULL )
{
CString str;
pEdit->GetWindowText(str);
float fTmp = atof(str);
fTmp += 0.1f * float( pNMUpDown->iDelta );
str.Format( "%.2f", fTmp );
pEdit->SetWindowText( str );
*pResult = 0;
}
}
示例8: OnBtnExecute
/*
==============
OnBtnExecute
User wants to issue commands
==============
*/
void CServerCtrlDlg::OnBtnExecute( void )
{
if ( !m_hSend || !m_hMappedFile )
return;
// Get commands
CEdit *pEdit = (CEdit *)GetDlgItem( IDC_EDIT_COMMANDS );
if ( pEdit )
{
CString cmds;
pEdit->GetWindowText( cmds );
// Get buffer
char *sz = (char *)GetMappedBuffer( m_hMappedFile );
if ( sz )
{
// Write command int32 token
*(int *)&sz[ 0 ] = ENGINE_ISSUE_COMMANDS;
// Write rest of line, including a return character ( necessary? )
sprintf( sz + sizeof( int ), "%s\n", (char *)(LPCSTR)cmds );
// Release the buffer
ReleaseMappedBuffer( sz );
// Store off what we are expecting in return buffer
m_nPendingRequest = ENGINE_ISSUE_COMMANDS;
// Signal HLDS to check for requests
SetEvent( m_hSend );
}
}
}
示例9: OnOK
void InputPinDialog::OnOK()
{
long num = 0;
CString str = "";
CEdit *p = (CEdit *)GetDlgItem( IDC_EDIT_PIN );
p->GetWindowText( str );
if ( str.GetLength() > 0 )
num = atol( str );
if ( str.GetLength() < 6 ) {
// 注: 0 で始まる6桁の数字もあり得る(ことがわかった)
CString ttl = _T("");
CString msg = _T("");
ttl.LoadString(IDS_TTL_INPUT_PIN);
msg.LoadString(IDS_TXT_INPUT_PIN);
MessageBox( msg, ttl, MB_OK|MB_ICONWARNING );
return;
}
char buf[64];
m_pin = _T("00000");
m_pin += ltoa( num, buf, 10 );
m_pin = m_pin.Right(6);
CDialog::OnOK();
}
示例10: validate_date
int CExtIdDetail::validate_date( CEdit &EditDate, LPTSTR(VarName) )
{
CString DateString;
EditDate.GetWindowText(DateString);
// does some nifty date time validation things.....
COleDateTime CheckTime;
enum COleDateTime::DateTimeStatus InputDateStatus;
int status = ABP_SUCCESS;
CString ErrorMsg;
if( !DateString.IsEmpty() )
{
CheckTime.SetTime( 0, 0, 0);
// parse the date string.....
CheckTime.ParseDateTime( DateString, VAR_DATEVALUEONLY, LANG_USER_DEFAULT );
// check for a valid date...
InputDateStatus = CheckTime.GetStatus();
if( InputDateStatus == COleDateTime::invalid ) // invalid date
{
CGuiMsg::GuiMessage(GUIMSG_DATE_INVALID);
DateString.Empty();
EditDate.SetWindowText(DateString);
UpdateData(FALSE);
status = ABP_FAILURE;
}
}
return status;
}
示例11: check_date_input
void CExtIdDetail::check_date_input( CEdit &EditDate )
{
CString DateString;
EditDate.GetWindowText(DateString);
int iIsSlash;
int iIsNum;
int status = ABP_FAILURE;
int size = 0;
TCHAR CurrentChar;
if( !DateString.IsEmpty() )
{
CurrentChar = DateString.GetAt((size = DateString.GetLength() - 1));
if( (iIsNum = isdigit( (int)CurrentChar)) ||
!(iIsSlash = strncmp( (LPCTSTR)&CurrentChar, (LPCTSTR)"/", 1)) )
{
if( ((iIsNum >= 0) && (iIsNum <= 9)) || (!iIsSlash ) ) status = ABP_SUCCESS;
}
if( status == ABP_FAILURE )
{
Beep( 400, 75 );
DateString.GetBufferSetLength( size );
}
}
return;
}
示例12: UpdateLoadLog
//Thread safe way to update the load log
void CLoadLTADlg::UpdateLoadLog()
{
CString sTextToAdd;
g_LoadLogPipeCS.Lock(INFINITE);
sTextToAdd = sm_sLoadLogPipe;
sm_sLoadLogPipe = "";
g_LoadLogPipeCS.Unlock();
if(!sTextToAdd.IsEmpty())
{
CString sLogText;
CEdit* pEdit = ((CEdit*)GetDlgItem(IDC_LOADLOG));
pEdit->GetWindowText(sLogText);
sLogText += sTextToAdd;
pEdit->SetWindowText(sLogText);
pEdit->LineScroll(pEdit->GetLineCount());
}
}
示例13: OnEnChangeEditTick
void NetCfg::OnEnChangeEditTick()
{
// TODO: 如果该控件是 RICHEDIT 控件,它将不
// 发送此通知,除非重写 CDialog::OnInitDialog()
// 函数并调用 CRichEditCtrl().SetEventMask(),
// 同时将 ENM_CHANGE 标志“或”运算到掩码中。
// TODO: 在此添加控件通知处理程序代码
CString strout;
CEdit *hEdit;
int len;
char *pbuf;
int tick;
hEdit = (CEdit*)GetDlgItem(IDC_EDIT_TICK);
hEdit->GetWindowText(strout);
len = strout.GetLength();
pbuf = strout.GetBuffer();
// 限定最大设置值为 60000 ms
tick = atoi(pbuf);
if (tick < 10) {
hEdit->SetWindowText("10");
hEdit->SetSel(2,2,1);
}
else if (tick > 60000) {
hEdit->SetWindowText("60000");
hEdit->SetSel(5,5,1);
}
}
示例14: OnBnClickedSend
void CNewsHubDlg::OnBnClickedSend()
{
CListBox* pRunningClients = (CListBox*)GetDlgItem(IDC_RUNNING_CLIENTS);
int row = pRunningClients->GetCurSel();
if (row == LB_ERR)
{
MessageBox(_T("Please select one of running clients to send message through"), _T("No client selected"), MB_OK);
return;
}
CEdit* pMessage = (CEdit*)GetDlgItem(IDC_MESSAGE);
CString message;
pMessage->GetWindowText(message);
ClientLoop* clientLoop = (ClientLoop*)pRunningClients->GetItemDataPtr(row);
unsigned int messageId = clientLoop->nextMessageId();
clientLoop->Queue()->AddMessage(messageId, std::string(CT2CA(message)));
CListBox* pSentMessages = (CListBox*)GetDlgItem(IDC_SENT_MESSAGES);
NewsHub::TcpClient* tcpClient = (NewsHub::TcpClient*)clientLoop->Client();
CString str;
str.Format(_T("(To: %s:%d msgId:%d): %s"),
CString(tcpClient->Host().c_str()), tcpClient->Port(), messageId, message);
row = pSentMessages->AddString(str);
MessageInfo* messageInfo = new MessageInfo;
messageInfo->queue = clientLoop->Queue();
messageInfo->messageId = messageId;
pSentMessages->SetItemDataPtr(row, messageInfo);
pSentMessages->SetCurSel(row);
}
示例15: OnEndlabeledit
void CFileBrowserListCtrl::OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
CEdit *pEdit = GetEditControl();
if (m_LabelEdit && pEdit != NULL) { // if label edit wasn't canceled
CString NewName;
pEdit->GetWindowText(NewName); // label is new item name
int ItemIdx = pDispInfo->item.iItem;
CDirItem& item = m_DirList.GetItem(ItemIdx);
if (NewName != item.GetName()) { // if name is different
CPathStr NewPath(GetFolder());
NewPath.Append(NewName); // make new item path
CString OldPath(GetItemPath(ItemIdx));
if (RenameFile(m_hWnd, OldPath, NewPath)) {
item.SetName(NewName); // update item name
NMFBRENAMEITEM nmri;
nmri.pszOldPath = OldPath;
nmri.pszNewPath = NewPath;
Notify(FBLCN_RENAMEITEM, &nmri);
}
}
}
m_LabelEdit = FALSE;
*pResult = 0;
}