Factored out code for helper functions for determining size and for rendering

git-svn-id: svn://10.0.0.236/trunk@18302 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rods%netscape.com
1999-01-22 15:32:57 +00:00
parent 9d5248a35c
commit 9b13d22d70
26 changed files with 475 additions and 778 deletions

View File

@@ -17,6 +17,7 @@
*/
#include "nsHTMLContainerFrame.h"
#include "nsFormControlHelper.h"
#include "nsIFormControlFrame.h"
#include "nsHTMLParts.h"
#include "nsIFormControl.h"
@@ -46,13 +47,13 @@
#include "nsColor.h"
//Enumeration of possible mouse states used to detect mouse clicks
enum nsMouseState {
/*enum nsMouseState {
eMouseNone,
eMouseEnter,
eMouseExit,
eMouseDown,
eMouseUp
};
};*/
static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID);
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
@@ -104,6 +105,17 @@ public:
void SetFocus(PRBool aOn, PRBool aRepaint);
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
nsFont& aFont);
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
virtual nscoord GetVerticalInsidePadding(float aPixToTwip,
nscoord aInnerHeight) const;
virtual nscoord GetHorizontalInsidePadding(nsIPresContext& aPresContext,
float aPixToTwip,
nscoord aInnerWidth,
nscoord aCharWidth) const;
void GetDefaultLabel(nsString& aLabel);
protected:
@@ -650,4 +662,34 @@ nsHTMLButtonControlFrame::GetSkipSides() const
return 0;
}
NS_IMETHODIMP
nsHTMLButtonControlFrame::GetFont(nsIPresContext* aPresContext,
nsFont& aFont)
{
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLButtonControlFrame::GetFormContent(nsIContent*& aContent) const
{
return GetContent(aContent);
}
nscoord
nsHTMLButtonControlFrame::GetVerticalInsidePadding(float aPixToTwip,
nscoord aInnerHeight) const
{
return 0;
}
nscoord
nsHTMLButtonControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
float aPixToTwip,
nscoord aInnerWidth,
nscoord aCharWidth) const
{
return 0;
}