本文整理汇总了C++中GetArea函数的典型用法代码示例。如果您正苦于以下问题:C++ GetArea函数的具体用法?C++ GetArea怎么用?C++ GetArea使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetArea函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetArea
QString MythUIText::cutDown(const QString &data, MythFontProperties *font,
bool multiline)
{
int length = data.length();
if (length == 0)
return data;
int maxwidth = GetArea().width();
int maxheight = GetArea().height();
int justification = Qt::AlignLeft | Qt::TextWordWrap;
QFontMetrics fm(font->face());
int margin = length - 1;
int index = 0;
int diff = 0;
while (margin > 0)
{
if (multiline)
diff = maxheight - fm.boundingRect(0, 0, maxwidth, maxheight,
justification,
data.left(index + margin + 1)
).height();
else
diff = maxwidth - fm.width(data, index + margin + 1);
if (diff >= 0)
index += margin;
margin /= 2;
if (index + margin >= length - 1)
margin = (length - 1) - index;
}
if (index < length - 1)
{
QString tmpStr(data);
tmpStr.truncate(index);
if (index >= 3)
tmpStr.replace(index - 3, 3, "...");
return tmpStr;
}
return data;
}
开发者ID:footoflove,项目名称:libmythtv-ui,代码行数:46,代码来源:mythuitext.cpp
示例2: GetArea
/** \brief Return the first MythUIType at the given coordinates
*
* \param p QPoint coordinates
* \param recursive Whether to perform a recursive search
* \param focusable Only consider widgets that are focusable.
*
* \return The widget at these coordinates
*/
MythUIType *MythUIType::GetChildAt(const QPoint &p, bool recursive,
bool focusable) const
{
if (GetArea().contains(p))
{
if (!IsVisible() || !IsEnabled())
return nullptr;
if (m_ChildrenList.isEmpty())
return nullptr;
/* check all children */
QList<MythUIType *>::const_iterator it;
for (it = m_ChildrenList.end() - 1; it != m_ChildrenList.begin() - 1; --it)
{
if (!(*it))
continue;
// If this point doesn't fall within the child's area then move on
// This requires that the area is actually accurate and in some
// cases this still isn't true
if (!(*it)->GetArea().contains(p - GetArea().topLeft()))
continue;
MythUIType *child = *it;
if (recursive && (focusable && !child->CanTakeFocus()))
child = child->GetChildAt(p - GetArea().topLeft(), recursive,
focusable);
if (child)
{
// NOTE: Assumes no selectible ui type will contain another
// selectible ui type.
if (focusable && !child->CanTakeFocus())
continue;
return child;
}
}
}
return nullptr;
}
开发者ID:garybuhrmaster,项目名称:mythtv,代码行数:54,代码来源:mythuitype.cpp
示例3: GetArea
void InfoItem::Draw(HDC hDC,ePipeline* Pipe /*=Pipe*/){
RECT rc = GetArea();
COLORREF Oldcr = ::SetTextColor(hDC,RGB(0,255,0));
::DrawText(hDC,m_Text.c_str(),m_Text.size(),&rc,DT_LEFT|DT_EXPANDTABS|
DT_NOPREFIX|DT_VCENTER);
::SetTextColor(hDC,Oldcr);
}
开发者ID:GMIS,项目名称:GMIS,代码行数:8,代码来源:WorldLog.cpp
示例4: GetPerimeter
std::string CTriangle::ToString() const
{
std::stringstream stream;
stream << "Triangle <<" << m_firstVertex.GetX() << "," << m_firstVertex.GetY() << ">";
stream << "<" << m_secondVertex.GetX() << "," << m_secondVertex.GetY() << ">";
stream << "<" << m_thirdVertex.GetX() << "," << m_thirdVertex.GetY() << ">>";
stream << ", Perimeter=" << GetPerimeter() << ", Area=" << GetArea();
return stream.str();
}
开发者ID:irina-yambatrova,项目名称:OOP,代码行数:9,代码来源:Triangle.cpp
示例5: GetDescription
string CIncomingFriendList :: GetDescription( )
{
string Description;
Description += GetAccount( ) + "\n";
Description += ExtractStatus( GetStatus( ) ) + "\n";
Description += ExtractArea( GetArea( ) ) + "\n";
Description += ExtractLocation( GetLocation( ) ) + "\n\n";
return Description;
}
开发者ID:RiseCakoPlusplus,项目名称:brtGHost,代码行数:9,代码来源:bnetprotocol.cpp
示例6: GetArea
/** \brief Return the first MythUIType which accepts focus found at the given
* coordinates
*
* \param p QPoint coordinates
* \param recursive Whether to perform a recursive search
*
* \return The widget at these coordinates
*/
MythUIType *MythUIType::GetChildAt(const QPoint &p, bool recursive,
bool focusable) const
{
if (GetArea().contains(p))
{
if (!IsVisible() || !IsEnabled())
return NULL;
if (m_ChildrenList.isEmpty())
return NULL;
/* check all children */
QList<MythUIType *>::const_iterator it;
for (it = m_ChildrenList.end() - 1; it != m_ChildrenList.begin() - 1; --it)
{
if (!(*it))
continue;
MythUIType *child = NULL;
if ((*it)->GetArea().contains(p - GetArea().topLeft()))
child = *it;
if (!child && recursive)
child = (*it)->GetChildAt(p - GetArea().topLeft(), recursive,
focusable);
if (child)
{
// NOTE: Assumes no selectible ui type will contain another
// selectible ui type.
if (focusable && !child->CanTakeFocus())
continue;
return child;
}
}
}
return NULL;
}
开发者ID:gdenning,项目名称:mythtv,代码行数:51,代码来源:mythuitype.cpp
示例7: GetArea
void MythUISimpleText::DrawSelf(MythPainter *p, int xoffset, int yoffset,
int alphaMod, QRect clipRect)
{
QRect area = GetArea().toQRect();
area.translate(xoffset, yoffset);
int alpha = CalcAlpha(alphaMod);
p->SetClipRect(clipRect);
p->DrawText(area, m_Message, m_Justification, m_Font, alpha, area);
}
开发者ID:tomhughes,项目名称:mythtv,代码行数:11,代码来源:mythuisimpletext.cpp
示例8: GetArea
void CMemoryView::CTitle::Draw(HDC hDC,ePipeline* Pipe ){
//输出文字
RECT rc = GetArea();
COLORREF Oldcr = ::SetTextColor(hDC,RGB(0,0,0));
tstring s = Format1024(_T("%s (%3d) "),m_Text.c_str(),m_ChildList.size());
::DrawText(hDC,s.c_str(),s.size(),&rc,DT_LEFT|DT_EXPANDTABS|
DT_NOPREFIX|DT_VCENTER);
::SetTextColor(hDC,Oldcr);
}
开发者ID:GMIS,项目名称:GMIS,代码行数:12,代码来源:MemoryView.cpp
示例9: visible
void Damage::DrawAreas () {
BoxObj visible(0, 0, _canvas->Width() - 1, _canvas->Height() - 1);
BoxObj b, *a;
Iterator i;
for (FirstArea(i); !Done(i); Next(i)) {
a = GetArea(i);
b = *a - visible;
_output->ClearRect(_canvas, b._left, b._bottom, b._right, b._top);
_graphic->DrawClipped(_canvas, b._left, b._bottom, b._right, b._top);
}
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:12,代码来源:damage.c
示例10: Show
void MythUIScrollBar::CalculatePosition(void)
{
if (m_maximum > 0)
Show();
else
{
Hide();
return;
}
MythUIType *slider = GetChild("slider");
if (!slider)
{
LOG(VB_GENERAL, LOG_ERR, "Slider element doesn't exist");
return;
}
float percentage = (float)m_sliderPosition / m_maximum;
float relativeSize = (float)m_pageStep / (m_maximum + m_pageStep);
MythRect newSliderArea = slider->GetArea();
MythRect fillArea = GetArea();
QPoint endPos(newSliderArea.left(), newSliderArea.top());
if (m_layout == LayoutHorizontal)
{
int width = qMax((int)(fillArea.width() * relativeSize + 0.5),
m_sliderArea.width());
newSliderArea.setWidth(width);
endPos.setX((int)((fillArea.width() - width) * percentage + 0.5));
}
else
{
int height = qMax((int)(fillArea.height() * relativeSize + 0.5),
m_sliderArea.height());
newSliderArea.setHeight(height);
endPos.setY((int)((fillArea.height() - height) * percentage + 0.5));
}
slider->SetArea(newSliderArea);
slider->SetPosition(endPos);
if (m_hideDelay > 0)
{
if (m_timerId)
killTimer(m_timerId);
m_timerId = startTimer(m_hideDelay);
AdjustAlpha(1, 10, 0, 255);
}
}
开发者ID:JGunning,项目名称:OpenAOL-TV,代码行数:52,代码来源:mythuiscrollbar.cpp
示例11: FillRect
void CLogicView::CRefItem::Draw(HDC hDC, ePipeline* Pipe){
FillRect(hDC,GetArea(),SS.crTaskMassBk);
if(m_State & SPACE_FOCUSED){
DrawEdge(hDC,GetArea(),RGB(192,192,255));
}
COLORREF crOld = SetTextColor(hDC,SS.crBrainViewItemText);
RECT rc = GetArea();
rc.right = rc.left + 80;
rc.bottom = rc.top + 18;
rc.left +=2;
//被引用名
::DrawText(hDC,m_RefName.c_str(),m_RefName.size(),&rc,DT_END_ELLIPSIS|DT_LEFT|DT_SINGLELINE|DT_VCENTER);
//引用者名
rc.left = rc.right; rc.right +=100 ;
::DrawText(hDC,m_WhoRef.c_str(),m_WhoRef.size(),&rc,DT_END_ELLIPSIS|DT_LEFT|DT_SINGLELINE|DT_VCENTER);
SetTextColor(hDC,crOld);
};
开发者ID:GMIS,项目名称:GMIS,代码行数:22,代码来源:LogicView.cpp
示例12: GetArea
void CGFrameArea::Update (void)
// Update
//
// Update the area
{
for (int i = 0; i < GetAreaCount(); i++)
{
AGArea *pArea = GetArea(i);
pArea->Update();
}
}
开发者ID:bmer,项目名称:Alchemy,代码行数:13,代码来源:CGFrameArea.cpp
示例13: GetRadius
std::string CCircle::ToString() const
{
std::stringstream ss;
ss << std::fixed << std::setprecision(2) << "circle <" <<
m_center.GetPosition().first << ", " <<
m_center.GetPosition().second << ">, R = " <<
GetRadius() << ", S = " <<
GetArea() << ", P = " <<
GetPerimeter() << ", " <<
m_outlineColor << ", " <<
m_fillColor;
return ss.str();
}
开发者ID:dlxgit,项目名称:OOP,代码行数:13,代码来源:CCircle.cpp
示例14: SetFadeIn
void CBaseJungle::Init()
{
//---------------------------------------------------------------------------
//初期化
//---------------------------------------------------------------------------
SetFadeIn();
Sint32 col1 = 0xF0408080;
Sint32 col2 = 0xF0808040;
pGame->pBg->SetSkyColor(50,col1,col2);
viiSub::SetScroll_l( GetTargetPlayer()->x , GetTargetPlayer()->y );
//---------------------------------------------------------------------------
//ファイル初期化
//---------------------------------------------------------------------------
// LoadTexture( enTexPageSoldier , "HoundData\\enemychara\\common\\ene_soldier.bmp",0xff00ff00);
// UploadTexture();
//---------------------------------------------------------------------------
//エリア初期化
//---------------------------------------------------------------------------
switch(GetArea( )){
case enAreaSeq01:
LoadConfig( "HoundData\\[email protected]" );
viiSub::SetScroll_l( GetTargetPlayer()->x , GetTargetPlayer()->y );
// viiMus::ReadBGM( 0,"HoundData\\bgm\\A\\A3_Bgm1.ogg");
viiMus::PlayBGM(enSoundBgm1,enMusicBgmStageA);
// LoadConfig( "HoundData\\[email protected]" );
// LoadConfig( "HoundData\\[email protected]" );
// LoadConfig( "HoundData\\[email protected]" );
// LoadConfig( "HoundData\\[email protected]" );
break;
case enAreaSeq02:
break;
case enAreaSeq03:
break;
case enAreaSeq04:
break;
case enAreaSeq05:
break;
}
InitEnemies();
}
开发者ID:programmerMOT,项目名称:gunhound,代码行数:51,代码来源:CBaseJungle.cpp
示例15: GetArea
void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines )
{
// convert tracks and vias:
for( TRACK* track = m_Track; track != NULL; track = track->Next() )
{
if( !track->IsOnLayer( aLayer ) )
continue;
track->TransformShapeWithClearanceToPolygon( aOutlines, 0 );
}
// convert pads
for( MODULE* module = m_Modules; module != NULL; module = module->Next() )
{
module->TransformPadsShapesWithClearanceToPolygon( aLayer, aOutlines, 0 );
// Micro-wave modules may have items on copper layers
module->TransformGraphicShapesWithClearanceToPolygonSet( aLayer, aOutlines, 0 );
}
// convert copper zones
for( int ii = 0; ii < GetAreaCount(); ii++ )
{
ZONE_CONTAINER* zone = GetArea( ii );
PCB_LAYER_ID zonelayer = zone->GetLayer();
if( zonelayer == aLayer )
zone->TransformSolidAreasShapesToPolygonSet( aOutlines );
}
// convert graphic items on copper layers (texts)
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
if( !item->IsOnLayer( aLayer ) )
continue;
switch( item->Type() )
{
case PCB_LINE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( aOutlines, 0 );
break;
case PCB_TEXT_T:
( (TEXTE_PCB*) item )->TransformShapeWithClearanceToPolygonSet( aOutlines, 0 );
break;
default:
break;
}
}
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:51,代码来源:board_items_to_polygon_shape_transform.cpp
示例16: GetArea
void CDebugView::MassItem::Draw(HDC hDC, ePipeline* Pipe){
RECT rc = GetArea();
COLORREF crFg = SS.crTaskMassText, crBk = SS.crTaskMassBk;
if(m_State & SPACE_SELECTED){
// crFg = m_crBk; crBk = m_crText;
rc.bottom -= 25;
}
//画背景
if(m_State & SPACE_PAUSE ){
FillRect(hDC,rc,SS.crTaskMassPause);
crFg = SS.crTaskMassBk;
}else if (m_State & SPACE_BREAK)
{
FillRect(hDC,rc,SS.crTaskMassBreak);
crFg = SS.crTaskMassBk;
}
else{
FillRect(hDC,rc,crBk);
}
// rc.left += RectHeight(rc)+2;
//Draw MassName
COLORREF crOld = SetTextColor(hDC,crFg);
tstring s = Format1024(_T("%I64ld %s"),m_Alias,m_Name.c_str());
::DrawText(hDC,s.c_str(),s.size(),&rc,DT_END_ELLIPSIS|DT_LEFT|DT_SINGLELINE|DT_VCENTER);
::SetTextColor(hDC,crOld);
if(m_State & SPACE_FOCUSED || m_State & SPACE_SELECTED)
{
DrawEdge(hDC,GetArea(),SS.crTaskMassBorder);
}
}
开发者ID:GMIS,项目名称:GMIS,代码行数:38,代码来源:DebugView.cpp
示例17: Clear
/**
* \brief Assign a set of MythImages to the widget for animation.
* Use is strongly discouraged, use SetFilepattern() instead.
*
*/
void MythUIImage::SetImages(QVector<MythImage *> &images)
{
Clear();
QWriteLocker updateLocker(&d->m_UpdateLock);
QSize aSize = GetArea().size();
QVector<MythImage *>::iterator it;
for (it = images.begin(); it != images.end(); ++it)
{
MythImage *im = (*it);
if (!im)
{
QMutexLocker locker(&m_ImagesLock);
m_Images[m_Images.size()] = im;
continue;
}
im->UpRef();
if (!m_ForceSize.isNull())
{
int w = (m_ForceSize.width() <= 0) ? im->width() : m_ForceSize.width();
int h = (m_ForceSize.height() <= 0) ? im->height() : m_ForceSize.height();
im->Resize(QSize(w, h), m_preserveAspect);
}
if (m_isReflected && !im->IsReflected())
im->Reflect(m_reflectAxis, m_reflectShear, m_reflectScale,
m_reflectLength, m_reflectSpacing);
if (m_isGreyscale && !im->isGrayscale())
im->ToGreyscale();
m_ImagesLock.lock();
m_Images[m_Images.size()] = im;
m_ImagesLock.unlock();
aSize = aSize.expandedTo(im->size());
}
SetImageCount(1, m_Images.size());
if (m_ForceSize.isNull())
SetSize(aSize);
m_CurPos = 0;
SetRedraw();
}
开发者ID:DocOnDev,项目名称:mythtv,代码行数:55,代码来源:mythuiimage.cpp
示例18: GetArea
void CAddressBar::SeparatorLine::Draw(HDC hDC, ePipeline* Pipe){
RECT rc = GetArea();
int32 pading = 2;
if (m_bVerDraw)
{
rc.top +=pading;
rc.bottom-=pading;
int w = m_NumLine*(2);
rc.left = rc.left+(RectWidth(rc)-w)/2;
for (int i=0; i<m_NumLine; i++)
{
rc.right = rc.left+1;
//::DrawEdge(hDC,&rc,BDR_RAISEDINNER,BF_RECT);
FillRect(hDC,rc,m_crDark);
rc.left = rc.right;
rc.right = rc.left+1;
FillRect(hDC,rc,m_crLight);
rc.left = rc.right+2;
}
}else{
rc.left +=pading;
rc.right -=pading;
int h = m_NumLine*(2);
rc.top = rc.top+(RectHeight(rc)-h)/2;
for (int i=0; i<m_NumLine; i++)
{
rc.bottom = rc.top+1;
//::DrawEdge(hDC,&rc,BDR_RAISEDINNER,BF_RECT);
FillRect(hDC,rc,m_crDark);
//rc.top = rc.bottom;
//rc.bottom = rc.top+1;
//FillRect(hDC,rc,RGB(64,64,64));
rc.top = rc.bottom;
rc.bottom = rc.top+1;
FillRect(hDC,rc,m_crLight);
rc.top = rc.bottom+2;
}
}
}
开发者ID:GMIS,项目名称:GMIS,代码行数:50,代码来源:AddressBar.cpp
示例19: ContainsSolvedValue
bool Board::IsSquareValid(Coords coords, int solvedValue)
{
// Check that the solved value of this square doesn't appear in any of
// the rows, columns or areas it belongs to as a solved value too
if (ContainsSolvedValue(GetRow(coords), solvedValue, coords.XCoord()) ||
ContainsSolvedValue(GetCol(coords), solvedValue, coords.YCoord()) ||
ContainsSolvedValue(GetArea(coords), solvedValue, IndexInAreaMap(coords)))
{
cout << "Found invalid repeated value of " << solvedValue << endl;
return false;
}
return true;
}
开发者ID:fkp,项目名称:src,代码行数:14,代码来源:board.cpp
示例20: GetArea
void CFooterBar::ControlBnt::Draw(HDC hDC,ePipeline* Pipe /*=NULL*/){
RECT rc = GetArea();
HFONT GuiFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
HFONT OldFont = (HFONT)::SelectObject(hDC, GuiFont );
DWORD Format = DT_CENTER|DT_VCENTER|DT_SINGLELINE;
COLORREF crBorder = RGB(192,192,192);
COLORREF crFkg = RGB(0,0,0);
COLORREF crBkg = RGB(192,192,192);
//画文字边框
// DrawEdge(hDC,m_Area,crBorder);
DeflateRect(&rc,1,1,1,1);
COLORREF Oldcr;
if(m_State & SPACE_DISABLE){
DrawEdge(hDC,&rc,crBorder);
Oldcr = ::SetTextColor(hDC,crBkg);
::DrawText(hDC,m_Name.c_str(),m_Name.size(),&rc,Format);
::SetTextColor(hDC,Oldcr);
}
else if(m_State & SPACE_SELECTED){
DrawEdge(hDC,&rc,crBorder);
//FillRect(hDC,rc,crFkg);
Oldcr = ::SetTextColor(hDC,crFkg);
::DrawText(hDC,m_Name.c_str(),m_Name.size(),&rc,Format);
::SetTextColor(hDC,Oldcr);
}
else if(m_State&SPACE_FOCUSED){
FillRect(hDC,rc,crBkg);
DrawEdge(hDC,&rc,BDR_RAISEDOUTER|BDR_RAISEDINNER,BF_BOTTOMRIGHT|BF_TOPLEFT);
Oldcr = ::SetTextColor(hDC,crFkg);
rc.left-=1;
rc.top -=1;
::DrawText(hDC,m_Name.c_str(),m_Name.size(),&rc,Format);
::SetTextColor(hDC,Oldcr);
}
else {
FillRect(hDC,rc,crBkg);
DrawEdge(hDC,&rc,BDR_RAISEDOUTER|BDR_RAISEDINNER,BF_BOTTOMRIGHT|BF_TOPLEFT);
COLORREF Oldcr = ::SetTextColor(hDC,crFkg);
::DrawText(hDC,m_Name.c_str(),m_Name.size(),&rc,Format);
::SetTextColor(hDC,Oldcr);
}
::SelectObject(hDC,OldFont );
}
开发者ID:GMIS,项目名称:GMIS,代码行数:49,代码来源:OptionView.cpp
注:本文中的GetArea函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论