Moved ForceDrawFrame from nsComboboxControlFrame to nsFormControlHelper
Removed commented out code in nsFormControlHelper.h. Modified nsCheckboxControlFrame and nsRadioControlFrame to use ForceDrawFrame when gfx-rendered. git-svn-id: svn://10.0.0.236/trunk@19519 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -104,18 +104,12 @@ public:
|
||||
nsIStyleContext * aStyleContext,
|
||||
nsFont& aFont);
|
||||
|
||||
static void ForceDrawFrame(nsIFrame * aFrame);
|
||||
|
||||
// XXX similar functionality needs to be added to widget library and these
|
||||
// need to change to use it.
|
||||
static nscoord GetScrollbarWidth(float aPixToTwip);
|
||||
/*virtual nscoord GetVerticalBorderWidth(float aPixToTwip) const;
|
||||
virtual nscoord GetHorizontalBorderWidth(float aPixToTwip) const;
|
||||
virtual nscoord GetVerticalInsidePadding(float aPixToTwip,
|
||||
nscoord aInnerHeight) const;
|
||||
virtual nscoord GetHorizontalInsidePadding(nsIPresContext& aPresContext,
|
||||
float aPixToTwip,
|
||||
nscoord aInnerWidth,
|
||||
nscoord aCharWidth) const;
|
||||
*/
|
||||
|
||||
static nsCompatibility GetRepChars(nsIPresContext& aPresContext, char& char1, char& char2);
|
||||
|
||||
//
|
||||
@@ -151,10 +145,6 @@ public:
|
||||
nsresult GetDefaultCheckState(PRBool* aState);
|
||||
|
||||
|
||||
//nscoord GetStyleDim(nsIPresContext& aPresContext, nscoord aMaxDim,
|
||||
// nscoord aMaxWidth, const nsStyleCoord& aCoord);
|
||||
|
||||
|
||||
//
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Utility methods for rendering Form Elements using GFX
|
||||
@@ -343,203 +333,7 @@ public:
|
||||
const nsRect& aDirtyRect, nsIStyleContext* aStyleContext, PRBool aInset,
|
||||
nsIFrame* aForFrame, PRUint32 aWidth, PRUint32 aHeight);
|
||||
|
||||
#if 0
|
||||
//******************************************************************
|
||||
//******************************************************************
|
||||
//******************************************************************
|
||||
//******************************************************************
|
||||
//******************************************************************
|
||||
//******************************************************************
|
||||
//******************************************************************
|
||||
//******************************************************************
|
||||
//
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Utility methods for rendering Form Elements using GFX
|
||||
//-------------------------------------------------------------------------------------
|
||||
//
|
||||
// XXX: The following location for the paint code is TEMPORARY.
|
||||
// It is being used to get printing working
|
||||
// under windows. Later it will be used to GFX-render the controls to the display.
|
||||
// Expect this code to repackaged and moved to a new location in the future.
|
||||
|
||||
/**
|
||||
* Enumeration of possible mouse states used to detect mouse clicks
|
||||
*/
|
||||
enum nsArrowDirection {
|
||||
eArrowDirection_Left,
|
||||
eArrowDirection_Right,
|
||||
eArrowDirection_Up,
|
||||
eArrowDirection_Down
|
||||
};
|
||||
|
||||
/**
|
||||
* Scale, translate and convert an arrow of poitns from nscoord's to nsPoints's.
|
||||
*
|
||||
* @param aNumberOfPoints number of (x,y) pairs
|
||||
* @param aPoints arrow of points to convert
|
||||
* @param aScaleFactor scale factor to apply to each points translation.
|
||||
* @param aX x coordinate to add to each point after scaling
|
||||
* @param aY y coordinate to add to each point after scaling
|
||||
* @param aCenterX x coordinate of the center point in the original array of points.
|
||||
* @param aCenterY y coordiante of the center point in the original array of points.
|
||||
*/
|
||||
|
||||
static void SetupPoints(PRUint32 aNumberOfPoints, nscoord* aPoints,
|
||||
nsPoint* aPolygon, nscoord aScaleFactor, nscoord aX, nscoord aY,
|
||||
nscoord aCenterX, nscoord aCenterY);
|
||||
|
||||
/**
|
||||
* Paint a fat line. The line is drawn as a polygon with a specified width.
|
||||
*
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aSX starting x in pixels
|
||||
* @param aSY starting y in pixels
|
||||
* @param aEX ending x in pixels
|
||||
* @param aEY ending y in pixels
|
||||
* @param aHorz PR_TRUE if aWidth is added to x coordinates to form polygon. If
|
||||
* PR_FALSE then aWidth as added to the y coordinates.
|
||||
* @param aOnePixel number of twips in a single pixel.
|
||||
*/
|
||||
|
||||
static void PaintLine(nsIRenderingContext& aRenderingContext,
|
||||
nscoord aSX, nscoord aSY, nscoord aEX, nscoord aEY,
|
||||
PRBool aHorz, nscoord aWidth, nscoord aOnePixel);
|
||||
|
||||
/**
|
||||
* Draw an arrow glyph.
|
||||
*
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aSX upper left x coordinate pixels
|
||||
* @param aSY upper left y coordinate pixels
|
||||
* @param aType @see nsArrowDirection enumeration
|
||||
* @param aOnePixel number of twips in a single pixel.
|
||||
*/
|
||||
|
||||
static void PaintArrowGlyph(nsIRenderingContext& aRenderingContext,
|
||||
nscoord aSX, nscoord aSY, nsArrowDirection aArrowDirection,
|
||||
nscoord aOnePixel);
|
||||
|
||||
/**
|
||||
* Draw an arrow
|
||||
*
|
||||
* @param aArrowDirection @see nsArrowDirection enumeration
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aPresContext the presentation context
|
||||
* @param aDirtyRect rectangle requiring update
|
||||
* @param aOnePixel number of TWIPS in a single pixel
|
||||
* @param aColor color of the arrow glph
|
||||
* @param aSpacing spacing for the arrow background
|
||||
* @param aForFrame frame which the arrow will be rendered into.
|
||||
* @param aFrameRect rectangle for the frame specified by aForFrame
|
||||
*/
|
||||
|
||||
static void PaintArrow(nsArrowDirection aArrowDirection,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsRect& aRect,
|
||||
nscoord aOnePixel,
|
||||
const nsStyleColor& aColor,
|
||||
const nsStyleSpacing& aSpacing,
|
||||
nsIFrame* aForFrame,
|
||||
nsRect& aFrameRect);
|
||||
/**
|
||||
* Paint a scrollbar
|
||||
*
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aPresContext the presentation context
|
||||
* @param aDirtyRect rectangle requiring update
|
||||
* @param aRect width and height of the scrollbar
|
||||
* @param aHorizontal if TRUE scrollbar is drawn horizontally, vertical if FALSE
|
||||
* @param aOnePixel number TWIPS per pixel
|
||||
* @param aScrollbarStyleContext style context for the scrollbar
|
||||
* @param aScrollbarArrowStyleContext style context for the scrollbar arrow
|
||||
* @param aForFrame the frame that the scrollbar will be rendered in to
|
||||
* @param aFrameRect the rectangle for the frame passed as aForFrame
|
||||
*/
|
||||
|
||||
static void PaintScrollbar(nsIRenderingContext& aRenderingContext,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsRect& aRect,
|
||||
PRBool aHorizontal,
|
||||
nscoord aOnePixel,
|
||||
nsIStyleContext* aScrollbarStyleContext,
|
||||
nsIStyleContext* aScrollbarArrowStyleContext,
|
||||
nsIFrame* aForFrame,
|
||||
nsRect& aFrameRect);
|
||||
/**
|
||||
* Paint a fixed size checkmark
|
||||
*
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aPixelsToTwips scale factor for convering pixels to twips.
|
||||
*/
|
||||
|
||||
static void PaintFixedSizeCheckMark(nsIRenderingContext& aRenderingContext,
|
||||
float aPixelsToTwips);
|
||||
|
||||
/**
|
||||
* Paint a fixed size checkmark border
|
||||
*
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aPixelsToTwips scale factor for convering pixels to twips.
|
||||
*/
|
||||
|
||||
static void PaintFixedSizeCheckMarkBorder(nsIRenderingContext& aRenderingContext,
|
||||
float aPixelsToTwips);
|
||||
|
||||
/**
|
||||
* Paint a rectangular button. Includes background, string, and focus indicator
|
||||
*
|
||||
* @param aPresContext the presentation context
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aDirtyRect rectangle requiring update
|
||||
* @param aWidth width the checkmark border in TWIPS
|
||||
* @param aHeight height of the checkmark border in TWIPS
|
||||
* @param aShift if PR_TRUE offset button as if it were pressed
|
||||
* @param aShowFocus if PR_TRUE draw focus rectangle over button
|
||||
* @param aStyleContext style context used for drawing button background
|
||||
* @param aLabel label for button
|
||||
* @param aForFrame the frame that the scrollbar will be rendered in to
|
||||
*/
|
||||
|
||||
static void PaintRectangularButton(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect, PRUint32 aWidth,
|
||||
PRUint32 aHeight, PRBool aShift, PRBool aShowFocus,
|
||||
nsIStyleContext* aStyleContext, nsString& aLabel,
|
||||
nsIFrame* aForFrame);
|
||||
/**
|
||||
* Paint a focus indicator.
|
||||
*
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aDirtyRect rectangle requiring update
|
||||
* @param aInside border inside
|
||||
* @param aOutside border outside
|
||||
*/
|
||||
|
||||
static void PaintFocus(nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect, nsRect& aInside, nsRect& aOutside);
|
||||
|
||||
/**
|
||||
* Paint a circular border
|
||||
*
|
||||
* @param aPresContext the presentation context
|
||||
* @param aRenderingContext the rendering context
|
||||
* @param aDirtyRect rectangle requiring update
|
||||
* @param aStyleContext style context specifying colors and spacing
|
||||
* @param aInset if PR_TRUE draw inset, otherwise draw outset
|
||||
* @param aForFrame the frame that the scrollbar will be rendered in to
|
||||
* @param aWidth width of the border in TWIPS
|
||||
* @param aHeight height ofthe border in TWIPS
|
||||
*/
|
||||
|
||||
static void PaintCircularBorder(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect, nsIStyleContext* aStyleContext, PRBool aInset,
|
||||
nsIFrame* aForFrame, PRUint32 aWidth, PRUint32 aHeight);
|
||||
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsFormControlHelper();
|
||||
|
||||
Reference in New Issue
Block a user