本文整理汇总了C++中Popup::mouseMove方法的典型用法代码示例。如果您正苦于以下问题:C++ Popup::mouseMove方法的具体用法?C++ Popup::mouseMove怎么用?C++ Popup::mouseMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Popup
的用法示例。
在下文中一共展示了Popup::mouseMove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseMove
void Gui::mouseMove( int x, int y, MouseButtons mb )
{
// cout << "Ui::Gui::mouseMove( )" << endl;
if ( pChannelPopup != NULL ) {
pChannelPopup->mouseMove( x, y, mb );
if ( pChannelPopup != NULL ) {
if ( !pChannelPopup->passEvents() )
return;
}
}
if ( pMouseChannelWidget != NULL ) {
Widget* o = pMouseChannelWidget->mouseMove( x - pMouseChannelWidget->absoluteXPos(), y - pMouseChannelWidget->absoluteYPos(), mb );
if ( pLastMouseOver != o ) {
if ( (pLastMouseOver == pMouseChannelWidget) || (o == pMouseChannelWidget) ) {
if ( o == pMouseChannelWidget ) {
pMouseChannelWidget->mouseIn( mb );
} else {
pMouseChannelWidget->mouseOut( mb );
pMouseChannelWidget->onDestroy.disconnect( this );
}
} else {
pLastMouseOver->onDestroy.disconnect( this );
}
pLastMouseOver = o;
pLastMouseOver->onDestroy.connect( this, &Gui::objectDestroyed );
}
} else {
for( int i = 0; i < pPopups.count(); i++ ) {
Popup* p = pPopups.get( i );
Rect r = p->getRect();
if ( r.pointInside( x, y ) ) {
p->mouseMove( x, y, mb );
if ( !p->passEvents() )
return;
}
}
Widget* o = fgFrame().mouseMove( x, y, mb );
if ( o != NULL ) {
if ( o != pLastMouseOver ) {
if ( pLastMouseOver != NULL ) {
pLastMouseOver->onDestroy.disconnect( this );
pLastMouseOver->mouseOut( mb );
pLastMouseOver = NULL;
}
// if ( o != &frame )
o->mouseIn( mb );
pLastMouseOver = o;
pLastMouseOver->onDestroy.connect( this, &Gui::objectDestroyed );
}
//o->mouseMove( x, y, mb );
} else {
pLastMouseOver->onDestroy.disconnect( this );
pLastMouseOver = NULL;
}
}
if ( pMouseDragWidget != NULL ) {
if ( ( Utils::max(x, pPressedX) - Utils::min(x, pPressedX) > 5 ) || ( Utils::max(y, pPressedY) - Utils::min(y, pPressedY) > 5 ) ) {
DragObject* d = NULL;
pMouseDragWidget->onDrag( pMouseDragWidget, x - pMouseDragWidget->absoluteXPos(), y - pMouseDragWidget->absoluteYPos(), &d );
if ( d != NULL ) {
pMouseDragWidget->mouseReleased( x - pMouseDragWidget->absoluteXPos(), y - pMouseDragWidget->absoluteYPos(), mb );
d->popup( x - (d->width() / 2), y - (d->height() / 2), *this );
if ( mouseChannelWidget() != NULL )
unsetMouseChannelWidget( *mouseChannelWidget() );
d->mousePressed( x, y, mb );
}
pMouseDragWidget->onDestroy.disconnect( this );
pMouseDragWidget = NULL;
}
}
}