当前位置: 首页>>代码示例>>C++>>正文


C++ Popup::mousePressed方法代码示例

本文整理汇总了C++中Popup::mousePressed方法的典型用法代码示例。如果您正苦于以下问题:C++ Popup::mousePressed方法的具体用法?C++ Popup::mousePressed怎么用?C++ Popup::mousePressed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Popup的用法示例。


在下文中一共展示了Popup::mousePressed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:dcthe1,项目名称:GameUI,代码行数:62,代码来源:uigui.cpp


注:本文中的Popup::mousePressed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。