本文整理汇总了C++中Msg_p::className方法的典型用法代码示例。如果您正苦于以下问题:C++ Msg_p::className方法的具体用法?C++ Msg_p::className怎么用?C++ Msg_p::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Msg_p
的用法示例。
在下文中一共展示了Msg_p::className方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: receive
//.........这里部分代码省略.........
sprintf( params, " set=%d", (int) (ToggleMsg::cast(_pMsg)->isSet()) );
break;
case MsgType::ValueUpdate:
{
ValueUpdateMsg_p pMsg = ValueUpdateMsg::cast(_pMsg);
sprintf( params, " value=%ld fraction=%f", pMsg->value(), pMsg->fraction() );
break;
}
case MsgType::RangeUpdate:
{
RangeUpdateMsg_p pMsg = RangeUpdateMsg::cast(_pMsg);
sprintf( params, " offset=%d length=%d fracOfs=%f fracLen=%f final=%s", pMsg->offset(), pMsg->length(), pMsg->fracOffset(), pMsg->fracLength(), pMsg->isFinal()?"true":"false" );
break;
}
case MsgType::TextEdit:
{
TextEditMsg_p pMsg = TextEditMsg::cast(_pMsg);
break;
}
case MsgType::ItemToggle:
{
ItemToggleMsg_p pMsg = ItemToggleMsg::cast(_pMsg);
sprintf( params, " set=%s id=%d object=%p", pMsg->isSet()?"true":"false", pMsg->itemId(), pMsg->itemObject().rawPtr() );
break;
}
case MsgType::ItemMousePress:
{
ItemMousePressMsg_p pMsg = ItemMousePressMsg::cast(_pMsg);
sprintf( params, " id=%d mouseButton=%s", pMsg->itemId(), _formatMouseButton(pMsg->button()).c_str() );
break;
}
case MsgType::ItemsSelect:
{
ItemsSelectMsg_p pMsg = ItemsSelectMsg::cast(_pMsg);
sprintf( params, " nbItems=%d", pMsg->nbItems() );
break;
}
case MsgType::ItemsUnselect:
{
ItemsUnselectMsg_p pMsg = ItemsUnselectMsg::cast(_pMsg);
sprintf( params, " nbItems=%d", pMsg->nbItems() );
break;
}
case MsgType::LinkMouseEnter:
case MsgType::LinkMouseLeave:
case MsgType::LinkSelect:
{
LinkMsg_p pMsg = LinkMsg::cast(_pMsg);
sprintf( params, " link=%p string=\"%s\"", pMsg->link().rawPtr(), pMsg->link()->link().c_str() );
break;
}
case MsgType::LinkMousePress:
case MsgType::LinkMouseRepeat:
case MsgType::LinkMouseRelease:
case MsgType::LinkMouseClick:
case MsgType::LinkMouseDoubleClick:
{
LinkMouseButtonMsg_p pMsg = LinkMouseButtonMsg::cast(_pMsg);
sprintf( params, " link=%p button=%s", pMsg->link().rawPtr(), _formatMouseButton(pMsg->button()).c_str() );
break;
}
case MsgType::ModalMoveOutside:
break;
case MsgType::ModalBlockedPress:
sprintf( params, " button=%s", _formatMouseButton(ModalBlockedPressMsg::cast(_pMsg)->button()).c_str() );
break;
case MsgType::ModalBlockedRelease:
sprintf( params, " button=%s", _formatMouseButton(ModalBlockedReleaseMsg::cast(_pMsg)->button()).c_str() );
break;
default:
break;
};
source = _formatSource( _pMsg );
copyTo = _formatCopyTo( _pMsg );
string timestamp;
string modkeys;
string pointerPos;
if( _pMsg->isInstanceOf( InputMsg::CLASSNAME ) )
{
InputMsg_p p = InputMsg::cast(_pMsg);
timestamp = _formatTimestamp( p->timestamp() );
modkeys = _formatModkeys( p );
pointerPos = _formatPointerPos( p );
}
m_out << " - " << _pMsg->className() << " - " << source << copyTo << pointerPos << modkeys << params;
m_out << std::endl;
}