Esempio n. 1
0
 Base::NRect NFrameBase::GetRootRect() const
 {
     Base::NRect result = frameRect_;
     if(parentFrame_ != NULL)
     {
         Base::NRect parentRect = parentFrame_->GetRootRect();
         result.Offset(parentRect.Left, parentRect.Top);
     }
     return result;
 }
Esempio n. 2
0
 Base::NRect NFrameBase::GetScreenRect() const
 {
     if(window_ == NULL)
         return GetRootRect();
     Base::NRect windowRect;
     if(!window_->GetRect(windowRect))
         return GetRootRect();
     Base::NRect rootRect = GetRootRect();
     rootRect.Offset(windowRect.Left, windowRect.Top);
     return rootRect;
 }
Esempio n. 3
0
        void NWindow::OnDraw(NRender* render, const Base::NRect& clipRect)
        {
            renderStatus_.BeforeDraw();

            Base::NRect rcClient;
            GetRect(rcClient);
            rcClient.Offset(-rcClient.Left, -rcClient.Top);

            if(drawCallback_ && drawCallback_(this, render, clipRect))
            {
                renderStatus_.DrawStatus(render, rcClient);
                return;
            }

            if(rootFrame_ != NULL)
            {
                Base::NPoint pt;
                rootFrame_->Draw(render, pt, clipRect);
                renderStatus_.DrawStatus(render, rcClient);
            }
        }