fixed rollup notification code

This commit is contained in:
rods%netscape.com 1999-09-23 12:03:44 +00:00
Родитель 19af9c48a6
Коммит 954e0cfbbd
1 изменённых файлов: 7 добавлений и 14 удалений

Просмотреть файл

@ -402,34 +402,27 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener, PRBoo
//-------------------------------------------------------------------------
LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
//if (msg != 0x200 && msg != 0x84 && msg != 0x20) {
// printf("hWnd 0x%p msg: %X 0x%p 0x%p %X\n", hWnd, msg, gRollupListener, gRollupWidget, WM_LBUTTONDOWN);
//}
// check to see if we have a rollup listener registered
if (nsnull != gRollupListener && nsnull != gRollupWidget) {
if (msg == WM_ACTIVATE || msg == WM_NCLBUTTONDOWN ||
msg == WM_NCMBUTTONDOWN || msg == WM_NCRBUTTONDOWN) {
gRollupListener->Rollup();
} else if (msg == WM_LBUTTONDOWN) {
// check to see if the window the event happened
if (msg == WM_ACTIVATE || msg == WM_NCLBUTTONDOWN || msg == WM_LBUTTONDOWN ||
msg == WM_NCMBUTTONDOWN || msg == WM_NCRBUTTONDOWN) {
// check to see if the window the event happened
// in is not the rollup window
RECT r;
::GetWindowRect(((nsWindow *)gRollupWidget)->mWnd, &r);
DWORD pos = ::GetMessagePos();
POINT mp;
mp.x = LOWORD(pos);
mp.y = HIWORD(pos);
mp.x = LOWORD(pos);
mp.y = HIWORD(pos);
// now make sure that it wasn't one of our children
if (mp.x < r.left || mp.x > r.right ||
mp.y < r.top || mp.y > r.bottom) {
mp.y < r.top || mp.y > r.bottom) {
gRollupListener->Rollup();
return TRUE;
}
}
}
}
// Get the window which caused the event and ask it to process the message
nsWindow *someWindow = (nsWindow*)::GetWindowLong(hWnd, GWL_USERDATA);