Fixed border rendering during printing for Select and text, and text areas.

Implemented SetProperty/GetProperty methods for FileControlFrame
Added nsGenericHTMLElement::GetPrimaryFrame check for nsnull for doc return type.
nsHTMLInputElement.cpp replace NS_OK == with  NS_SUCCEEDED in GetValue and SetValue
Added GetName and GetValue utility methods to nsFormControlHelper
modified nsButtonControlFrame::PaintButton to take the label to paint as an extra parameter.
This allows it to be callable from the nsFileControlFrame code to render the button.
This commit is contained in:
kmcclusk@netscape.com
1999-02-11 01:13:28 +00:00
parent 4c76a367ae
commit d7eefcc655
23 changed files with 317 additions and 129 deletions

View File

@@ -285,6 +285,8 @@ nsFileControlFrame::GetName(nsString* aResult)
return result;
}
PRInt32
nsFileControlFrame::GetMaxNumValues()
{
@@ -358,12 +360,49 @@ nsFileControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
return 0;
}
NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
{
if (nsHTMLAtoms::value == aName) {
mTextFrame->SetTextControlFrameState(aValue);
}
return NS_OK;
}
}
NS_IMETHODIMP nsFileControlFrame::GetProperty(nsIAtom* aName, nsString& aValue)
{
// Return the value of the property from the widget it is not null.
// If widget is null, assume the widget is GFX-rendered and return a member variable instead.
if (nsHTMLAtoms::value == aName) {
mTextFrame->GetTextControlFrameState(aValue);
}
return NS_OK;
}
NS_METHOD
nsFileControlFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
// Since the file control has a mTextFrame which does not live in the content model
// it is necessary to get the current text value from the nsFileControlFrame through the
// content model, then explicitly ask the test frame to draw it.
// The mTextFrame's Paint method will still be called, but it will not render the current
// contents because it will not be possible for the content associated with the mTextFrame to
// get a handle to it frame in the presentation shell 0.
// mTextFrame->Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
mBrowseFrame->PaintButton(aPresContext, aRenderingContext, aDirtyRect, nsAutoString("Browse"));
if (eFramePaintLayer_Content == aWhichLayer) {
nsString text;
if (NS_SUCCEEDED(nsFormControlHelper::GetValue(mContent, &text))) {
mTextFrame->PaintTextControl(aPresContext, aRenderingContext, aDirtyRect, text, mStyleContext);
}
}
return NS_OK;
}