这篇教程C++ GetArea函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetArea函数的典型用法代码示例。如果您正苦于以下问题:C++ GetArea函数的具体用法?C++ GetArea怎么用?C++ GetArea使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetArea函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetAreaQString 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,
示例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,
示例3: GetAreavoid 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,
示例4: GetPerimeterstd::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,
示例5: GetDescriptionstring 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,
示例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,
示例7: GetAreavoid 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,
示例8: GetAreavoid 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,
示例9: visiblevoid 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,
示例10: Showvoid 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,
示例11: FillRectvoid 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,
示例12: GetAreavoid CGFrameArea::Update (void)// Update//// Update the area { for (int i = 0; i < GetAreaCount(); i++) { AGArea *pArea = GetArea(i); pArea->Update(); } }
开发者ID:bmer,项目名称:Alchemy,代码行数:13,
示例13: GetRadiusstd::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,
示例14: SetFadeInvoid 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 C++ GetAreaEntryByAreaID函数代码示例 C++ GetApplication函数代码示例
|