*** empty log message ***

This commit is contained in:
rods@netscape.com
2000-08-02 22:07:46 +00:00
parent 2c85d7c0b7
commit fe15dc9616
10 changed files with 150 additions and 8 deletions

View File

@@ -54,7 +54,8 @@ NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
// Initialize GFX-rendered state
nsGfxCheckboxControlFrame::nsGfxCheckboxControlFrame()
: mChecked(eOff),
mCheckButtonFaceStyle(nsnull)
mCheckButtonFaceStyle(nsnull),
mInClickEvent(PR_FALSE)
{
}
@@ -94,6 +95,14 @@ nsGfxCheckboxControlFrame::SetCheckboxFaceStyleContext(nsIStyleContext *aCheckbo
return NS_OK;
}
//--------------------------------------------------------------
NS_IMETHODIMP
nsGfxCheckboxControlFrame::SetIsInClickEvent(PRBool aVal)
{
mInClickEvent = aVal;
return NS_OK;
}
//------------------------------------------------------------
//
// Init
@@ -414,6 +423,22 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext,
nsGfxCheckboxControlFrame::CheckState
nsGfxCheckboxControlFrame::GetCheckboxState ( )
{
// If we are processing an onclick event then
// always return the opposite value
// additional explanantion is in nsICheckboxControlFrame or nsHTMLInputElement.cpp
if (mInClickEvent) {
if (!IsTristateCheckbox()) {
return mChecked == eOn? eOff : eOn;
} else {
switch (mChecked) {
case eOff: return eOn;
case eOn: return eMixed;
case eMixed: return eOff;
default:
break;
}
}
}
return mChecked;
}