зеркало из https://github.com/mozilla/gecko-dev.git
Fixing keyboard control of forms
This commit is contained in:
Родитель
2ed0ecc629
Коммит
1b3046bc1d
|
@ -521,7 +521,7 @@ nsButtonControlFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
case NS_KEY_DOWN:
|
||||
if (NS_KEY_EVENT == aEvent->eventStructType) {
|
||||
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
|
||||
if (NS_VK_SPACE == keyEvent->keyCode) {
|
||||
if (NS_VK_SPACE == keyEvent->keyCode || NS_VK_RETURN == keyEvent->keyCode) {
|
||||
MouseClicked(&aPresContext);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -353,13 +353,26 @@ nsCheckboxControlFrame::Paint(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
NS_METHOD nsCheckboxControlFrame::HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus)
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
if (nsEventStatus_eConsumeNoDefault == aEventStatus) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
switch(aEvent->message) {
|
||||
case NS_KEY_PRESS:
|
||||
if (NS_KEY_EVENT == aEvent->eventStructType) {
|
||||
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
|
||||
if (NS_VK_SPACE == keyEvent->keyCode || NS_VK_RETURN == keyEvent->keyCode) {
|
||||
MouseClicked(&aPresContext);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (nsnull == mWidget) {
|
||||
// Handle GFX rendered widget Mouse Down event
|
||||
PRInt32 type;
|
||||
|
|
|
@ -393,6 +393,31 @@ nsRadioControlFrame::Paint(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsRadioControlFrame::HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
if (nsEventStatus_eConsumeNoDefault == aEventStatus) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
switch(aEvent->message) {
|
||||
case NS_KEY_PRESS:
|
||||
if (NS_KEY_EVENT == aEvent->eventStructType) {
|
||||
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
|
||||
if (NS_VK_SPACE == keyEvent->keyCode || NS_VK_RETURN == keyEvent->keyCode) {
|
||||
MouseClicked(&aPresContext);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return(nsFormControlFrame::HandleEvent(aPresContext, aEvent, aEventStatus));
|
||||
}
|
||||
|
||||
void nsRadioControlFrame::GetRadioControlFrameState(nsString& aValue)
|
||||
{
|
||||
if (nsnull != mWidget) {
|
||||
|
|
|
@ -73,11 +73,15 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
|
||||
|
||||
virtual void PaintRadioButton(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus);
|
||||
|
||||
///XXX: End o the temporary methods
|
||||
|
||||
protected:
|
||||
|
|
Загрузка…
Ссылка в новой задаче