The AttributeChanged(...) method of all form controls now call their base class AttributeChanged() method. Also implemented the disabled attribute in the base class...

git-svn-id: svn://10.0.0.236/trunk@18597 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
1999-01-26 07:57:54 +00:00
parent 92f7c1bbaa
commit 8f0d397a2d
7 changed files with 70 additions and 52 deletions

View File

@@ -359,29 +359,30 @@ nsTextControlFrame::AttributeChanged(nsIPresContext* aPresContext,
PRInt32 aHint)
{
nsresult result = NS_OK;
PRInt32 type;
GetType(&type);
if (mWidget) {
nsITextWidget* text = nsnull;
result = mWidget->QueryInterface(kITextWidgetIID, (void**)&text);
if ((NS_SUCCEEDED(result)) && (nsnull != text)) {
if (nsHTMLAtoms::value == aAttribute) {
nsString value;
nsresult result = GetText(&value);
PRUint32 ignore;
text->SetText(value, ignore);
nsFormFrame::StyleChangeReflow(aPresContext, this);
} else if (nsHTMLAtoms::size == aAttribute) {
if ((nsHTMLAtoms::value == aAttribute) && (nsnull != text)) {
nsString value;
nsresult rv = GetText(&value);
PRUint32 ignore;
text->SetText(value, ignore);
nsFormFrame::StyleChangeReflow(aPresContext, this);
} else if (nsHTMLAtoms::maxlength == aAttribute) {
PRInt32 maxLength;
nsresult result = GetMaxLength(&maxLength);
if (NS_CONTENT_ATTR_NOT_THERE != result) {
text->SetMaxTextLength(maxLength);
}
} else if (nsHTMLAtoms::size == aAttribute) {
nsFormFrame::StyleChangeReflow(aPresContext, this);
} else if ((nsHTMLAtoms::maxlength == aAttribute) && (nsnull != text)) {
PRInt32 maxLength;
nsresult rv = GetMaxLength(&maxLength);
if (NS_CONTENT_ATTR_NOT_THERE != rv) {
text->SetMaxTextLength(maxLength);
}
NS_RELEASE(text);
}
// Allow the base class to handle common attributes supported
// by all form elements...
else {
result = nsFormControlFrame::AttributeChanged(aPresContext, aChild, aAttribute, aHint);
}
NS_IF_RELEASE(text);
}
return result;