This commit is contained in:
pinkerton%netscape.com 1999-04-16 18:07:51 +00:00
Родитель fa42476fae
Коммит eb2b8ef385
2 изменённых файлов: 18 добавлений и 5 удалений

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

@ -32,6 +32,7 @@
#include "nsINameSpaceManager.h" #include "nsINameSpaceManager.h"
// //
// NS_NewTriStateCheckboxFrame // NS_NewTriStateCheckboxFrame
// //
@ -53,7 +54,11 @@ NS_NewTriStateCheckboxFrame(nsIFrame*& aResult)
nsTriStateCheckboxFrame::nsTriStateCheckboxFrame() nsTriStateCheckboxFrame::nsTriStateCheckboxFrame()
: mMouseDownOnCheckbox(PR_FALSE), nsLeafFrame() : mMouseDownOnCheckbox(PR_FALSE), nsLeafFrame()
{ {
} // create an atom for the "depress" attribute if it hasn't yet been created.
// if ( !sDepressAtom )
// sDepressAtom = dont_QueryInterface(NS_NewAtom("depress"));
} // cntr
// //
@ -214,12 +219,16 @@ nsTriStateCheckboxFrame::HandleEvent(nsIPresContext& aPresContext,
break; break;
case NS_MOUSE_LEFT_BUTTON_DOWN: case NS_MOUSE_LEFT_BUTTON_DOWN:
// set "hover" state so CSS redraws us // set "depressed" state so CSS redraws us
// if ( NS_SUCCEEDED(mContent->SetAttribute(kNameSpaceID_None, sDepressAtom, NS_STRING_TRUE, PR_TRUE)) )
// Invalidate(nsRect(0, 0, mRect.width, mRect.height), PR_TRUE);
mMouseDownOnCheckbox = PR_TRUE; mMouseDownOnCheckbox = PR_TRUE;
break; break;
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT:
// clear hover state so css redraws us // clear "depressed" state so css redraws us
if ( NS_SUCCEEDED(mContent->UnsetAttribute(kNameSpaceID_None, sDepressAtom, PR_TRUE)) )
Invalidate(nsRect(0, 0, mRect.width, mRect.height), PR_TRUE);
mMouseDownOnCheckbox = PR_FALSE; mMouseDownOnCheckbox = PR_FALSE;
break; break;

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

@ -42,14 +42,14 @@
#define nsTriStateCheckboxFrame_h__ #define nsTriStateCheckboxFrame_h__
#include "nsFormControlFrame.h"
#include "nsLeafFrame.h" #include "nsLeafFrame.h"
#include "prtypes.h" #include "prtypes.h"
#include "nsIAtom.h"
#include "nsCOMPtr.h"
class nsIPresContext; class nsIPresContext;
class nsString; class nsString;
class nsIContent; class nsIContent;
class nsIAtom;
nsresult NS_NewTriStateCheckboxFrame(nsIFrame*& aResult) ; nsresult NS_NewTriStateCheckboxFrame(nsIFrame*& aResult) ;
@ -102,6 +102,10 @@ protected:
//GFX-rendered state variables //GFX-rendered state variables
PRBool mMouseDownOnCheckbox; PRBool mMouseDownOnCheckbox;
// atom for the "depress" attribute. We will have a CSS rule that
// when this is set, draws the button depressed.
//static nsCOMPtr<nsIAtom> sDepressAtom;
}; // class nsTriStateCheckboxFrame }; // class nsTriStateCheckboxFrame