CssBox
Represents a CSS Box of text or replaced elements.
Erbt von: CssBoxProperties
Implementiert: IDisposable
Konstruktoren
Eigenschaften
ContainingBlock : CssBox
Gets the containing block-box of this box. (The nearest parent box with display=block)
FirstHostingLineBox : CssLineBox
Gets or sets the first linebox where content of this box appear
HtmlContainer : HtmlContainerInt
Gets the HtmlContainer of the Box. WARNING: May be null.
IsBrElement : bool
Is the box is of "br" element.
IsClickable : bool
Is the css box clickable (by default only "a" element is clickable)
IsFixed : bool
Gets a value indicating whether this instance or one of its parents has Position = fixed.
IsSpaceOrEmpty : bool
Tells if the box is empty or contains just blank spaces
LastHostingLineBox : CssLineBox
Gets or sets the last linebox where content of this box appear
LineBoxes : List<CssLineBox>
Gets the line-boxes of this box (if block box)
ParentLineBoxes : List<CssLineBox>
Gets the linebox(es) that contains words of this box (if inline)
Rectangles : Dictionary<CssLineBox, RRect>
Gets the rectangles where this box should be painted
Methoden
CalculateActualRight() : double
Calculate the actual right of the box by the actual right of the child boxes if this box actual right is not set.
Rückgabe: the calculated actual right value
CreateBlock(CssBox, HtmlTag, CssBox) : CssBox
Create new css block box for the given parent with the given optional html tag and insert it either at the end or before the given optional box. If no html tag is given the box will be anonymous. If no before box is given the new box will be added at the end of parent boxes collection. If before box doesn't exists in parent box exception is thrown.
- parent
- the box to add the new block box to it as child
- tag
- optional: the html tag to define the box
- before
- optional: to insert as specific location in parent box
Rückgabe: the new block box
CreateBox(CssBox, HtmlTag, CssBox) : CssBox
Create new css box for the given parent with the given optional html tag and insert it either at the end or before the given optional box. If no html tag is given the box will be anonymous. If no before box is given the new box will be added at the end of parent boxes collection. If before box doesn't exists in parent box exception is thrown.
- parent
- the box to add the new box to it as child
- tag
- optional: the html tag to define the box
- before
- optional: to insert as specific location in parent box
Rückgabe: the new box
CreateBox(HtmlTag, CssBox) : CssBox
Create new css box for the given parent with the given html tag.
- tag
- the html tag to define the box
- parent
- the box to add the new box to it as child
Rückgabe: the new box
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
FirstWordOccourence(CssBox, CssLineBox) : CssRect
Searches for the first word occurrence inside the box, on the specified linebox
- b
- line
GetAttribute(string, string) : string
Gets the value of the specified attribute of the source HTML tag.
- attribute
- Attribute to retrieve
- defaultValue
- Value to return if attribute is not specified
Rückgabe: Attribute value or defaultValue if no attribute specified
GetAttribute(string) : string
Gets the specified Attribute, returns string.Empty if no attribute specified
- attribute
- Attribute to retrieve
Rückgabe: Attribute value or string.Empty if no attribute specified
GetIndexForList() : int
Gets the index of the box to be used on a (ordered) list
GetMaximumBottom(CssBox, double) : double
Gets the maximum bottom of the boxes inside the startBox
- startBox
- currentMaxBottom
GetMinimumWidth() : double
Gets the minimum width that the box can be. The box can be as thin as the longest word plus padding. The check is deep thru box tree.
Rückgabe: the min width of the box
GetMinimumWidth_LongestWord(CssBox, double, CssRect)
Gets the longest word (in width) inside the box, deeply.
- box
- maxWidth
- maxWidthWord
GetMinMaxSumWords(CssBox, double, double, double, double)
Get the and of the box words content and .
- box
- the box to calculate for
- min
- the width that allows for each word to fit (width of the longest word)
- maxSum
- the max width a single line of words can take without wrapping
- paddingSum
- the total amount of padding the content has
- marginSum
GetMinMaxWidth(double, double)
Get the and width of the box content.
- minWidth
- The minimum width the content must be so it won't overflow (largest word + padding).
- maxWidth
- The total width the content can take without line wrapping (with padding).
GetParent() : CssBoxProperties
Get the parent of this css properties instance.
GetSelectionBackBrush(RGraphics, bool) : RBrush
Get brush for selection background depending if it has external and if alpha is required for images.
- g
- forceAlpha
- used for images so they will have alpha effect
GetSelectionForeBrush() : RColor
Get brush for the text depending if there is selected text color set.
GetWidthMarginDeep(CssBox) : double
Get the total margin value (left and right) from the given box to the given end box.
- box
- the box to start calculation from.
Rückgabe: the total margin
HasJustInlineSiblings() : bool
Gets if this box has only inline siblings (including itself)
InheritStyle(CssBox, bool)
Gets the rectangles where inline box will be drawn. See Remarks for more info.
Rückgabe: Rectangles where content should be placed
MarginBottomCollapse() : double
Gets the result of collapsing the vertical margins of the two boxes
Rückgabe: Resulting bottom margin
MarginTopCollapse(CssBoxProperties) : double
Gets the result of collapsing the vertical margins of the two boxes
- prevSibling
- the previous box under the same parent
Rückgabe: Resulting top margin
OffsetRectangle(CssLineBox, double)
Offsets the rectangle of the specified linebox by the specified gap, and goes deep for rectangles of children in that linebox.
- lineBox
- gap
OnImageLoadComplete(RImage, RRect, bool)
On image load process complete with image request refresh for it to be painted.
- image
- the image loaded or null if failed
- rectangle
- the source rectangle to draw in the image (empty - draw everything)
- async
- is the callback was called async to load image call
PaintBackground(RGraphics, RRect, bool, bool)
Paints the background of the box
- g
- the device to draw into
- rect
- the bounding rectangle to draw in
- isFirst
- is it the first rectangle of the element
- isLast
- is it the last rectangle of the element
PaintDecoration(RGraphics, RRect, bool, bool)
Paints the text decoration (underline/strike-through/over-line)
- g
- the device to draw into
- rectangle
- isFirst
- isLast
PaintWords(RGraphics, RPoint)
Paint all the words in the box.
- g
- the device to draw into
- offset
- the current scroll offset to offset the words
ParseToWords()
Splits the text into words and saves the result
PerformLayout(RGraphics)
Measures the bounds of box and children, recursively. Performs layout of the DOM structure creating lines by set bounds restrictions.
- g
- Device context to use
PerformLayoutImp(RGraphics)
Measures the bounds of box and children, recursively. Performs layout of the DOM structure creating lines by set bounds restrictions.
- g
- Device context to use
RectanglesReset()
Resets the Rectangles array
SetAllBoxes(CssBox)
Move all child boxes from to this box.
- fromBox
- the box to move all its child boxes from
Felder
_htmlContainer : HtmlContainerInt
the root container for the hierarchy
_imageLoadHandler : ImageLoadHandler
handler for loading background image
_parentBox : CssBox
the parent css box of this css box in the hierarchy
_tableFixed : bool
Do not use or alter this flag