// ----------------------------------------------------------------------------- // Blit // // Blits given image to gc. // // ----------------------------------------------------------------------------- // inline static TBool Blit( MAknsSkinInstance* aSkin, CBitmapContext& aGc, const TRect& aTrgRect, CAknsImageItemData* aImgData, const TAknsItemID& aIID, const TAknsBackground* aLayout, const TPoint& aPADelta, const TInt aDrawParam ) { CAknsAppSkinInstance* appInstance = static_cast<CAknsAppSkinInstance*>(aSkin); if ( IsBackgroundItem( aIID,appInstance ) && appInstance && appInstance->AnimBackgroundState() ) { if( (aDrawParam&KAknsDrawParamPrepareOnly) ) { return ETrue; } TRgb color = KRgbWhite; color.SetAlpha(0x00); aGc.SetPenColor(color); aGc.SetBrushColor(color); aGc.SetPenStyle(CGraphicsContext::ESolidPen); aGc.SetBrushStyle(CGraphicsContext::ESolidBrush); aGc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); TRect layoutRect( aTrgRect ); if( aLayout ) { layoutRect = aLayout->iRect; } layoutRect.Move( -aPADelta ); TRect drawRect = aTrgRect; drawRect.Intersection( layoutRect ); aGc.Clear(drawRect); return ETrue; } TRect layoutRect( aTrgRect ); const TAknsImageAttributeData* attr = NULL; if( aLayout ) { layoutRect = aLayout->iRect; if( aLayout->iAttr.iAttributes != EAknsImageAttributeNone ) { attr = &(aLayout->iAttr); } } layoutRect.Move( -aPADelta ); TRect drawRect(aTrgRect); drawRect.Intersection( layoutRect ); return DrawPartialCachedImage( aSkin, aGc, layoutRect, drawRect, aImgData, aIID, attr, aDrawParam ); }
void QLabelPrivate::sendControlEvent(QEvent *e) { Q_Q(QLabel); if (!isTextLabel || !control || textInteractionFlags == Qt::NoTextInteraction) { e->ignore(); return; } control->processEvent(e, -layoutRect().topLeft(), q); }
void CToastDlg::DrawPromptMsg(Graphics * g, LPCTSTR msg) { SolidBrush brush(Color(0, 0, 255)); FontFamily fontFamily(L"微软雅黑"); Gdiplus::Font font(&fontFamily, 0.2f, FontStyleRegular, UnitInch); PointF pointF(50, 220); RectF layoutRect(30, 220, 700, 0); RectF boundRect; INT codePointsFitted = 0; INT linesFitted = 0; g->MeasureString(msg, -1, &font, layoutRect, NULL, &boundRect, &codePointsFitted, &linesFitted); g->DrawString(msg, -1, &font, boundRect, NULL, &brush); }
void Text::Draw(Gdiplus::Bitmap *buffer, Gdiplus::Graphics *graphics) { int units = CalcUnits(); Gdiplus::RectF layoutRect((float) _rect.X, (float) _rect.Y, (float) _rect.Width, (float) _rect.Height); graphics->SetTextRenderingHint(Gdiplus::TextRenderingHintAntiAlias); wchar_t perc[4]; _itow_s(units * (100 / _units), perc, 10); std::wstring tempstr(_formatString); const wchar_t *str = tempstr.replace(_replaceIndex, 8, perc).c_str(); graphics->DrawString(str, -1, _font, layoutRect, &_strFormat, _fontColor); UpdateDrawnValues(); }
void TailView::paintEvent(QPaintEvent * event) { m_layoutStrategy->performLayout(); QPainter painter(viewport()); QRectF viewrect(event->rect()); painter.fillRect(viewrect, Preferences::instance()->normalTextColor().background()); int scrollValue = m_layoutStrategy->topScreenLine(); for(QTextBlock block = m_document->begin(); block != m_document->end(); block = block.next()) { const QTextLayout * layout = block.layout(); QFontMetrics fontMetrics(layout->font()); qreal dy = m_document->blockGraphicalPositions().at(block.blockNumber()); QPoint start(0, dy - scrollValue * fontMetrics.lineSpacing()); QRectF layoutRect(layout->boundingRect()); layoutRect.moveTo(start); if(viewrect.intersects(layoutRect)) { layout->draw(&painter, start); } } }
// ----------------------------------------------------------------------------- // BlitAndClear // // Blits given image to gc and draws the area that is not // covered by the bitmap. // // ----------------------------------------------------------------------------- // inline static TBool BlitAndClear( MAknsSkinInstance* aSkin, CBitmapContext& aGc, const TRect& aTrgRect, CAknsImageItemData* aImgData, const TAknsItemID& aIID, const TAknsBackground* aLayout, const TPoint& aPADelta, const TInt aDrawParam ) { CAknsAppSkinInstance* appInstance = static_cast<CAknsAppSkinInstance*>(aSkin); if ( IsBackgroundItem( aIID,appInstance ) && appInstance && appInstance->AnimBackgroundState() ) { return Blit( aSkin, aGc, aTrgRect, aImgData, aIID, aLayout, aPADelta, aDrawParam ); } if( !(aDrawParam & KAknsDrawParamPrepareOnly) ) { TAknsItemType type = aImgData->Type(); // don't clear if the item is not a masked one if( AknsUtils::IsDerivedType( EAknsITMaskedBitmap, type ) && !(aDrawParam & KAknsDrawParamNoClearUnderImage) ) { TRect layoutRect( aTrgRect ); if( aLayout ) { layoutRect = aLayout->iRect; } layoutRect.Move( -aPADelta ); TRect drawRect(aTrgRect); drawRect.Intersection( layoutRect ); aGc.DrawRect( drawRect ); } } return Blit( aSkin, aGc, aTrgRect, aImgData, aIID, aLayout, aPADelta, aDrawParam ); }
// Returns the point in the document rect adjusted with p QPoint QLabelPrivate::layoutPoint(const QPoint& p) const { QRect lr = layoutRect().toRect(); return p - lr.topLeft(); }
void ComboBox::paintEvent(QPaintEvent* /*e*/) { QStyleOption opt; opt.initFrom(this); QPainter p(this); QRectF bRect = rect(); { ///Now draw the frame QColor fillColor; if (_clicked || _dirty) { fillColor = Qt::black; } else { double r, g, b; switch (_animation) { case 0: default: { appPTR->getCurrentSettings()->getRaisedColor(&r, &g, &b); break; } case 1: { appPTR->getCurrentSettings()->getInterpolatedColor(&r, &g, &b); break; } case 2: { appPTR->getCurrentSettings()->getKeyframeColor(&r, &g, &b); break; } case 3: { appPTR->getCurrentSettings()->getExprColor(&r, &g, &b); break; } } fillColor.setRgb( Color::floatToInt<256>(r), Color::floatToInt<256>(g), Color::floatToInt<256>(b) ); } double fw = frameWidth(); QPen pen; if ( !hasFocus() ) { pen.setColor(Qt::black); } else { double r, g, b; appPTR->getCurrentSettings()->getSelectionColor(&r, &g, &b); QColor c; c.setRgb( Color::floatToInt<256>(r), Color::floatToInt<256>(g), Color::floatToInt<256>(b) ); fw = 2; } p.setPen(pen); QRectF roundedRect = bRect.adjusted(fw / 2., fw / 2., -fw, -fw); bRect.adjust(fw, fw, -fw, -fw); p.fillRect(bRect, fillColor); double roundPixels = 3; QPainterPath path; path.addRoundedRect(roundedRect, roundPixels, roundPixels); p.drawPath(path); } QColor textColor; if (_readOnly) { textColor.setRgb(100, 100, 100); } else if (_altered) { double aR, aG, aB; appPTR->getCurrentSettings()->getAltTextColor(&aR, &aG, &aB); textColor.setRgbF(aR, aG, aB); } else if (!_enabled) { textColor = Qt::black; } else { double r, g, b; appPTR->getCurrentSettings()->getTextColor(&r, &g, &b); textColor.setRgb( Color::floatToInt<256>(r), Color::floatToInt<256>(g), Color::floatToInt<256>(b) ); } { Qt::Alignment align = QStyle::visualAlignment( Qt::LeftToRight, QFlag(_align) ); int flags = align | Qt::TextForceLeftToRight; ///Draw the text QPen pen = p.pen(); if (_currentIndex == -1) { QFont f = p.font(); f.setItalic(true); p.setFont(f); } pen.setColor(textColor); p.setPen(pen); QRectF lr = layoutRect().toAlignedRect(); p.drawText(lr.toRect(), flags, _currentText); } { ///Draw the dropdown icon QPainterPath path; QPolygonF poly; poly.push_back( QPointF(bRect.right() - DROP_DOWN_ICON_SIZE * 3. / 2., bRect.height() / 2. - DROP_DOWN_ICON_SIZE / 2.) ); poly.push_back( QPointF(bRect.right() - DROP_DOWN_ICON_SIZE / 2., bRect.height() / 2. - DROP_DOWN_ICON_SIZE / 2.) ); poly.push_back( QPointF(bRect.right() - DROP_DOWN_ICON_SIZE, bRect.height() / 2. + DROP_DOWN_ICON_SIZE / 2.) ); path.addPolygon(poly); p.fillPath(path, textColor); } } // ComboBox::paintEvent
void CSkinDialog::DrawFrame(Graphics & graphics) { CRect rcWindow; GetWindowRect(&rcWindow); Rect rc, rc1; // Title Left rc = m_bActive?m_mapRect["TitleLeftActive"]:m_mapRect["TitleLeft"]; rc1.X = 0; rc1.Y = 0; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Title Center rc = m_bActive?m_mapRect["TitleCenterActive"]:m_mapRect["TitleCenter"]; rc1.X = m_mapRect["TitleLeftActive"].Width; rc1.Y = 0; rc1.Width = rcWindow.Width()-m_mapRect["TitleLeftActive"].Width-m_mapRect["TitleRightActive"].Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Title Right rc = m_bActive?m_mapRect["TitleRightActive"]:m_mapRect["TitleRight"]; rc1.X = rc1.GetRight(); rc1.Y = 0; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Border Left rc = m_bActive?m_mapRect["BorderLeftActive"]:m_mapRect["BorderLeft"]; rc1.X = 0; rc1.Y = m_mapRect["TitleLeft"].Height; rc1.Width = rc.Width; rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Border Bottom rc = m_bActive?m_mapRect["BorderBotActive"]:m_mapRect["BorderBot"]; rc1.X = 0; rc1.Y = rcWindow.Height()-rc.Height-1; rc1.Width = rcWindow.Width(); rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Border Right rc = m_bActive?m_mapRect["BorderRightActive"]:m_mapRect["BorderRight"]; rc1.X = rcWindow.Width()-rc.Width-1; rc1.Y = m_mapRect["TitleLeftActive"].Height; rc1.Width = rc.Width; rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Close Button rc = m_nButtonDown==HT_CLOSE?m_mapRect["NcBtnCloseDown"]:m_mapRect["NcBtnClose"]; rc1.X = rcWindow.Width()-m_mapRect["NcBtnClosePos"].X; rc1.Y = m_mapRect["NcBtnClosePos"].Y; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Max Button if(GetStyle()&WS_MAXIMIZEBOX) { rc = IsZoomed()?(m_nButtonDown==HT_MAX?m_mapRect["NcBtnResDown"]:m_mapRect["NcBtnRes"]):(m_nButtonDown==HT_MAX?m_mapRect["NcBtnMaxDown"]:m_mapRect["NcBtnMax"]); rc1.X = rcWindow.Width()-m_mapRect["NcBtnMaxPos"].X; rc1.Y = m_mapRect["NcBtnMaxPos"].Y; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); } // Min Button if(GetStyle()&WS_MINIMIZEBOX) { rc = m_nButtonDown==HT_MIN?m_mapRect["NcBtnMinDown"]:m_mapRect["NcBtnMin"]; rc1.X = rcWindow.Width()-m_mapRect["NcBtnMinPos"].X; rc1.Y = m_mapRect["NcBtnMinPos"].Y; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); } Font myFont(L"宋体", 9); Color col(255,0,0,0); col.SetFromCOLORREF(m_mapColor["Caption"]); SolidBrush blackBrush(col); StringFormat format; format.SetAlignment(StringAlignmentNear); RectF layoutRect(::GetSystemMetrics(SM_CYICON)+m_mapRect["TitleTextStart"].X, m_mapRect["TitleTextStart"].Y, rcWindow.Width(), rcWindow.Height()); WCHAR string[MAX_PATH] = {0}; CString str; GetWindowText(str); MultiByteToWideChar( CP_ACP, 0, str, -1, string, MAX_PATH) ; graphics.DrawString(string, -1, &myFont, layoutRect, &format, &blackBrush); }
void CSkinDialog::OnNcPaint() { // TODO: Add your message handler code here if(!CImgSkin::IsLoaded()) { CXTPDialog::OnNcPaint(); return; } if(HasStyle(WS_CHILD)) { return; } /* RECT ClientRect; GetClientRect(&ClientRect); OffsetRect(&ClientRect, 100, 100); ExcludeClipRect(GetWindowDC()->GetSafeHdc(), ClientRect.left, ClientRect.top, ClientRect.right, ClientRect.bottom); */ CRect rcWindow; GetWindowRect(&rcWindow); Bitmap bmpBuf(rcWindow.Width(), rcWindow.Height()); Graphics graphics(&bmpBuf); Graphics g(GetWindowDC()->GetSafeHdc()); Rect rc, rc1; // Title Left rc = m_bActive?m_mapRect["TitleLeftActive"]:m_mapRect["TitleLeft"]; rc1.X = 0; rc1.Y = 0; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Title Center rc = m_bActive?m_mapRect["TitleCenterActive"]:m_mapRect["TitleCenter"]; rc1.X = m_mapRect["TitleLeftActive"].Width; rc1.Y = 0; rc1.Width = rcWindow.Width()-m_mapRect["TitleLeftActive"].Width-m_mapRect["TitleRightActive"].Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Title Right rc = m_bActive?m_mapRect["TitleRightActive"]:m_mapRect["TitleRight"]; rc1.X = rc1.GetRight(); rc1.Y = 0; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Border Left rc = m_bActive?m_mapRect["BorderLeftActive"]:m_mapRect["BorderLeft"]; rc1.X = 0; rc1.Y = m_mapRect["TitleLeftActive"].Height; rc1.Width = rc.Width; rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Border Bottom rc = m_bActive?m_mapRect["BorderBotActive"]:m_mapRect["BorderBot"]; rc1.X = 0; rc1.Y = rcWindow.Height()-rc.Height-1; rc1.Width = rcWindow.Width(); rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Border Right rc = m_bActive?m_mapRect["BorderRightActive"]:m_mapRect["BorderRight"]; rc1.X = rcWindow.Width()-rc.Width-1; rc1.Y = m_mapRect["TitleLeftActive"].Height; rc1.Width = rc.Width; rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Close Button rc = m_nButtonDown==HT_CLOSE?m_mapRect["NcBtnCloseDown"]:m_mapRect["NcBtnClose"]; rc1.X = rcWindow.Width()-m_mapRect["NcBtnClosePos"].X; rc1.Y = m_mapRect["NcBtnClosePos"].Y; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); // Max Button if(GetStyle()&WS_MAXIMIZEBOX) { rc = IsZoomed()?(m_nButtonDown==HT_MAX?m_mapRect["NcBtnResDown"]:m_mapRect["NcBtnRes"]):(m_nButtonDown==HT_MAX?m_mapRect["NcBtnMaxDown"]:m_mapRect["NcBtnMax"]); rc1.X = rcWindow.Width()-m_mapRect["NcBtnMaxPos"].X; rc1.Y = m_mapRect["NcBtnMaxPos"].Y; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); } // Min Button if(GetStyle()&WS_MINIMIZEBOX) { rc = m_nButtonDown==HT_MIN?m_mapRect["NcBtnMinDown"]:m_mapRect["NcBtnMin"]; rc1.X = rcWindow.Width()-m_mapRect["NcBtnMinPos"].X; rc1.Y = m_mapRect["NcBtnMinPos"].Y; rc1.Width = rc.Width; rc1.Height = rc.Height; graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel); } Font myFont(L"宋体", 9); Color col(255,0,0,0); col.SetFromCOLORREF(m_mapColor["Caption"]); SolidBrush blackBrush(col); StringFormat format; format.SetAlignment(StringAlignmentNear); RectF layoutRect(::GetSystemMetrics(SM_CYICON)+m_mapRect["TitleTextStart"].X, m_mapRect["TitleTextStart"].Y, rcWindow.Width(), rcWindow.Height()); WCHAR string[MAX_PATH] = {0}; CString str; GetWindowText(str); MultiByteToWideChar( CP_ACP, 0, str, -1, string, MAX_PATH) ; graphics.DrawString(string, -1, &myFont, layoutRect, &format, &blackBrush); g.DrawImage(&bmpBuf, 0, 0); // Do not call CXTPDialog::OnNcPaint() for painting messages }
// virtual LDraw::SizeD DockPanel::MeasureOverride(LDraw::SizeD availSize) { LDraw::BBoxD layoutRect(0, 0, availSize.Width, availSize.Height); double minWidth = 0; double minHeight = 0; double totalWidth = 0; double totalHeight = 0; unsigned int ncount = get_InternalChildren()->GetCount(); #if 0 for (unsigned int i = 0; i < ncount; i++) { UIElement* pVisual = get_InternalChildren()->GetItem(i);//(*get_rchildList())[i]; // TODO remove this // pVisual->SetRParent(this); } #endif for (unsigned int i = 0; i < ncount; i++) { UIElement* pVisual = get_InternalChildren()->get_Item(i);//(*get_rchildList())[i]; ASSERT(pVisual->GetRParent() == this); if (pVisual->get_Visibility() != Collapsed) { DockEnum dock = GetDock(pVisual); if (dock == Fill || ((i == ncount-1) && get_LastChildFill())) { pVisual->Measure(LDraw::SizeD(layoutRect.GetWidth(), layoutRect.GetHeight())); totalWidth += pVisual->get_DesiredSize().Width; totalHeight += pVisual->get_DesiredSize().Height; break; } else if (dock == Left) { pVisual->Measure(LDraw::SizeD(0, layoutRect.GetHeight())); layoutRect.left += pVisual->get_DesiredSize().Width; totalWidth += pVisual->get_DesiredSize().Width; // totalHeight = max(totalHeight, pVisual->m_desiredHeight); minHeight = MAX(minHeight, pVisual->get_DesiredSize().Height); } else if (dock == Top) { pVisual->Measure(LDraw::SizeD(layoutRect.GetWidth(), 0)); layoutRect.top += pVisual->get_DesiredSize().Height; totalHeight += pVisual->get_DesiredSize().Height; // totalWidth = max(totalWidth, pVisual->m_desiredWidth); minWidth = MAX(minWidth, pVisual->get_DesiredSize().Width); } else if (dock == Right) { pVisual->Measure(LDraw::SizeD(0, layoutRect.GetHeight())); layoutRect.right -= pVisual->get_DesiredSize().Width; totalWidth += pVisual->get_DesiredSize().Width; // totalHeight = max(totalHeight, pVisual->m_desiredHeight); minHeight = MAX(minHeight, pVisual->get_DesiredSize().Height); } else if (dock == Bottom) { pVisual->Measure(LDraw::SizeD(layoutRect.GetWidth(), 0)); layoutRect.bottom -= pVisual->get_DesiredSize().Height; totalHeight += pVisual->get_DesiredSize().Height; // totalWidth = max(totalWidth, pVisual->m_desiredWidth); minWidth = MAX(minWidth, pVisual->get_DesiredSize().Width); } else ASSERT(0); // pVisual->SetLayoutOffset(fLeft, fTop); // pVisual->Arrange(LDraw::SizeF(pVisual->m_computedWidth, pVisual->m_computedHeight)); /* if (dock == Fill || layoutRect.GetWidth() <= 0 || layoutRect.GetHeight() <= 0) { break; } */ } } return LDraw::SizeD(MAX(minWidth, totalWidth), MAX(minHeight, totalHeight)); }
// virtual LDraw::SizeD DockPanel::ArrangeOverride(LDraw::SizeD finalSize) { LDraw::BBoxD layoutRect(0, 0, finalSize.Width, finalSize.Height); unsigned int ncount = get_InternalChildren()->GetCount();//get_rchildList()->get_Size(); for (unsigned int i = 0; i < ncount; i++) { UIElement* pVisual = get_InternalChildren()->get_Item(i);//(*get_rchildList())[i]; if (pVisual->get_Visibility() != Collapsed) { // long dockValue; DockEnum dock = GetDock(pVisual); ASSERT(pVisual->get_DesiredSize().Width >= 0 && pVisual->get_DesiredSize().Height >= 0); // double fLeft; // double fTop; if (dock == Fill || ((i == ncount-1) && get_LastChildFill())) { pVisual->Arrange(layoutRect);//LDraw::RectD(layoutRect.GetWidth(), layoutRect.GetHeight())); // fLeft = layoutRect.left; // fTop = layoutRect.top; } else if (dock == Left) { pVisual->Arrange(LDraw::RectD(layoutRect.left, layoutRect.top, pVisual->get_DesiredSize().Width, layoutRect.GetHeight())); // fLeft = layoutRect.left; // fTop = layoutRect.top; layoutRect.left += pVisual->get_ActualSize().Width; } else if (dock == Top) { pVisual->Arrange(LDraw::RectD(layoutRect.left, layoutRect.top, layoutRect.GetWidth(), pVisual->get_DesiredSize().Height)); // fLeft = layoutRect.left; // fTop = layoutRect.top; layoutRect.top += pVisual->get_ActualSize().Height; } else if (dock == Right) { pVisual->Arrange(LDraw::RectD(layoutRect.right - pVisual->get_DesiredSize().Width, layoutRect.top, pVisual->get_DesiredSize().Width, layoutRect.GetHeight())); // fLeft = layoutRect.right - pVisual->get_ActualSize().Width; // fTop = layoutRect.top; layoutRect.right -= pVisual->get_ActualSize().Width; } else if (dock == Bottom) { pVisual->Arrange(LDraw::RectD(layoutRect.left, layoutRect.bottom - pVisual->get_DesiredSize().Height, layoutRect.GetWidth(), pVisual->get_DesiredSize().Height)); // fLeft = layoutRect.left; // fTop = layoutRect.bottom - pVisual->get_ActualSize().Height; layoutRect.bottom -= pVisual->get_ActualSize().Height; } else ASSERT(0); // pVisual->SetLayoutOffset(fLeft, fTop); if (dock == Fill || layoutRect.GetWidth() <= 0 || layoutRect.GetHeight() <= 0) { break; } } } return finalSize; }