예제 #1
0
nsIBox*
nsGroupBoxFrame::GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect)
{
    // first child is our grouped area
    nsIBox* box = GetChildBox();

    // no area fail.
    if (!box)
      return nsnull;

    // get the first child in the grouped area, that is the caption
    box = box->GetChildBox();

    // nothing in the area? fail
    if (!box)
      return nsnull;

    // now get the caption itself. It is in the caption frame.
    nsIBox* child = box->GetChildBox();

    if (child) {
       // convert to our coordinates.
       nsRect parentRect(box->GetRect());
       aCaptionRect = child->GetRect();
       aCaptionRect.x += parentRect.x;
       aCaptionRect.y += parentRect.y;
    }

    return child;
}
예제 #2
0
void HighlightItem::setPos(double x, double y)
{
    QRectF pr = parentRect();
    m_xn = (x - pr.left()) / (double)pr.width();
    m_yn = (y - pr.top()) / (double)pr.height();
    reposition();
}
/*************************************
 * SetSize
 *************************************/
void SHVControlImplementerContainerWindowWin32::SetSize(SHVControlContainer* owner, int widthInPixels, int heightInPixels, SHVControlContainer::PosModes mode)
{
	if (SubType != SHVControlContainer::SubTypeTabPage)
	{
	SHVRect parentRect(owner->GetParent()->GetRect());
	SHVRect rect(GetRect(owner));

		SHVASSERT(IsCreated());

		rect.SetWidth(widthInPixels);
		rect.SetHeight(heightInPixels);

		switch (mode)
		{
		case SHVControlContainer::PosCenterScreen: // equals centerwindow on child containers
		case SHVControlContainer::PosCenterWindow:
			rect.SetX( (parentRect.GetWidth()-rect.GetWidth())/2 );
			rect.SetY( (parentRect.GetHeight()-rect.GetHeight())/2 );
			break;
		default:
			break;
		}

		SetRect(owner,rect);
	}
}
예제 #4
0
파일: Widget.cpp 프로젝트: MYSHLIFE/webkit
IntRect Widget::convertToContainingView(const IntRect& localRect) const
{
    if (const ScrollView* parentScrollView = parent()) {
        IntRect parentRect(localRect);
        parentRect.setLocation(parentScrollView->convertChildToSelf(this, localRect.location()));
        return parentRect;
    }
    return localRect;
}
예제 #5
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CEmptyContainer::SizeChanged()
    {
    FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::SizeChanged()"));

    TRect parentRect(Rect());
	if (iSkinContext)
        {
        iSkinContext->SetRect(parentRect);
        }
    FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::SizeChanged() complete"));
	}
예제 #6
0
void CGUIModalScreen::updateAbsolutePosition()
{
	core::rect<s32> parentRect(0,0,0,0);

	if (Parent)
	{
		parentRect = Parent->getAbsolutePosition();
		RelativeRect.UpperLeftCorner.X = 0;
		RelativeRect.UpperLeftCorner.Y = 0;
		RelativeRect.LowerRightCorner.X = parentRect.getWidth();
		RelativeRect.LowerRightCorner.Y = parentRect.getHeight();
	}

	IGUIElement::updateAbsolutePosition();
}
// ---------------------------------------------------------
// CMsgBodyControlEditor::LayoutEdwin
// ---------------------------------------------------------
//
void CMsgBodyControlEditor::LayoutEdwin()
    {
//    TAknLayoutRect msgTextPane;
//    msgTextPane.LayoutRect( MsgEditorCommons::MsgDataPane(),
//                            AknLayoutScalable_Apps::msg_text_pane( 0 ).LayoutLine() );
//                            
//    TAknLayoutRect msgBodyPane;
//    msgBodyPane.LayoutRect( msgTextPane.Rect(),
//                            AknLayoutScalable_Apps::msg_body_pane().LayoutLine() );
//    
//    TRect parentRect( msgBodyPane.Rect() );
    TRect parentRect( Rect() );
    parentRect.Move( 0, iParentControl->Position().iY );
    
    DoLayoutEdwin( parentRect/*, 
                   AknLayoutScalable_Apps::msg_body_pane_t1( 0 ).LayoutLine()*/ );
    }
예제 #8
0
void HighlightItem::reposition(const QRectF & rect)
{
    QRectF pr = rect.isNull() ? parentRect() : rect;
    QGraphicsItem::setPos((int)(pr.left() + m_xn * pr.width()), (int)(pr.top() + m_yn * pr.height()));
}