本文整理汇总了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);
}
示例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" );
}
示例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 )) );
}
}
示例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;
};
};
示例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 );
}
}
}
示例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;
}
示例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);
}
示例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 );
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}