mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-25 06:10:35 +00:00
It now takes into account the suggested size in the calculation
This commit is contained in:
parent
3dc1aa04e6
commit
654caf2688
@ -56,6 +56,17 @@ static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
const nscoord kSuggestedNotSet = -1;
|
||||
nsTextControlFrame::nsTextControlFrame()
|
||||
{
|
||||
mSuggestedWidth = kSuggestedNotSet;
|
||||
mSuggestedHeight = kSuggestedNotSet;
|
||||
}
|
||||
|
||||
nsTextControlFrame::~nsTextControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsTextControlFrame::GetVerticalBorderWidth(float aPixToTwip) const
|
||||
{
|
||||
@ -295,3 +306,13 @@ nsTextControlFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("TextControl", aResult);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsTextControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight)
|
||||
{
|
||||
mSuggestedWidth = aWidth;
|
||||
mSuggestedHeight = aHeight;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -28,6 +28,9 @@ class nsTextControlFrame : public nsNativeFormControlFrame
|
||||
{
|
||||
/* ---------- methods implemented by base class ---------- */
|
||||
public:
|
||||
nsTextControlFrame();
|
||||
virtual ~nsTextControlFrame();
|
||||
|
||||
virtual const nsIID& GetCID();
|
||||
virtual const nsIID& GetIID();
|
||||
|
||||
@ -44,6 +47,7 @@ public:
|
||||
virtual PRInt32 GetMaxNumValues();
|
||||
|
||||
NS_IMETHOD GetCursor(nsIPresContext& aPresContext, nsPoint& aPoint, PRInt32& aCursor);
|
||||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -56,6 +56,17 @@ static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
const nscoord kSuggestedNotSet = -1;
|
||||
nsTextControlFrame::nsTextControlFrame()
|
||||
{
|
||||
mSuggestedWidth = kSuggestedNotSet;
|
||||
mSuggestedHeight = kSuggestedNotSet;
|
||||
}
|
||||
|
||||
nsTextControlFrame::~nsTextControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsTextControlFrame::GetVerticalBorderWidth(float aPixToTwip) const
|
||||
{
|
||||
@ -295,3 +306,13 @@ nsTextControlFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("TextControl", aResult);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsTextControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight)
|
||||
{
|
||||
mSuggestedWidth = aWidth;
|
||||
mSuggestedHeight = aHeight;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -28,6 +28,9 @@ class nsTextControlFrame : public nsNativeFormControlFrame
|
||||
{
|
||||
/* ---------- methods implemented by base class ---------- */
|
||||
public:
|
||||
nsTextControlFrame();
|
||||
virtual ~nsTextControlFrame();
|
||||
|
||||
virtual const nsIID& GetCID();
|
||||
virtual const nsIID& GetIID();
|
||||
|
||||
@ -44,6 +47,7 @@ public:
|
||||
virtual PRInt32 GetMaxNumValues();
|
||||
|
||||
NS_IMETHOD GetCursor(nsIPresContext& aPresContext, nsPoint& aPoint, PRInt32& aCursor);
|
||||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
||||
|
||||
protected:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user