void GPageLoadRequestManager::InitializeMainView()
{
	LOG_LEVEL4("InitializeMainView()");

	int iWidth (0);
	int iHeight(0);

	m_pMainView = new QWebView();

	if( GETCONF_BOOL(eDisplayManagerAutoAdjustmentViewSize) )
	{
		QScreen * pScreen(QScreen::instance());

		iHeight = pScreen->deviceHeight();
		iWidth  = pScreen->deviceWidth();

		QString strTemp("Window Size detected : [");
		strTemp += QString::number(iWidth)  + "x";
		strTemp += QString::number(iHeight) + "]";

		LOG_LEVEL3(strTemp);

		SETCONF(eDisplayManagerViewHeight, QString::number(iHeight));
		SETCONF(eDisplayManagerViewWidth, QString::number(iWidth));
	}
	else
	{
		iHeight = GETCONF_NUM(eDisplayManagerViewHeight);
		iWidth  = GETCONF_NUM(eDisplayManagerViewWidth);
	}

	m_pMainView->window()->resize(iWidth, iHeight);
	m_pMainView->window()->setFixedSize(iWidth, iHeight);
	m_pMainView->window()->showFullScreen();
	SetMainViewWidth(m_pMainView->width());
	SetMainViewHeight(m_pMainView->height());

	if( (m_pMainView->width() != iWidth) && (m_pMainView->height() != iHeight) )
	{
		throw GException("One of the dimensions exceded the maximun of the screen.");
	}

	LOG_LEVEL3(QString("Width(")  + QString::number(m_pMainView->width()) + ")");
	LOG_LEVEL3(QString("Height(") + QString::number(m_pMainView->height()) + ")");
}
示例#2
0
void PlayViewZone::setSelectedArea( const gcn::Rectangle& area )
{

  //
  // Y esta es el area con todos los elementos a seleccionar.
  //
  m_selectarea = area;
  model().clearMultipleActors();
  if ( m_selectarea.width == 0 && m_selectarea.height == 0 ) {
    //
    // Solo tenemos un punto seleccionado, veamos el actor que contiene.
    //
    gcn::Point pScreen( m_selectarea.x,
                        m_selectarea.y );
    gcn::Point p = model().Map().ScreenToLocal( pScreen );
    if ( ( p.x >= 0 && p.x < model().cxClient() )
        && ( p.y >= 0 && p.y < model().cyClient() ) ) model().select1Actor( p );

  } else {
    //
    // Tenemos el area a seleccionar.
    // seleccionemos los actores.
    //
    Scroller::iterator it;
    for ( it = ptScroller->begin( m_selectarea ); it != ptScroller->end();
        ++it ) {

      gcn::Point pScreen = ptScroller->plot( ( *it ) );

      if ( m_selectarea.isPointInRect( pScreen.x,
                                       pScreen.y ) ) {

        model().selectMultipleActors( model().Map().MapToLocal < gcn::Point >( ( *it ) ) );

      }

    }
  }

  m_selection = false; // Quitamos la seleccion.

}