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 NFrameBase::Invalidate() const { if(!window_ || !IsVisible() || !IsValid()) return; Base::NRect rootRect = GetRootRect(); window_->InvalidateRect(rootRect); }
void NFrameBase::ForceInvalidate() const { if(!window_) return; Base::NRect rootRect = GetRootRect(); window_->InvalidateRect(rootRect); }
void NWndUi::OnWindowChanged(NWindow* window) { __super::OnWindowChanged(window); if(window == NULL || realWindow_ != NULL) return; Base::NString wndClassName; DWORD style; DWORD exStyle; if(!GetWndData(wndClassName, style, exStyle)) return; Base::NRect rcWnd = GetRootRect(); HWND hWnd = ::CreateWindowEx(exStyle, wndClassName, GetText().GetData(), WS_TABSTOP | WS_CHILD | (IsVisible() ? WS_VISIBLE : 0) | style, rcWnd.Left, rcWnd.Top, rcWnd.Width(), rcWnd.Height(), window->GetNative(), NULL, ::GetModuleHandle(NULL), 0); AttachWnd(hWnd); ::SendMessage(hWnd, WM_SETFONT, ::SendMessage(window->GetNative(), WM_GETFONT, 0, 0), TRUE); }
bool NWndUi::SetPosImpl(int left, int top, bool force) { if(!__super::SetPosImpl(left, top, force) || realWindow_ == NULL) return false; Base::NRect rcWnd = GetRootRect(); ::SetWindowPos(realWindow_, NULL, rcWnd.Left, rcWnd.Top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); return true; }