Add GetFrameForPoint to return the combobox when it is disabled. Added disabled code.

This commit is contained in:
rods%netscape.com 1999-08-10 19:25:22 +00:00
parent a2644affcd
commit 0701d68531
4 changed files with 36 additions and 12 deletions

View File

@ -636,8 +636,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext,
nsIFrame* displayFrame = GetDisplayFrame(aPresContext);
nsIFrame* dropdownFrame = GetDropdownFrame();
// Don't try to do any special sizing and positioning unless all of the frames
// have been created.
// Don't try to do any special sizing and positioning unless all of the frames
// have been created.
if ((nsnull == displayFrame) ||
(nsnull == buttonFrame) ||
(nsnull == dropdownFrame))
@ -837,6 +837,18 @@ nsComboboxControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValue
return PR_FALSE;
}
NS_IMETHODIMP
nsComboboxControlFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
{
if (nsFormFrame::GetDisabled(this)) {
*aFrame = this;
return NS_OK;
} else {
return nsHTMLContainerFrame::GetFrameForPoint(aPoint, aFrame);
}
return NS_OK;
}
//--------------------------------------------------------------
NS_IMETHODIMP
@ -948,10 +960,8 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext& aPresContext,
if (nsEventStatus_eConsumeNoDefault == aEventStatus) {
return NS_OK;
}
if (aEvent->message == NS_KEY_PRESS) {
int x = 0;
x++;
if (nsFormFrame::GetDisabled(this)) {
return NS_OK;
}
return NS_OK;

View File

@ -91,6 +91,8 @@ public:
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
// nsIFormControlFrame
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
NS_IMETHOD GetName(nsString* aName);

View File

@ -636,8 +636,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext,
nsIFrame* displayFrame = GetDisplayFrame(aPresContext);
nsIFrame* dropdownFrame = GetDropdownFrame();
// Don't try to do any special sizing and positioning unless all of the frames
// have been created.
// Don't try to do any special sizing and positioning unless all of the frames
// have been created.
if ((nsnull == displayFrame) ||
(nsnull == buttonFrame) ||
(nsnull == dropdownFrame))
@ -837,6 +837,18 @@ nsComboboxControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValue
return PR_FALSE;
}
NS_IMETHODIMP
nsComboboxControlFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
{
if (nsFormFrame::GetDisabled(this)) {
*aFrame = this;
return NS_OK;
} else {
return nsHTMLContainerFrame::GetFrameForPoint(aPoint, aFrame);
}
return NS_OK;
}
//--------------------------------------------------------------
NS_IMETHODIMP
@ -948,10 +960,8 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext& aPresContext,
if (nsEventStatus_eConsumeNoDefault == aEventStatus) {
return NS_OK;
}
if (aEvent->message == NS_KEY_PRESS) {
int x = 0;
x++;
if (nsFormFrame::GetDisabled(this)) {
return NS_OK;
}
return NS_OK;

View File

@ -91,6 +91,8 @@ public:
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
// nsIFormControlFrame
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
NS_IMETHOD GetName(nsString* aName);