本文整理汇总了C++中Popup::getRect方法的典型用法代码示例。如果您正苦于以下问题:C++ Popup::getRect方法的具体用法?C++ Popup::getRect怎么用?C++ Popup::getRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Popup
的用法示例。
在下文中一共展示了Popup::getRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseReleased
void Gui::mouseReleased( int x, int y, MouseButtons mb )
{
cout << "Ui::Gui::mouseReleased( " << x << ", " << y << " )" << endl;
if ( pChannelPopup != NULL ) {
pChannelPopup->mouseReleased( x, y, mb );
if ( pChannelPopup != NULL ) {
if ( !pChannelPopup->passEvents() )
return;
}
}
if ( pMouseDragWidget != NULL ) {
pMouseDragWidget->onDestroy.disconnect( this );
pMouseDragWidget = NULL;
}
if ( pMouseChannelWidget != NULL ) {
if ( pMousePressedWidget == pMouseChannelWidget ) {
if ( pLastClick <= pDblClickTicks ) {
pMouseChannelWidget->mouseDblClick( x - pMouseChannelWidget->absoluteXPos(), y - pMouseChannelWidget->absoluteYPos(), mb );
pMouseChannelWidget->mouseClick( x - pMouseChannelWidget->absoluteXPos(), y - pMouseChannelWidget->absoluteYPos(), mb );
pLastClick = pDblClickTicks + 1;
} else {
pMouseChannelWidget->mouseClick( x - pMouseChannelWidget->absoluteXPos(), y - pMouseChannelWidget->absoluteYPos(), mb );
pLastClick = 0;
}
pMousePressedWidget->onDestroy.disconnect( this );
pMousePressedWidget = NULL;
}
pMouseChannelWidget->mouseReleased( x - pMouseChannelWidget->absoluteXPos(), y - pMouseChannelWidget->absoluteYPos(), mb );
} else {
for( int i = 0; i < pPopups.count(); i++ ) {
Popup* p = pPopups.get( i );
Rect r = p->getRect();
if ( r.pointInside( x, y ) ) {
p->mouseReleased( x, y, mb );
if ( !p->passEvents() )
return;
}
}
Widget* o = fgFrame().mouseReleased( x, y, mb );
if ( o != NULL ) {
if ( pMousePressedWidget == o ) {
pMousePressedWidget->onDestroy.disconnect( this );
pMousePressedWidget = NULL;
o->mouseClick( x, y, mb );
}
//o->mouseReleased( x, y, mb );
}
}
}
示例2: 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;
}
}
}
示例3: mousePressed
void Gui::mousePressed( int x, int y, MouseButtons mb )
{
cout << "Ui::Gui::mousePressed( " << x << ", " << y << " )" << endl;
if ( pChannelPopup != NULL ) {
pChannelPopup->mousePressed( x, y, mb );
if ( pChannelPopup != NULL ) {
if ( !pChannelPopup->passEvents() )
return;
}
}
if ( pMouseChannelWidget != NULL ) {
if ( pMousePressedWidget != NULL ) {
pMousePressedWidget->onDestroy.disconnect( this );
}
pMousePressedWidget = pMouseChannelWidget;
pMousePressedWidget->onDestroy.connect( this, &Gui::objectDestroyed );
pMouseChannelWidget->mousePressed( x - pMouseChannelWidget->absoluteXPos(), y - pMouseChannelWidget->absoluteYPos(), mb );
} else {
for ( int i = 0; i < pPopups.count(); i++ ) {
Popup* p = pPopups.get( i );
Rect r = p->getRect();
if ( r.pointInside( x, y ) ) {
p->mousePressed( x, y, mb );
if ( !p->passEvents() )
return;
}
}
Widget* o = fgFrame().mousePressed( x, y, mb);
setFocusedWidget( o );
if ( ( o != NULL ) ) {
if ( pMousePressedWidget != NULL ) {
pMousePressedWidget->onDestroy.disconnect( this );
}
if ( pMouseDragWidget != NULL ) {
pMouseDragWidget->onDestroy.disconnect( this );
}
pMousePressedWidget = o;
pMousePressedWidget->onDestroy.connect( this, &Gui::objectDestroyed );
pMouseDragWidget = o;
pMouseDragWidget->onDestroy.connect( this, &Gui::objectDestroyed );
} else {
if ( pMouseDragWidget != NULL ) {
pMouseDragWidget->onDestroy.disconnect( this );
pMouseDragWidget = NULL;
}
}
}
pPressedX = x;
pPressedY = y;
}
示例4: render
void Gui::render( )
{
List<UpdateWidget*>& l = Widget::updatedWidgets();
if ( l.count() <= 0 ) return;
int i = l.count() - 1;
Widget* o = NULL;
List<Widget*> tmpL;
l.sort( &objectsListSortCallback );
while( i >= 0 ){
o = l.get( i )->o;
Rect r = l.get( i )->r;
if ( pFgFrame != NULL )
fgFrame().getWidgetsInRect( tmpL, r );
if ( pTopFrame != NULL )
topFrame().getWidgetsInRect( tmpL, r );
tmpL.sort( &objectListSortCallback );
int i2 = 0;
bool skip = false;
// int before = tmpL.count();
while ( (i2 < tmpL.count()) && ( o != NULL ) ) {
Widget* o2 = tmpL.get( i2 );
Rect r2( o2->absoluteXPos(), o2->absoluteYPos(), o2->width(), o2->height() );
if ( o2->border() != NULL ) {
if ( o2->border()->drawmode() != DM_OPAQUE )
r2.applyBorder( o2->border() );
}
if ( (r2.encloses( r )) && ( o2->drawmode() == DM_OPAQUE ) && ( o2->visible() ) ) {
if ( o2->zIndex() > o->zIndex() ) {
skip = true;
break;
} else {
while ( i2+1 < tmpL.count() ) {
tmpL.remove( i2+1 );
}
break;
}
}
i2++;
}
if ( !skip ) {
for( int i2 = tmpL.count() - 1; i2 >= 0; i2-- ){
Rect r2 = Rect( tmpL.get( i2 )->absoluteXPos(),
tmpL.get( i2 )->absoluteYPos(),
tmpL.get( i2 )->width(), tmpL.get( i2 )->height() );
r2.crop( r );
screen().pushClipRect( r2 );
screen().pushClipRect( tmpL.get( i2 )->getClipRect() );
screen().setRelativePoint( tmpL.get( i2 )->absoluteXPos(), tmpL.get( i2 )->absoluteYPos() );
tmpL.get( i2 )->renderBorder( screen() );
screen().setRelativePoint( tmpL.get( i2 )->absoluteXPos() + tmpL.get( i2 )->borderLeft(),
tmpL.get( i2 )->absoluteYPos() + tmpL.get( i2 )->borderTop() );
Rect r3( r2.left - tmpL.get( i2 )->absoluteXPos() - tmpL.get( i2 )->borderLeft(), r2.top - tmpL.get( i2 )->absoluteYPos() - tmpL.get( i2 )->borderTop(), r2.width, r2.height );
tmpL.get( i2 )->render( screen(), r3 );
screen().popClipRect();
screen().popClipRect();
screen().setRelativePoint( 0, 0 );
}
for( int i = 0; i < pPopups.count(); i++ ) {
Popup* p = pPopups.get( i );
r.crop( p->getRect() );
if ( r.area() > 0 ) {
Rect r = p->getRect();
r.crop( r );
p->render( r );
}
}
} else {
}
tmpL.clear();
i--;
}
Widget::clearUpdatedWidgets();
}