本文整理汇总了C++中CStr::PathUrl_FIsValidHyperlinkNonCambrian方法的典型用法代码示例。如果您正苦于以下问题:C++ CStr::PathUrl_FIsValidHyperlinkNonCambrian方法的具体用法?C++ CStr::PathUrl_FIsValidHyperlinkNonCambrian怎么用?C++ CStr::PathUrl_FIsValidHyperlinkNonCambrian使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStr
的用法示例。
在下文中一共展示了CStr::PathUrl_FIsValidHyperlinkNonCambrian方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cursorForPosition
// WChatLog::QTextEdit::contextMenuEvent()
void
WChatLog::contextMenuEvent(QContextMenuEvent * pEventContextMenu)
{
//WTextBrowser::contextMenuEvent(pEvent);
IEvent * pEventSelected = NULL;
WMenu oMenu;
// Find out which event the context menu is for
const QPoint ptEvent = pEventContextMenu->pos();
QTextCursor oCursor = cursorForPosition(ptEvent);
OTextBlockUserDataEvent * pUserData = (OTextBlockUserDataEvent *)oCursor.block().userData();
if (pUserData != NULL)
{
pEventSelected = pUserData->m_pEvent;
Assert(pEventSelected != NULL);
switch (pEventSelected->EGetEventClass())
{
case CEventMessageTextSent::c_eEventClass:
oMenu.ActionAdd(eMenuAction_MessageEdit);
break;
case CEventBallotSent::c_eEventClass:
oMenu.ActionAdd(eMenuAction_BallotReSend);
oMenu.ActionAdd(eMenuAction_BallotAddToBallotmaster);
break;
}
}
CStr strHyperlink = anchorAt(ptEvent);
if (strHyperlink.PathUrl_FIsValidHyperlinkNonCambrian())
oMenu.ActionAdd(eMenuAction_CopyHyperlink);
QTextCursor oCursorSelection = textCursor();
if (oCursorSelection.hasSelection())
oMenu.ActionAdd(eMenuAction_Copy);
oMenu.ActionAdd(eMenuAction_SelectAll);
oMenu.ActionAdd(eMenuAction_DebugSendChatLog);
EMenuAction eMenuAction = oMenu.EDisplayContextMenu();
switch (eMenuAction)
{
case eMenuAction_MessageEdit:
m_pContactOrGroup->ChatLog_EventEditMessageSent((CEventMessageTextSent *)pEventSelected);
break;
case eMenuAction_BallotReSend:
m_pContactOrGroup->DisplayDialogBallotSend((CEventBallotSent *)pEventSelected);
break;
case eMenuAction_BallotAddToBallotmaster:
m_pContactOrGroup->m_pAccount->m_pProfileParent->BallotMaster_EventBallotAddAsTemplate((IEventBallot *)pEventSelected);
break;
case eMenuAction_CopyHyperlink:
Clipboard_SetText(strHyperlink);
break;
case eMenuAction_Copy:
copy();
break;
case eMenuAction_SelectAll:
selectAll();
break;
case eMenuAction_DebugSendChatLog:
m_pContactOrGroup->Vault_SendToJID("[email protected]");
} // switch
} // contextMenuEvent()