fixes for bug 41015. accidentally broke checkmenus trying to fix radio menus. also fixing it so that radio menus no long uncheck their siblings twice. r=saari.

This commit is contained in:
pinkerton%netscape.com 2000-05-30 23:12:41 +00:00
Родитель 4031dc0bb4
Коммит ba231e24c5
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -115,6 +115,14 @@ nsMenuItem::GetEnabled(PRBool *aIsEnabled)
NS_METHOD nsMenuItem::SetChecked(PRBool aIsEnabled)
{
mIsChecked = aIsEnabled;
// update the content model
if ( mIsChecked )
mDOMElement->SetAttribute(NS_ConvertASCIItoUCS2("checked"), NS_ConvertASCIItoUCS2("true"));
else
mDOMElement->SetAttribute(NS_ConvertASCIItoUCS2("checked"), NS_ConvertASCIItoUCS2("false"));
// uncheck others if we're a radiomenu
if ( mMenuType == eRadio && aIsEnabled )
UncheckRadioSiblings ( mDOMElement );
@ -189,7 +197,6 @@ nsEventStatus nsMenuItem::MenuItemSelected(const nsMenuEvent & aMenuEvent)
if ( mIsChecked )
break;
SetChecked(PR_TRUE);
UncheckRadioSiblings(mDOMElement);
break;
}