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; }
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; }
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); } }