From 0ea4986249c5a8d43f6c76a791df6640a74fcf5f Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 5 Apr 2003 03:40:42 +0000 Subject: Changes to allow calltips to be popup rather than child windows. --- win32/PlatWin.cxx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'win32/PlatWin.cxx') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index ffa9b81ef..09bf83ded 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -761,10 +761,19 @@ PRectangle Window::GetPosition() { void Window::SetPosition(PRectangle rc) { ::SetWindowPos(reinterpret_cast(id), - 0, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER); -} - -void Window::SetPositionRelative(PRectangle rc, Window) { + 0, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER|SWP_NOACTIVATE); +} + +void Window::SetPositionRelative(PRectangle rc, Window w) { + LONG style = ::GetWindowLong(reinterpret_cast(id), GWL_STYLE); + if (style & WS_POPUP) { + RECT rcOther; + ::GetWindowRect(reinterpret_cast(w.GetID()), &rcOther); + rc.top += rcOther.top; + rc.left += rcOther.left; + rc.bottom += rcOther.top; + rc.right += rcOther.left; + } SetPosition(rc); } @@ -776,7 +785,7 @@ PRectangle Window::GetClientPosition() { void Window::Show(bool show) { if (show) - ::ShowWindow(reinterpret_cast(id), SW_SHOWNORMAL); + ::ShowWindow(reinterpret_cast(id), SW_SHOWNOACTIVATE); else ::ShowWindow(reinterpret_cast(id), SW_HIDE); } -- cgit v1.2.3