mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 08:35:26 +00:00
#4084 "JS events: Mac form element events"
This commit is contained in:
parent
3fffa7168d
commit
e8149574c4
@ -332,7 +332,6 @@ nsresult nsComboBox::Deselect()
|
||||
//-------------------------------------------------------------------------
|
||||
PRBool nsComboBox::DispatchMouseEvent(nsMouseEvent &aEvent)
|
||||
{
|
||||
PRBool eatEvent = PR_FALSE;
|
||||
switch (aEvent.message)
|
||||
{
|
||||
case NS_MOUSE_LEFT_DOUBLECLICK:
|
||||
@ -345,15 +344,10 @@ PRBool nsComboBox::DispatchMouseEvent(nsMouseEvent &aEvent)
|
||||
::TrackControl(mControl, thePoint, nil);
|
||||
ControlChanged(::GetControlValue(mControl));
|
||||
//¥TODO: the mouseUp event is eaten by TrackControl.
|
||||
//¥ We must create it and dispatch it after the mouseDown;
|
||||
eatEvent = PR_TRUE;
|
||||
//¥ We should create it and dispatch it after the mouseDown;
|
||||
}
|
||||
EndDraw();
|
||||
break;
|
||||
}
|
||||
|
||||
if (eatEvent)
|
||||
return PR_TRUE;
|
||||
return (Inherited::DispatchMouseEvent(aEvent));
|
||||
|
||||
}
|
||||
|
@ -59,6 +59,8 @@ nsListBox::nsListBox() : nsMacControl(), nsIListWidget(), nsIListBox()
|
||||
|
||||
mListHandle = nsnull;
|
||||
mMultiSelect = PR_FALSE;
|
||||
|
||||
AcceptFocusOnClick(PR_TRUE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -510,7 +512,6 @@ nsresult nsListBox::Deselect()
|
||||
//-------------------------------------------------------------------------
|
||||
PRBool nsListBox::DispatchMouseEvent(nsMouseEvent &aEvent)
|
||||
{
|
||||
PRBool eatEvent = PR_FALSE;
|
||||
switch (aEvent.message)
|
||||
{
|
||||
case NS_MOUSE_LEFT_DOUBLECLICK:
|
||||
@ -529,15 +530,10 @@ PRBool nsListBox::DispatchMouseEvent(nsMouseEvent &aEvent)
|
||||
ControlChanged(GetSelectedIndex());
|
||||
}
|
||||
//¥TODO: the mouseUp event is eaten by TrackControl.
|
||||
//¥ We must create it and dispatch it after the mouseDown;
|
||||
eatEvent = PR_TRUE;
|
||||
//¥ We should create it and dispatch it after the mouseDown;
|
||||
}
|
||||
EndDraw();
|
||||
break;
|
||||
}
|
||||
|
||||
if (eatEvent)
|
||||
return PR_TRUE;
|
||||
return (Inherited::DispatchMouseEvent(aEvent));
|
||||
|
||||
}
|
||||
|
@ -64,6 +64,8 @@ nsTextAreaWidget::nsTextAreaWidget(): nsWindow()
|
||||
mTE_Data = nsnull;
|
||||
strcpy(gInstanceClassName, "nsTextAreaWidget");
|
||||
//mBackground = NS_RGB(124, 124, 124);
|
||||
|
||||
AcceptFocusOnClick(PR_TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,6 +59,8 @@ nsTextWidget::nsTextWidget() : nsMacControl(), nsITextWidget(), Repeater()
|
||||
SetControlType(kControlEditTextProc);
|
||||
mIsPassword = PR_FALSE;
|
||||
mIsReadOnly = PR_FALSE;
|
||||
|
||||
AcceptFocusOnClick(PR_TRUE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -73,6 +73,8 @@ nsWindow::nsWindow() : nsBaseWidget() , nsDeleteObserved(this)
|
||||
SetForegroundColor(NS_RGB(0, 0, 0));
|
||||
|
||||
mPluginPort = nsnull;
|
||||
|
||||
AcceptFocusOnClick(PR_TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -139,6 +139,8 @@ public:
|
||||
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent& event);
|
||||
virtual nsresult HandleUpdateEvent();
|
||||
virtual void AcceptFocusOnClick(PRBool aBool) { mAcceptFocusOnClick = aBool;};
|
||||
PRBool AcceptFocusOnClick() { return mAcceptFocusOnClick;};
|
||||
|
||||
protected:
|
||||
|
||||
@ -174,6 +176,8 @@ protected:
|
||||
PRBool mTempRenderingContextMadeHere;
|
||||
|
||||
nsPluginPort* mPluginPort;
|
||||
|
||||
PRBool mAcceptFocusOnClick;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user