#4084 "JS events: Mac form element events"

This commit is contained in:
pierre%netscape.com 1999-06-16 00:41:30 +00:00
parent 3fffa7168d
commit e8149574c4
6 changed files with 14 additions and 14 deletions

View File

@ -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));
}

View File

@ -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));
}

View File

@ -64,6 +64,8 @@ nsTextAreaWidget::nsTextAreaWidget(): nsWindow()
mTE_Data = nsnull;
strcpy(gInstanceClassName, "nsTextAreaWidget");
//mBackground = NS_RGB(124, 124, 124);
AcceptFocusOnClick(PR_TRUE);
}

View File

@ -59,6 +59,8 @@ nsTextWidget::nsTextWidget() : nsMacControl(), nsITextWidget(), Repeater()
SetControlType(kControlEditTextProc);
mIsPassword = PR_FALSE;
mIsReadOnly = PR_FALSE;
AcceptFocusOnClick(PR_TRUE);
}
//-------------------------------------------------------------------------

View File

@ -73,6 +73,8 @@ nsWindow::nsWindow() : nsBaseWidget() , nsDeleteObserved(this)
SetForegroundColor(NS_RGB(0, 0, 0));
mPluginPort = nsnull;
AcceptFocusOnClick(PR_TRUE);
}

View File

@ -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;
};
//-------------------------------------------------------------------------