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


C++ SetHeight函数代码示例

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


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

示例1: SetWidth

void CGUIResizeControl::Resize(float x, float y)
{
  float width = m_width + x;
  float height = m_height + y;
  // check if we are within the bounds
  if (width < m_x1) width = m_x1;
  if (height < m_y1) height = m_y1;
  if (width > m_x2) width = m_x2;
  if (height > m_y2) height = m_y2;
  // ok, now set the default size of the resize control
  SetWidth(width);
  SetHeight(height);
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:13,代码来源:GUIResizeControl.cpp

示例2: SetHeight

CFriendListItem::CFriendListItem( DWORD dwUserTag, BYTE btStatus, const char* pszName )
{
	SetHeight( 20 );
	SetWidth( 180 );
	m_dwUserTag = dwUserTag;
	m_btStatus = btStatus;
	assert( pszName );
	if( pszName )
		m_strName = pszName;

	m_online_image_id	= CResourceMgr::GetInstance()->GetImageNID( UI_IMAGE_RES_ID, "CLAN01_MARK_ONLINE" );;
	m_offline_image_id	= CResourceMgr::GetInstance()->GetImageNID( UI_IMAGE_RES_ID, "CLAN01_MARK_OFFLINE" );

}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:14,代码来源:CFriendListItem.cpp

示例3: SetParent

//--------------------------------------------------------------------
void CForm::Create( IGUIControl* p_pParent, int p_nLeft, int p_nTop,
                    int p_nWidth, int p_nHeight )
{
    IGUIControl::Create();
    SetParent( p_pParent );
    SetLeft( p_nLeft );
    SetTop( p_nTop );
    SetWidth( p_nWidth );
    SetHeight( p_nHeight );
    if( m_pColor == NULL )
    {
        SetFontColor( *(new CColor( CColor::WHITE )) );
    }
}
开发者ID:duzhi5368,项目名称:FKEngine,代码行数:15,代码来源:Form.cpp

示例4: SetHeight

void IconTextItem::Update(BView *owner, const BFont *font) {
	(void)owner;

	font_height fontHeight;
	font->GetHeight(&fontHeight);
	fFontHeight = fontHeight.descent + fontHeight.leading + fontHeight.ascent;
	
	if (fIcon) {
		fIconHeight = fIcon->Bounds().Height() + 1;
		fIconWidth = fIcon->Bounds().Width();

		if (fIconHeight > fFontHeight) {
			SetHeight(fIconHeight + (kEdgeOffset * 2));
			fFontOffset = ((fIconHeight - fFontHeight) / 2) + (kEdgeOffset * 2);
		} else {
			SetHeight(fFontHeight + (kEdgeOffset * 2));
			fFontOffset = kEdgeOffset;
		};
	} else {
		SetHeight(fFontHeight + (kEdgeOffset * 2));
		fFontOffset = kEdgeOffset;
	};	
};
开发者ID:HaikuArchives,项目名称:FeedKit,代码行数:23,代码来源:IconTextItem.cpp

示例5: GetAbsAngles

//-----------------------------------------------------------------------------
// Purpose: Retract and stop attacking
//-----------------------------------------------------------------------------
void CNPC_CeilingTurret::Retire( void )
{
	if ( PreThink( TURRET_RETIRING ) )
		return;

	//Level out the turret
	m_vecGoalAngles = GetAbsAngles();
	SetNextThink( gpGlobals->curtime );

	//Set ourselves to close
	if ( GetActivity() != ACT_CEILING_TURRET_CLOSE )
	{
		//Set our visible state to dormant
		SetEyeState( TURRET_EYE_DORMANT );

		SetActivity( (Activity) ACT_CEILING_TURRET_OPEN_IDLE );
		
		//If we're done moving to our desired facing, close up
		if ( UpdateFacing() == false )
		{
			SetActivity( (Activity) ACT_CEILING_TURRET_CLOSE );
			EmitSound( "NPC_CeilingTurret.Retire" );

			//Notify of the retraction
			m_OnRetire.FireOutput( NULL, this );
		}
	}
	else if ( IsActivityFinished() )
	{	
		SetHeight( CEILING_TURRET_RETRACT_HEIGHT );

		m_bActive		= false;
		m_flLastSight	= 0;

		SetActivity( (Activity) ACT_CEILING_TURRET_CLOSED_IDLE );

		//Go back to auto searching
		if ( m_bAutoStart )
		{
			SetThink( &CNPC_CeilingTurret::AutoSearchThink );
			SetNextThink( gpGlobals->curtime + 0.05f );
		}
		else
		{
			//Set our visible state to dormant
			SetEyeState( TURRET_EYE_DISABLED );
			SetThink( &CNPC_CeilingTurret::SUB_DoNothing );
		}
	}
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:53,代码来源:npc_turret_ceiling.cpp

示例6: switch

UIHandle::Result TrackPanelResizeHandle::Cancel(AudacityProject *pProject)
{
   auto pTrack = pProject->GetTracks()->Lock(mpTrack);
   if ( !pTrack )
      return RefreshCode::Cancelled;

   TrackList *const tracks = pProject->GetTracks();

   switch (mMode) {
   case IsResizing:
   {
      pTrack->SetHeight(mInitialActualHeight);
      pTrack->SetMinimized(mInitialMinimized);
   }
   break;
   case IsResizingBetweenLinkedTracks:
   {
      Track *const next = tracks->GetNext(pTrack.get());
      pTrack->SetHeight(mInitialUpperActualHeight);
      pTrack->SetMinimized(mInitialMinimized);
      next->SetHeight(mInitialActualHeight);
      next->SetMinimized(mInitialMinimized);
   }
   break;
   case IsResizingBelowLinkedTracks:
   {
      Track *const prev = tracks->GetPrev(pTrack.get());
      pTrack->SetHeight(mInitialActualHeight);
      pTrack->SetMinimized(mInitialMinimized);
      prev->SetHeight(mInitialUpperActualHeight);
      prev->SetMinimized(mInitialMinimized);
   }
   break;
   }

   return RefreshCode::RefreshAll;
}
开发者ID:MindFy,项目名称:audacity,代码行数:37,代码来源:TrackPanelResizeHandle.cpp

示例7: FitProportional

void FitProportional(LPRECT rect)
        {
        ERect Result;
        ERect r(rect->left,rect->top,rect->right,rect->bottom);
        r.Normalize();
        float w=Width();
        float h=Height();
        float cw=r.Width();
        float ch=r.Height();
        /*float resolution=(float)th/(float)tw;
        tw=(float)trh*resolution;
        if(tw<Width())
                {
                tw=Width();
                resolution=((float)tw/(float)th);
                th=(float)trw/resolution;
                SetWidth(trw);
                SetHeight(th);
                }else
                {
                tw=Width();
                resolution=((float)tw/(float)th);
                tw=(float)trh/resolution;
                SetWidth(tw);
                SetHeight(trh);
                }  */
        float xyaspect=w/h;
        if(w>h)
                {
                w=cw;
                h=cw/xyaspect;
                if(h>ch)
                        {
                        h=ch;
                        w=ch*xyaspect;
                        }
                }else
                {
                h=ch;
                w=ch*xyaspect;
                if(w>cw)
                        {
                        w=cw;
                        h=cw/xyaspect;
                        }
                }
        SetWidth(w);
        SetHeight(h);
        }
开发者ID:MOROZIL-nic,项目名称:craft,代码行数:49,代码来源:myclasses.cpp

示例8: SetWidth

CZLBAppendText::CZLBAppendText( const char* pszText, int iWidth, DWORD dwColor)
{
	SetWidth( iWidth );

	if( pszText )
	{
		m_jString.SetSplitType( CJStringParser::SPLIT_WORD );
		m_jString.SetDefaultColor( dwColor );

		m_jString.SetString( pszText, iWidth - 10 );

		if( m_jString.GetStringCount() )
			SetHeight( m_jString.GetString(0)->GetStringHeight() * m_jString.GetStringCount() + 3 );
	}
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:15,代码来源:CZLBAppendText.cpp

示例9: SetPosition

Player::Player()
{
	SetPosition(a_playerPos);
	SetSpeed(a_playerSpd);
	SetWidth(c_iPlayerWidth);
	SetHeight( c_iPlayerHeight );
	SetSpriteID(iPlayerSpriteID);
	Create("./images/GrayBox.png");
	m_iMaxAmmo = 5;
	m_iAmmo = m_iMaxAmmo;
	m_bShot = false;
	m_iTimer = 0;
	m_iHp = 3;
	Bullets = CreateBullets(m_iMaxAmmo);		
}
开发者ID:blueskies9041,项目名称:Sam,代码行数:15,代码来源:Player.cpp

示例10: super

cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) :
	super(etMinecart, a_X, a_Y, a_Z, 0.98, 0.7),
	m_Payload(a_Payload),
	m_LastDamage(0),
	m_DetectorRailPosition(0, 0, 0),
	m_bIsOnDetectorRail(false)
{
	SetMass(20.0f);
	SetGravity(-16.0f);
	SetAirDrag(0.05f);
	SetMaxHealth(6);
	SetHealth(6);
	SetWidth(1);
	SetHeight(0.9);
}
开发者ID:gjzskyland,项目名称:cuberite,代码行数:15,代码来源:Minecart.cpp

示例11: Init

GUIVidget::GUIVidget()
{
	Init();
	SetX(0);
	SetY(0);
	SetWidth(0);
	SetHeight(0);
	SetColor(DEFAULT_CONTROL_COLOR);
	SetVisible(false);
	SetDead(false);
	SetTexture(NULL);
	SetParent((GUIBaseControl*)NULL);
	SetBorder(false);
	SetBorderType(btNone);
}
开发者ID:lightsgoout,项目名称:interview,代码行数:15,代码来源:gui_vidget.cpp

示例12: GetPosition

/*--------------------------------------------------------------------------------*/
AudioObjectParameters& AudioObjectParameters::operator *= (const PositionTransform& transform)
{
  Position centre = GetPosition(), corner = centre;

  SetPosition(centre * transform);
 
  if (centre.polar)
  {
    corner.pos.az += GetWidth();
    corner.pos.el += GetHeight();
    corner.pos.d  += GetDepth();
  }
  else
  {
    corner.pos.x  += GetWidth();
    corner.pos.y  += GetDepth();
    corner.pos.z  += GetHeight();
  }

  corner = (corner * transform) - centre;

  if (centre.polar)
  {
    SetWidth(static_cast<float>(corner.pos.az));
    SetHeight(static_cast<float>(corner.pos.el));
    SetDepth(static_cast<float>(corner.pos.d));
  }
  else
  {
    SetWidth(static_cast<float>(corner.pos.x));
    SetDepth(static_cast<float>(corner.pos.y));
    SetHeight(static_cast<float>(corner.pos.z));
  }
  
  return *this;
}
开发者ID:Dysonics,项目名称:bbcat-adm,代码行数:37,代码来源:AudioObjectParameters.cpp

示例13: SetWindowskin

Window_Base::Window_Base(int x, int y, int width, int height) {
	windowskin_name = Game_System::GetSystemName();
	if (!windowskin_name.empty()) {
		SetWindowskin(Cache::System(windowskin_name));
	} else {
		SetWindowskin(Bitmap::Create(160, 80, false));
	}

	SetX(x);
	SetY(y);
	SetWidth(width);
	SetHeight(height);
	SetStretch(Game_System::GetMessageStretch() == RPG::System::Stretch_stretch);
	SetZ(3000);
}
开发者ID:ChristianBreitwieser,项目名称:easyrpg-libretro,代码行数:15,代码来源:window_base.cpp

示例14: ListBox

Request::FieldsDialog::ListFieldMultiple::ListFieldMultiple(
    PurpleRequestField *field)
    : ListBox(AUTOSIZE, 1), field(field)
{
    g_assert(field);

    // TODO display label of the field somewhere

    int height = 0;
    for (GList *list = purple_request_field_list_get_items(field); list;
            list = list->next, height++)
        AppendWidget(*(new ListFieldItem(field,
                                         reinterpret_cast<const char*>(list->data))));
    SetHeight(height);
}
开发者ID:transacid,项目名称:CenterIM5,代码行数:15,代码来源:Request.cpp

示例15: ceilf

void
BackupListItem::Update(BView* owner, const BFont* font)
{
	BListItem::Update(owner, font);
	font_height height;
	font->GetHeight(&height);

	float lineHeight = ceilf(height.ascent) + ceilf(height.descent)
		+ ceilf(height.leading);

	fFirstlineOffset = 2 + ceilf(height.ascent + height.leading / 2);
	fSecondlineOffset = fFirstlineOffset + lineHeight;

	SetHeight(2 * lineHeight + 4);
}
开发者ID:kallisti5,项目名称:backup,代码行数:15,代码来源:BackupView.cpp


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