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


C++ GetWidth函数代码示例

本文整理汇总了C++中GetWidth函数的典型用法代码示例。如果您正苦于以下问题:C++ GetWidth函数的具体用法?C++ GetWidth怎么用?C++ GetWidth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: Stretch

 void Stretch(ConstImageBuffer src) {
   Stretch(0, 0, GetWidth(), GetHeight(),
           src, 0, 0, src.width, src.height);
 }
开发者ID:XCSoar,项目名称:XCSoar,代码行数:4,代码来源:Canvas.hpp

示例2: m_Width

GeometryTerrain::GeometryTerrain(int size, int patch_size, int num_hills, float smoothness, int smooth_passes )
: m_Width(size), 
  m_Length(size),
  m_patchSize(patch_size)
{
	if(patch_size < 2) patch_size = 2;
	if(patch_size > size) patch_size = size;

	m_pHeight	= new float*[m_Width+1];

	m_fOffsetX = 1.0f;
	m_fOffsetY = 1.0f;
	m_fOffsetZ = 1.0f;

	for(int i = 0; i <= m_Length; i++)
	{		
		m_pHeight[i] = new float[m_Width+1];
		memset(m_pHeight[i], 0, sizeof(float)*(m_Length+1));
	}

	m_pVertices = NULL;

	m_nVertexCount = ((unsigned int)GetWidth()+1)*((unsigned int)GetLength()+1);

	//memset(m_pVertices, 0, m_nVertexCount);
	//memset(m_pNormals, 0, m_nVertexCount);


	m_pVertices		= new flx_Vertex[m_nVertexCount];
	m_pTexCoords	= new flx_TexCoord[m_nVertexCount];
	m_pNormals		= new flx_Normal[m_nVertexCount];

	//Add some random Hills and smooth it
	generateTerrain(num_hills);
	for(int i = 0; i < smooth_passes; ++i)
		smoothTerrain(smoothness);

	int deg_x = 0, deg_z = 0;
	for(int z = 0; z <= GetLength(); z++)
	{
		for(int x = 0; x <= GetWidth(); x++)
		{
			//fill Vertex array with data
			m_pVertices[x + z * (GetWidth()+1)].x = (float)x * m_fOffsetX;
			m_pVertices[x + z * (GetWidth()+1)].y = getHeight(x, z);
			m_pVertices[x + z * (GetWidth()+1)].z = (float)z * m_fOffsetZ;

			//fill TexCoord array with data
			m_pTexCoords[x + z * (GetWidth()+1)].u = (float)((float)x/(GetWidth()+1));
			m_pTexCoords[x + z * (GetWidth()+1)].v = (float)((float)z/(GetWidth()+1));
		}
	}

	//Create Indices
	for(int z = 0; z < GetLength()-1; z++)
	{
		//Even rows move left to right
		if(z % 2 == 0)
		{
			int x;
			for(x = 0; x < GetWidth(); x++)
			{
				m_Indices.push_back( x + (z * GetWidth()) );
				m_Indices.push_back( x + (z * GetWidth()) + GetWidth() );
			}

			if(z != GetLength() - 2 ) 
				m_Indices.push_back( --x + (z * GetWidth()) );
		}
		else
		{
			//odd rows move right to left
			int x;
			for(x = GetWidth() -1; x >= 0; x--)
			{
				m_Indices.push_back( x + (z * GetWidth()) );
				m_Indices.push_back( x + (z * GetWidth()) + GetWidth() );
			}

			if(z != GetLength() - 2 ) 
				m_Indices.push_back( ++x + (z * GetWidth()) );
		}
	}

	
	//Fill the buffers with data
	//VertexBuffer.setElementList(m_pVertices, m_nVertexCount);
	//TexCoordBuffer.setElementList(m_pTexCoords, m_nVertexCount);

	//...and calculate the Normals
	computeNormals();

	//Buffers ready to bind!
	//NormalBuffer.build(GL_ARRAY_BUFFER, GL_NORMAL_ARRAY);
	//VertexBuffer.build(GL_ARRAY_BUFFER, GL_VERTEX_ARRAY);
	//TexCoordBuffer.build(GL_ARRAY_BUFFER, GL_TEXTURE_COORD_ARRAY);
	
	buildPatches(0);

	//delete [] m_pVertices; m_pVertices = NULL;
//.........这里部分代码省略.........
开发者ID:grimtraveller,项目名称:fluxengine,代码行数:101,代码来源:flx_geometry_terrain.cpp

示例3: getBytesRequired

 long
 ImageLoader::GetBytesPerLine () {
     return getBytesRequired(GetWidth(), _myEncoding);
 }
开发者ID:artcom,项目名称:y60,代码行数:4,代码来源:ImageLoader.cpp

示例4: shadowMapTexture

void GeometryTerrain::computeLightmap(Vector3 _vlightSource, bool update)
{
	bool bIntegrateNormals = false;
	std::vector<GLubyte> shadowMapTexture(GetWidth()*GetWidth()*4);
 
	float maxHeight = -99999.0f;

	for(int z =0; z <= GetLength(); ++z)
		for(int x = 0; x <= GetWidth(); ++x)
			maxHeight = max(getHeight(x,z), maxHeight);

	for(int z =0; z <= GetLength(); ++z)
	{
		for(int x = 0; x <= GetWidth(); ++x)
		{
			float ambientLight = 255;
			Ray lightRay(Vector3(x, getHeight(x, z), z), _vlightSource );
			Vector3 current_ray_pos(Vector3(x, getHeight(x, z), z));
			Vector3 direction_to_sun = lightRay.m_v3Direction.normalize();

			int numRayHits = 0;
			while(!(current_ray_pos.x <= 0 || current_ray_pos.x >= GetWidth() || current_ray_pos.z <= 0 || current_ray_pos.z >= GetWidth() ))
			{
				if(current_ray_pos.y > maxHeight) break;

				// Is the terrain blocking the ray at this point?
				if(getHeight((int)floor(current_ray_pos.x), (int)floor(current_ray_pos.z)) > current_ray_pos.y)
				{
					numRayHits++;
					break;
				}
				//light still traveling...
				current_ray_pos += direction_to_sun;	
			}

			float ambientLightNormals = 0;
			if(bIntegrateNormals)
			{
				Vector3 n(
					m_pNormals[x+z * (GetWidth()+1)].x, 
					m_pNormals[x+z * (GetWidth()+1)].y, 
					m_pNormals[x+z * (GetWidth()+1)].z
					);

				ambientLightNormals = 0.5*( 1.0f + dot(n.normalize(), direction_to_sun) );
				if(ambientLightNormals > 1.0f) ambientLightNormals = 1.0f;
				if(ambientLightNormals < 0.0f) ambientLightNormals = 0.0f;
			}

			if(numRayHits > 0)
			{
					//ambientLight = (current_ray_pos - Vector3(x,getHeight(x,z),z)).magnitude() - ambientLightNormals * 255;
					ambientLight = 170;
					if(ambientLight > 255) ambientLight = 255;
					if(ambientLight < 170) ambientLight = 170;
			}

			int index = (x + z * GetWidth()) * 3;
				for (int i = 0; i < 3; ++i) {

					shadowMapTexture[index + i] = (GLubyte)ambientLight;
				}
		}
	}
	
	for(int z =0; z <= GetLength(); ++z)
	{
		for(int x = 0; x <= GetWidth(); ++x)
		{
			int factor = 2;
			ColorOGL colCurrent;
			colCurrent.m_fRed = shadowMapTexture[(x + z * GetWidth()) * 3 + 0];
			colCurrent.m_fGreen = shadowMapTexture[(x + z * GetWidth()) * 3 + 1];
			colCurrent.m_fBlue = shadowMapTexture[(x + z * GetWidth()) * 3 + 2];

			ColorOGL colT;
			ColorOGL colD;
			ColorOGL colL;
			ColorOGL colR;

			if(shadowMapTexture.size() > ((x + (z+factor) * GetWidth()) * 3 + 0) &&
				shadowMapTexture.size() > ((x + (z+factor) * GetWidth()) * 3 + 1) &&
				shadowMapTexture.size() > ((x + (z+factor) * GetWidth()) * 3 + 2)
				)
			{
				colT.m_fRed = shadowMapTexture[(x + (z+factor) * GetWidth()) * 3 + 0];
				colT.m_fGreen = shadowMapTexture[(x + (z+factor) * GetWidth()) * 3 + 1];
				colT.m_fBlue = shadowMapTexture[(x + (z+factor) * GetWidth()) * 3 + 2];
			}

			if(shadowMapTexture.size() > ((x + (z-factor) * GetWidth()) * 3 + 0) &&
				shadowMapTexture.size() > ((x + (z-factor) * GetWidth()) * 3 + 1) &&
				shadowMapTexture.size() > ((x + (z-factor) * GetWidth()) * 3 + 2)
				)
			{
				colD.m_fRed = shadowMapTexture[(x + (z-factor) * GetWidth()) * 3 + 0];
				colD.m_fGreen = shadowMapTexture[(x + (z-factor) * GetWidth()) * 3 + 1];
				colD.m_fBlue = shadowMapTexture[(x + (z-factor) * GetWidth()) * 3 + 2];
			}

//.........这里部分代码省略.........
开发者ID:grimtraveller,项目名称:fluxengine,代码行数:101,代码来源:flx_geometry_terrain.cpp

示例5: Vector3

Vector3 GeometryTerrain::getNormal(int x, int z) 
{
	return Vector3(m_pNormals[x+z * (GetWidth()+1)].x,m_pNormals[x+z * (GetWidth()+1)].y,m_pNormals[x+z * (GetWidth()+1)].z);
}
开发者ID:grimtraveller,项目名称:fluxengine,代码行数:4,代码来源:flx_geometry_terrain.cpp

示例6: SetPos

void CUIQuestRestore::ResetPosition( PIX pixMinI, PIX pixMinJ, PIX pixMaxI, PIX pixMaxJ )
{
	SetPos( ( pixMaxI + pixMinI - GetWidth() ) / 2 , ( pixMaxJ + pixMinJ - GetHeight() ) / 2  );
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:4,代码来源:UIQuestRestore.cpp

示例7: CCreate_Rock_Fall_Message

void CEarthBoss::Update(float fElapsedTime)
{
	CEnemy::Update(fElapsedTime);

	if (m_pEState->GetState() == EntityState::DEAD)
	{
		return;
	}

	m_fUpdateOldPos += fElapsedTime;
	if(m_nCoolDown > 0)
		m_nCoolDown -= fElapsedTime;

	if( m_fPunchCoolDown > 0.0f  && m_bPunching == true)
		m_fPunchCoolDown -= fElapsedTime;
	else
	{
		m_fPunchCoolDown = 2.5f;
		m_bPunching = false;
	}

	if (m_fSpecialTimer > 0.0f)
		m_fSpecialTimer -= fElapsedTime;
	else
	{
		CCreate_Rock_Fall_Message* pMsg = new CCreate_Rock_Fall_Message();
		CSGD_MessageSystem::GetInstance()->SendMsg(pMsg);
		pMsg = nullptr;

		m_fSpecialTimer = 15.0f;
	}

	//if not rushing do basic path finding to the player
	if(GetTarget() != nullptr)
	{
		float tar_pos_x = GetTarget()->GetPosX();
		float tar_pos_y = GetTarget()->GetPosY();
		if(tar_pos_x > GetPosX())
		{
			//set Grunt's animation's facing to the right
			SetFlipped(true);
		}
		else
		{
			SetFlipped(false);
		}


		if(m_fMoveAway <= 0)
		{

			//	tar_pos_x += (m_bFlipped) ? -236 : 236;

			//Simple Pathing twards the player
			if(tar_pos_y != GetPosY())//Above the Player
			{
				float min_Distance = (float)(GetTarget()->GetWidth()/2 + GetWidth()/2);
				if(GetPosX() + min_Distance > tar_pos_x && GetPosX() - min_Distance < tar_pos_x)
				{
					if( tar_pos_x < GetPosX())

						SetVelX(speed * fElapsedTime);
					else

						SetVelX(-speed * fElapsedTime);
				}
				else
				{
					if( tar_pos_y < GetPosY())

						SetVelY(-speed * fElapsedTime);
					else

						SetVelY(speed * fElapsedTime);
					if( tar_pos_x < GetPosX())

						SetVelX(-speed * fElapsedTime);
					else

						SetVelX(speed * fElapsedTime);

					if( tar_pos_x > (GetPosX() - 64) && tar_pos_x < (GetPosX() + 64) )
					{


						if( tar_pos_y > (GetPosY() - 32) && tar_pos_y < (GetPosY() + 32) && m_bPunching == false)
						{

							GetAnimInfo()->SetAnimationName("Boss1_Attack_Animation");
							m_bPunching = true;
							//dynamic_cast<CPlayer*>(GetTarget())->SetState(CEntityState::KNOCKED_DOWN);
						}
					}
				}
			}
			else
			{
				SetVelY(0);
				if( tar_pos_x < GetPosX())

//.........这里部分代码省略.........
开发者ID:kendellm,项目名称:Trials-of-Mastery,代码行数:101,代码来源:EarthBoss.cpp

示例8: Hide

void CTargetMenu::Update( POINT ptMouse )
{
	if( !IsVision()) return;

	CTDialog::Update( ptMouse );
	if( m_iTargetAvatarID )
	{
		CObjCHAR *pObj = (CObjCHAR*)g_pObjMGR->Get_CharOBJ( m_iTargetAvatarID, true );
		/// 유효하지 않은 타겟이다.. 마우스 컴맨드 초기화
		if( pObj == NULL )
		{
			Hide();
		}
		else
		{
			if( g_pAVATAR->Get_DISTANCE( pObj ) >= 1200 )
				Hide();
			else
			{
				D3DVECTOR   PosSCR;
				POINT		ptNew;
				pObj->GetScreenPOS (PosSCR);	
				ptNew.x = (int)PosSCR.x - GetWidth() / 2;
				ptNew.y = (int)PosSCR.y - ( GetHeight() * 2 / 3 );
				MoveWindow( ptNew );

			}
		}
	}
	

	WINCTRL_LIST_ITOR iter;
	CWinCtrl*	pCtrl;
	
	for( iter = m_listChild.begin(); iter != m_listChild.end(); ++iter)
	{
		pCtrl = *iter;
		if( pCtrl->GetControlType() == CTRL_IMAGE )
			continue;

		if( pCtrl->IsInside(ptMouse.x, ptMouse.y ) )
		{
//			g_itMGR.DrawToolTip( (short)ptMouse.x, (short)ptMouse.y, GetDialogType(), pCtrl->GetControlID());
			break;
		}
	}


/*
	int iTargetID = g_pAVATAR->m_iServerTarget;
	if( iTargetID )
	{
		CObjCHAR *pObj = (CObjCHAR*)g_pObjMGR->Get_CharOBJ( g_CommandState.GetCurrentTarget(), true );
		/// 유효하지 않은 타겟이다.. 마우스 컴맨드 초기화
		if( pObj == NULL )
		{
			g_CommandState.ClearMouseState();
			Hide();
			return;
		}
		
		///Target이 아바타일경우에만 현재 스크린 좌표에 따라서 윈도우의 위치 조정
		if( pObj->Get_TYPE() == OBJ_AVATAR ) 
		{
			D3DVECTOR   PosSCR;
			POINT		ptNew;
			pObj->GetScreenPOS (PosSCR);	
			ptNew.x = (int)PosSCR.x - GetWidth() / 2;
			ptNew.y = (int)PosSCR.y - ( GetHeight() * 2 / 3 );
			MoveWindow( ptNew );
			m_iTargetAvatarID = iTargetID;
//			Show();
		}
		else
		{
			Hide();
		}
	}
	else
		Hide();
*/
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:82,代码来源:CTargetMenu.cpp

示例9: assert

  void PlayScene::Start()
  {
    const auto fitsH = static_cast<int32_t>(std::ceil(static_cast<float>(GGame.GetWidth()) / kSpriteWidth)) + 1;
    const auto fitsV = static_cast<int32_t>(std::ceil(static_cast<float>(GGame.GetHeight()) / kSpriteOddYOffset)) + 1;
    _columns = fitsH;
    _rows = fitsV;

    SpriteParams params;
    params.persistant = false;
    params.texture = nullptr;
    params.z = 5;

    for (int32_t i = 0; i < kMap.size(); i++)
    {
      params.textureName = kMap[i];

      auto sprite = GGame.Create<Sprite>(params);

      assert(kSpriteWidth == sprite->GetWidth());
      assert(kSpriteHeight == sprite->GetHeight());

      auto pos = VectorIndexToXY(i);
      sprite->SetCenterPosition(pos.first, pos.second);

      _backgroundSprites.push_back(sprite);
    }



    params.z = 6;
    params.textureName = "landingPlatform";
    _landingPlatform = GGame.Create<Sprite>(params);
    auto pos = VectorIndexToXY(RowColumnToVectorIndex(3, 5));
    _landingPlatform->SetCenterPosition(pos.first, pos.second);
    _landingPlatform->SetAlpha(0.0f);

    params.z = 7;
    params.textureName = "spaceCraft";
    _spacecraft = GGame.Create<Sprite>(params);
    pos = VectorIndexToXY(RowColumnToVectorIndex(3, 5));
    pos.first += kLandingOffset.first;
    pos.second += kLandingOffset.second - 150;
    _spacecraft->SetCenterPosition(pos.first, pos.second);

    ResourceBarParams resourceBarParams;
    resourceBarParams.persistant = false;
    resourceBarParams.initialWood = 150;
    resourceBarParams.initialCrystal = 20;
    resourceBarParams.z = 100;
    _resourceBar = GGame.Create<ResourceBar>(resourceBarParams);

    BuildingPanelParams buildingPanelParams;
    buildingPanelParams.persistant = false;
    buildingPanelParams.z = 100;

    _buildingPanel = GGame.Create<BuildingPanel>(buildingPanelParams);
    _buildingPanel->SetPosition(GGame.GetWidth() - _buildingPanel->GetWidth(),
      GGame.GetHeight());

    _landingTimer = 0.0f;
    _landingFinished = false;
    _landingDestination = VectorIndexToXY(RowColumnToVectorIndex(3, 5));
    _landingDestination.first += kLandingOffset.first;
    _landingDestination.second += kLandingOffset.second;

    _uiSlideTimer = 0.0f;
    _uiSlideFinished = false;
  }
开发者ID:VHonzik,项目名称:Jadernak-ludum-dares,代码行数:68,代码来源:PlayScene.cpp

示例10: return

// Returns true if given co-ordinate is in this area
BOOL CSectionHandler::HasPoint(int iX,int iY)
{
	return (iX>=m_iX && iY>=m_iY &&
		iX<m_iX+GetWidth()+GetWidthOffset() && iY<m_iY+GetHeight()+GetHeightOffset());
}
开发者ID:quen,项目名称:leafdrums2,代码行数:6,代码来源:SectionHandler.cpp

示例11: ResizeRelation

/* Automatic type deduction, and placement
----------------------------------------------------------------------------------------------------*/
void TableSystemWidget::Insert( Widget *pwidget )
{
    /* Try for IWTable interface
    ----------------------------------------------------------------------------------------------------*/
    if ( IWTable *pi_tb = dynamic_cast<IWTable*>(pwidget) )
    {
        TableWidget *ptw = &pi_tb->Table();

        if ( _p_main_table ) { APP_ERROR( Error("Insert: Table allready exists"), "TableSystemWidget"); }

        _p_table_scroller->AttachWidget( (_p_main_table=pi_tb)->AtomPtr() );

        _pri_tbl_width = pi_tb->Atom().GetWidth();
        _pri_tbl_height= pi_tb->Atom().GetHeight();
        pi_tb->Atom().OnResize.TieVoid( this, &TableSystemWidget::UpdateTableSizes );

        if ( _p_caption_sizer ) 
        { 
            _p_caption_sizer->Atom().Posses( new
                ResizeRelation( _p_caption_sizer->Atom(), _p_main_table->Atom(), true, false )
                );
        }
    }

    /* Try for IWSizer interface
    ----------------------------------------------------------------------------------------------------*/
    else if ( IWSizer *pi_siz = dynamic_cast<IWSizer *>(pwidget) )
    {
        SizerWidget *psw = &pi_siz->Sizer();
        if ( _p_caption_sizer ) { APP_ERROR( Error("Insert: Caption sizer allready exists"), "TableSystemWidget"); }

        _p_caption_scroller->AttachWidget( (_p_caption_sizer=pi_siz)->AtomPtr() );
        _cs_height = _p_caption_sizer->Atom().GetHeight();

        if ( _p_main_table ) 
        { 
            _p_caption_sizer->Atom().Posses( new
                ResizeRelation( _p_caption_sizer->Atom(), _p_main_table->Atom(), true, false )
                );
        }
    }

    /* Try for IWScrollbar interface
    ----------------------------------------------------------------------------------------------------*/
    else if ( IWScrollbar *pi_sb = dynamic_cast<IWScrollbar*>(pwidget) )
    {
        ScrollbarWidget *psbw = &pi_sb->Scroller();
        if ( psbw->IsHorizontal() )
        {
            if (_p_horiz_scrollbar ) { APP_ERROR( Error("Insert: H Scrollbar allready exists"), "TableSystemWidget"); }
            HubWidget::Insert( (_p_horiz_scrollbar = pi_sb)->AtomPtr() );
            _sb_height = _p_horiz_scrollbar->Atom().GetHeight();
            assert(_p_main_table);
            _p_table_scroller->Posses( 
                    new AdvScrollRelation( *_p_table_scroller, *_p_horiz_scrollbar, false ) 
                );
            _p_horiz_scrollbar->Atom().OnVisible.TieVoid( this, &TableSystemWidget::UpdateScrollbarSizes );
        }
        else 
        {
            if ( _p_verti_scrollbar ) { APP_ERROR( Error("Insert: V Scrollbar allready exists"), "TableSystemWidget"); }
            HubWidget::Insert( (_p_verti_scrollbar = pi_sb)->AtomPtr() ); 
            _sb_width = _p_verti_scrollbar->Atom().GetWidth();
            assert(_p_main_table);

            // if top gadget was inserted then relation type is disable-scrollbar relation
            if ( _p_top_gadget )
            {
                _vertical_scroll_rel = new AdvScrollRelation2( *_p_table_scroller, *_p_verti_scrollbar, true );
                _p_verti_scrollbar->Atom().Show();
            }
            // else it is hide scrollbar-relation
            else
            {
                _vertical_scroll_rel = new AdvScrollRelation( *_p_table_scroller, *_p_verti_scrollbar, true );
            }

            _p_verti_scrollbar->Atom().OnVisible.TieVoid( this, &TableSystemWidget::UpdateScrollbarSizes );
        }
    }

    /* Check if it's supposed to be a surrounding frame
    ----------------------------------------------------------------------------------------------------*/
    else if ( FrameWidget *pfw = dynamic_cast<FrameWidget*>(pwidget) )
    {
        HubWidget::Retrieve( _p_table_scroller );
        HubWidget::Retrieve( _p_caption_scroller );
        HubWidget::Insert( _p_table_frame = pfw );
        _p_table_frame->Insert( _p_table_scroller );
        _p_table_frame->Insert( _p_caption_scroller );
    }

    /* We can place two small gadgets
    ----------------------------------------------------------------------------------------------------*/
    else if ( !_p_bottom_gadget )
    {
        // if top gadget is beig inserted then change relation type to disable-scrollbar relation
        if (!_p_top_gadget && _p_verti_scrollbar)
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:utgs-svn,代码行数:101,代码来源:TableSystemWidget.cpp

示例12: GetWidth

void TableSystemWidget::Fit()
{
    int w = GetWidth(), h=GetHeight();
    int sb_width = _sb_width;
    int sb_height = _sb_height;

    if (_p_verti_scrollbar && _p_verti_scrollbar->Atom().IsVisible() )
    {
        _ResizePositive( _p_verti_scrollbar->AtomPtr(), sb_width, h-(_cs_height+sb_height) );
        _p_verti_scrollbar->Atom().SetPosition ( Pos( w-sb_width, _cs_height) );
    }
    if (_p_horiz_scrollbar && _p_horiz_scrollbar->Atom().IsVisible() )
    {
        _ResizePositive( _p_horiz_scrollbar->AtomPtr(), w-sb_width, sb_height );
        _p_horiz_scrollbar->Atom().SetPosition ( Pos( 0, h-sb_height ) );
    }

    if (_p_table_frame)
    {
        int frame_w = w-sb_width;
        int frame_h = h-sb_height;

        _p_table_frame->Fill( Rect( 0, 0, frame_w, frame_h ));
        Rect c = _p_table_frame->GetClientRect( _p_caption_scroller );
        _p_caption_scroller->Resize( c.GetW(), _cs_height );
        _p_caption_scroller->SetPosition( c.GetPos() );
        _ResizePositive( _p_table_scroller, c.GetW(), c.GetH()-_cs_height );
        _p_table_scroller->SetPosition( c.GetPos() + Pos( 0, _cs_height) );
    }
    else
    {
        if (_p_caption_scroller)
        {
            _p_caption_scroller->Resize( w-sb_width, _cs_height );
            _p_caption_scroller->SetPosition( Pos(0,0) );
        }
        if (_p_table_scroller)
        {
            _ResizePositive( _p_table_scroller, w-sb_width, h-(_cs_height+sb_height) );
            _p_table_scroller->SetPosition  ( Pos(0,_cs_height) );
        }
    }

    if ( _p_top_gadget )
    {
        _p_top_gadget->SetPosition( Pos( w-_p_top_gadget->GetWidth(), 0) );
        HubWidget::BringOnTop( _p_top_gadget );
    }
    if ( _p_bottom_gadget )
    {
        if ( sb_width && sb_height )
        { 
            _p_bottom_gadget->SetPosition( Pos( w-sb_width, h-sb_height) );

            if ( !_p_bottom_gadget->Atom().IsVisible() ) { _p_bottom_gadget->Atom().Show(); }
        }
        else if ( _p_bottom_gadget->Atom().IsVisible() ) { _p_bottom_gadget->Atom().Hide(); }
    }

    if ( _auto_cover )
    {
        int pri_tbl_width = _pri_tbl_width;
        int pri_tbl_height= _pri_tbl_height;
        int table_w = pri_tbl_width;
        int table_h = pri_tbl_height;
        int client_w = _p_table_scroller->GetWidth();
        int client_h = _p_table_scroller->GetHeight();

        // try to cover all client area by table (if table is smaller than area)
        if ( client_w > table_w )
        {
            _p_main_table->Atom().Resize( client_w, table_h );
        }
        else if ( client_w < pri_tbl_width )
        {
            _p_main_table->Atom().Resize( pri_tbl_width, table_h );
        }
    
        table_w = _p_main_table->Atom().GetWidth();

        if ( client_h > table_h )
        {
            _p_main_table->Atom().Resize( table_w, client_h );
        }
        else if ( client_h < pri_tbl_height )
        {
            _p_main_table->Atom().Resize( table_w, pri_tbl_height );
        }

        table_h = _p_main_table->Atom().GetHeight();

        // right scrollbar dissappears only if top-gadget does not exist
        if ( !_p_top_gadget )
        {
            // Check if full table would be visible if we hide both scrollbars
            bool would_fit_width = client_w + sb_width >= table_w;
            bool would_fit_height= client_h + sb_height >= table_h;
    
            if ( would_fit_width && would_fit_height )
            {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:utgs-svn,代码行数:101,代码来源:TableSystemWidget.cpp

示例13: CopyOr

 void CopyOr(const Bitmap &src) {
   CopyOr(0, 0, GetWidth(), GetHeight(), src, 0, 0);
 }
开发者ID:XCSoar,项目名称:XCSoar,代码行数:3,代码来源:Canvas.hpp

示例14: assert

void vfeDisplay::DrawPixel(unsigned int x, unsigned int y, const RGBA8& colour)
{
  assert (x < GetWidth() && y < GetHeight());
  m_Pixels[y * GetHeight() + x] = colour;
}
开发者ID:Degot,项目名称:povray,代码行数:5,代码来源:vfedisplay.cpp

示例15: OnDeviceReset

 void DiRenderWindow::OnDeviceReset()
 {
     if (mSceneManager)
         mSceneManager->GetCamera()->SetAspectRatio(float(GetWidth())/float(GetHeight()));
 }
开发者ID:redkaras,项目名称:Demi3D,代码行数:5,代码来源:RenderWindow.cpp


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