本文整理汇总了C++中CStr::FIsEmptyString方法的典型用法代码示例。如果您正苦于以下问题:C++ CStr::FIsEmptyString方法的具体用法?C++ CStr::FIsEmptyString怎么用?C++ CStr::FIsEmptyString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStr
的用法示例。
在下文中一共展示了CStr::FIsEmptyString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
// WChatInput::QObject::event()
bool
WChatInput::event(QEvent * pEvent)
{
QEvent::Type eEventType = pEvent->type();
//MessageLog_AppendTextFormatSev(eSeverityNoise, "WChatInput::event(type=$i)\n", eEventType);
if (eEventType == QEvent::KeyPress)
{
QKeyEvent * pEventKey = static_cast<QKeyEvent *>(pEvent);
const Qt::Key eKey = (Qt::Key)pEventKey->key();
//MessageLog_AppendTextFormatSev(eSeverityNoise, "WChatInput::event(QEvent::KeyPress, key=0x$p, modifiers=$x)\n", eKey, pEventKey->modifiers());
if ((eKey & d_kmKeyboardSpecialKeys) == 0)
{
// The user typed something other than a special key
m_ttcBeforeChatStatePaused = d_ttcChatStateEventPaused;
if (m_tidChatStateComposing == d_zNA)
{
m_tidChatStateComposing = startTimer(d_ttiChatState); // Create a timer to determine when the user 'stopped' typing
m_pwLayoutChatLog->Socket_WriteXmlChatState(eChatState_zComposing);
}
}
if ((pEventKey->modifiers() & ~Qt::KeypadModifier) == Qt::NoModifier)
{
ITreeItemChatLogEvents * pContactOrGroup = m_pwLayoutChatLog->PGetContactOrGroup_NZ();
pContactOrGroup->TreeItem_IconUpdateOnMessagesRead(); // Any key pressed in the message input assumes the user read the message history
//m_pwLayoutChatLog->TreeItem_UpdateIconMessageRead(); // Any key pressed in the message input assumes the user read the message history
if (eKey == Qt::Key_Enter || eKey == Qt::Key_Return)
{
EUserCommand eUserCommand = eUserCommand_ComposingStopped; // Pretend the text message was sent
CStr strText = *this;
if (!strText.FIsEmptyString())
{
m_strTextLastWritten = strText;
if (m_pEventEdit == NULL)
eUserCommand = pContactOrGroup->Xmpp_EParseUserCommandAndSendEvents(IN_MOD_INV strText); // This is the typical case of a new message
else
{
// The user was editing an existing message
m_pEventEdit->EventUpdateMessageText(strText, INOUT m_pwLayoutChatLog);
m_pEventEdit = NULL;
}
ChatStateComposingCancelTimer((BOOL)eUserCommand); // After sending a message, cancel (reset) the timer to, so a new 'composing' notification will be sent when the user starts typing again. BTW, there is no need to send a 'pause' command since receiving a text message automatically implies a pause.
} // if
if (eUserCommand != eUserCommand_Error)
{
clear(); // Clear the chat text
setCurrentCharFormat(QTextCharFormat());
}
return true;
} // if (enter)
if (eKey == Qt::Key_Up)
{
// Set the previous text if there is notning in the edit box
CStr strText = *this;
if (strText.FIsEmptyString())
{
//EditEventText(pContactOrGroup->Vault_PGetEventLastMessageSentEditable_YZ());
m_pEventEdit = pContactOrGroup->Vault_PFindEventLastMessageTextSentMatchingText(IN m_strTextLastWritten);
if (m_pEventEdit != NULL)
{
MessageLog_AppendTextFormatSev(eSeverityNoise, "Editing Event ID $t\n", m_pEventEdit->m_tsEventID);
}
setPlainText(m_strTextLastWritten);
moveCursor(QTextCursor::End);
return true;
}
}
if (eKey == Qt::Key_Escape)
{
m_pEventEdit = NULL;
clear(); // Clear the chat text
return TRUE;
}
} // if
}
else if (eEventType == QEvent::FocusIn)
{
//m_pwLayoutChatLog->OnEventFocusIn();
m_pwLayoutChatLog->PGetContactOrGroup_NZ()->TreeItem_IconUpdateOnMessagesRead();
}
return WEditTextArea::event(pEvent);
} // event()