Move focus shifting code from nsScrollingView.cpp to nsEventStateManager.cpp

This commit is contained in:
joki%netscape.com 1999-01-08 21:13:59 +00:00
Родитель 9b32717dad
Коммит d798c3e079
3 изменённых файлов: 20 добавлений и 11 удалений

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

@ -113,6 +113,10 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
case NS_MOUSE_RIGHT_BUTTON_DOWN:
if (nsnull != aEvent->widget) {
aEvent->widget->SetFocus();
}
//Break left out on purpose
case NS_MOUSE_LEFT_BUTTON_UP:
case NS_MOUSE_MIDDLE_BUTTON_UP:
case NS_MOUSE_RIGHT_BUTTON_UP:
@ -126,6 +130,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
ShiftFocus();
aStatus = nsEventStatus_eConsumeNoDefault;
break;
case NS_VK_PAGE_DOWN:
case NS_VK_PAGE_UP:
break;
case NS_VK_DOWN:
case NS_VK_UP:
break;
}
}
break;

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

@ -113,6 +113,10 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
case NS_MOUSE_RIGHT_BUTTON_DOWN:
if (nsnull != aEvent->widget) {
aEvent->widget->SetFocus();
}
//Break left out on purpose
case NS_MOUSE_LEFT_BUTTON_UP:
case NS_MOUSE_MIDDLE_BUTTON_UP:
case NS_MOUSE_RIGHT_BUTTON_UP:
@ -126,6 +130,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
ShiftFocus();
aStatus = nsEventStatus_eConsumeNoDefault;
break;
case NS_VK_PAGE_DOWN:
case NS_VK_PAGE_UP:
break;
case NS_VK_DOWN:
case NS_VK_UP:
break;
}
}
break;

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

@ -662,17 +662,6 @@ NS_IMETHODIMP nsScrollingView :: HandleEvent(nsGUIEvent *aEvent, PRUint32 aEvent
switch (aEvent->message)
{
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
case NS_MOUSE_RIGHT_BUTTON_DOWN:
GetWidget(win);
if (nsnull != win)
{
win->SetFocus();
NS_RELEASE(win);
}
break;
case NS_KEY_DOWN:
{
nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent;