Detailed Description

Contains methods for interacting with a CSS class applied to the computed style.

The computed style of a html element. This holds exactly where it should go and how it should look.

Inheritance diagram for PowerUI.Css.ComputedStyle:
PowerUI.Css.Style

Public Member Functions

void ChangeClassProperty (string cssProperty, Css.Value newValue)
 This is called to change a property defined by a css selector that matches the class of this element. The request may be rejected if an ID selector or a style attribute on the element overrides this change. More...
 
void ChangeClassProperty (CssProperty property, Css.Value newValue)
 This is called to change a property defined by a css selector that matches the class of this element. The request may be rejected if an ID selector or a style attribute on the element overrides this change. More...
 
Css.Value GetClassStyle (CssProperty property)
 Gets the CSS property value defined by the class selector for the given property. More...
 
Css.Value GetClassStyle (string property)
 Gets the CSS property value defined by the class selector for the given property. More...
 
void ChangeIDProperty (string cssProperty, Css.Value newValue)
 This is called to change a property defined by a css selector that matches the ID of this element. This change may be rejected if a style attribute on the element overrides this change. More...
 
void ChangeIDProperty (CssProperty property, Css.Value newValue)
 This is called to change a property defined by a css selector that matches the ID of this element. This change may be rejected if a style attribute on the element overrides this change. More...
 
Css.Value GetIDStyle (CssProperty property)
 Gets the CSS property value defined by the ID selector for the given property. More...
 
Css.Value GetIDStyle (string property)
 Gets the CSS property value defined by the ID selector for the given property. More...
 
void ChangeTagProperty (CssProperty property, Css.Value newValue)
 This is called to change a property defined by a css selector that matches the tag of this element. The request may be rejected if a class selector, ID selector or a style attribute on the element overrides this change. More...
 
void ChangeTagProperty (string cssProperty, Css.Value newValue)
 This is called to change a property defined by a css selector that matches the tag of this element. The request may be rejected if a class selector, ID selector or a style attribute on the element overrides this change. More...
 
 ComputedStyle (Element element)
 Creates a new computed style for the given element. More...
 
bool Contains (int x, int y)
 Checks if this element's box contains the given co-ordinates. More...
 
bool TransformedOverlap (ComputedStyle style)
 
void VisibilityNone ()
 
void DisplayNone ()
 
bool BoxOverlap (ComputedStyle style)
 
float GetMidpointX ()
 Gets the position of the midpoint on the x axis. More...
 
float GetMidpointY ()
 Gets the position of the midpoint on the y axis. More...
 
void ParentChanged ()
 Called when the parent of the element was changed. More...
 
bool IsOffset ()
 Checks if this element is offset or positioned. More...
 
float VisiblePercentageX ()
 How much of this elements horizontal content is currently visible? Used by scrolling. More...
 
float VisiblePercentageY ()
 How much of this elements vertical content is currently visible? Used by scrolling. More...
 
bool Hover ()
 Called when the mouse is now over this element. Internally, it simply tacks :hover onto all the selectors this tag uses and reloads, but only if the :hover selector exists. More...
 
void Unhover ()
 Called when the mouse is no longer over this element. This essentially reverses PowerUI.ComputedStyle.Hover. More...
 
bool SetModifier (string modifier)
 Applies the given CSS modifier (e.g. "hover") to this element. Note: Modifier order matters! More...
 
void UnsetModifier (string modifier)
 Unapplies the given CSS modifier (e.g. "hover") to this element. More...
 
bool HasModifier (string modifier)
 Is the named modifier in use on this style? More...
 
void RefreshSelector (SelectorType type)
 Makes this element refetch the style of the given selector. E.g. This is called if an element is loaded before the style tag is. The body element is currently the only one this occurs with. When the style loads, it tells the body tag to refresh itself with this method. More...
 
bool RemoveStyle (string selector, SelectorType type)
 Removes the given style from this computed style. More...
 
bool AddStyle (string selector, SelectorType type)
 Adds the given style from this computed style as a style of the given type. More...
 
void SetSelector (SelectorType type, string value)
 Sets a css selector that will apply to this element (e.g. it's class or id). More...
 
void ChangeParentProperty (CssProperty property, Css.Value newValue)
 Called when a parent object changes its properties. This applies the value only if this element wants to 'inherit' the property. More...
 
Css.Value GetLocalStyle (string property)
 Gets the CSS property value defined by the style="" attribute for the given property. Fully resolved properties only. More...
 
Css.Value GetLocalStyle (CssProperty property)
 Gets the CSS property value defined by the style="" attribute for the given property. More...
 
void ChangeProperty (CssProperty property, Css.Value newValue)
 This is called to change the named property on this element. More...
 
void EnforceNoInline ()
 Inline elements with border/bg colour/bg image should split the properties across multiple lines. This looks pretty ugly and is complex enough that it is instead replaced with enforcing inline-block in this situation. This method enforces inline-block if it's required. More...
 
bool SetupTransform (Css.Value newValue)
 Sets up the PowerUI.ComputedStyle.Transform object if one is needed. More...
 
void ResetScrollbars ()
 Resets the scrollbar elements for this element. More...
 
void SetPixelWidth (bool tellHandler)
 Recalculates the pixel width, padded width and full width of this element. More...
 
void SetPixelHeight (bool tellHandler)
 Recalculates the pixel height, padded height and full height of this element. More...
 
void SetSize ()
 Recalculates the pixel width/height and style offsets. More...
 
void RequestTransform ()
 Requests that this element and all it's kids are retransformed. Transforming is a post process, so this is like calling for a paint. More...
 
void RequestLayout ()
 Requests that the renderer performs a layout on the next update. Note that layouts are more expensive than a paint. Paints simply update vertex colours and uvs where as layouts rebuild the whole mesh. More...
 
void SetParentDimension (int dimension, bool isWidth, ComputedStyle parent)
 Called when either height or width of the parent element changes. This is used to convert % into actual pixels and may recurse to it's children. More...
 
void Repaint ()
 Repaints this element at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values. A paint is less intensive than a layout as it only updates the uv/vert colours of the mesh. More...
 
void WentOffScreen ()
 
void Render ()
 Draws this at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values. More...
 
ShaderData RequireShading ()
 Requires a shading data block on this computed style. More...
 
- Public Member Functions inherited from PowerUI.Css.Style
 Style (Element element)
 Creates a new style for the given element. More...
 
 Style ()
 Creates a new, empty style definition. More...
 
 Style (string text)
 Creates a new style with the given css text string seperated by semicolons. More...
 
void SetDirect (string property, string value)
 Directly sets the named property to the given value. Note that this does not refresh the style onscreen in anyway - it simply writes the new property value. Internal to the layout engine only. More...
 
Value Get (string cssProperty)
 Gets the value of the given property, if any. More...
 
void Set (string property, string value)
 Sets the named property on this style to the given value. More...
 
virtual ComputedStyle GetComputed ()
 Gets the computed form of this style. More...
 
Css.Value GetRawValue (CssProperty property, ValueType type)
 Gets or creates the base value for the given property. The base value is essentially the value held directly in this style sheet. E.g. if the value you're setting is the R channel of color-overlay, this sets up the color-overlay value for you. More...
 
virtual void OnChanged (CssProperty property, Value newValue)
 called when the named property changes. More...
 
virtual string GetString (string cssProperty, int innerIndex)
 Gets the given property as a css string. May optionally read the given inner index of it as a css string. More...
 
virtual string GetString (string cssProperty)
 Gets the given property as a css string. More...
 

Public Attributes

bool Clip =true
 Should this element be clipped at all? More...
 
float ZIndex
 The depth of this element. More...
 
float FixedZIndex
 The depth of this element if it has defined a fixed z-index value. More...
 
int OffsetTop
 The global offset from the top edge. Computed in secondary layout pass. More...
 
int OffsetLeft
 The global offset from the left edge. Computed in secondary layout pass. More...
 
int PixelWidth
 The total width in pixels of this element. More...
 
int PixelHeight
 The total height in pixels of this element. More...
 
int InnerWidth
 The width of this element excluding any padding/border or margins. More...
 
int InnerHeight
 The height of this element excluding any padding/border or margins. More...
 
bool FixedDepth
 True if depth is fixed for this element with e.g. z-index:10. More...
 
bool FixedWidth
 True if width is fixed for this element with e.g. width:200px. More...
 
bool FixedHeight
 True if height is fixed for this element with e.g. height:100px. More...
 
int ParentOffsetTop
 The local offset of this element relative to it's parents top edge. Computed in primary layout pass. More...
 
int ParentOffsetLeft
 The local offset of this element relative to it's parents left edge. Computed in primary layout pass. More...
 
int ContentWidth
 The width of content in this element. More...
 
int ContentHeight
 The height of the content in this element. More...
 
int BorderTop
 The width of the border at the top in pixels. More...
 
int BorderLeft
 The width of the border on the left in pixels. More...
 
Transformation Transform
 Defines how this element should be transformed. Transforms are a post-process; They are applied after everything else. More...
 
Color ColorOverlay =Color.white
 A colour that is applied over the top of this element. More...
 
int PaddedWidth
 The width of this element including it's padding. More...
 
int PaddedHeight
 The height of this element including it's padding. More...
 
int ScrollTop
 The amount of pixels the content of this element is scrolled vertically. More...
 
int ScrollLeft
 The amount of pixels the content of this element is scrolled horizontally. More...
 
int StyleOffsetTop
 The content offset from the top for this element caused by padding, margin and the border in pixels. More...
 
int StyleOffsetLeft
 The content offset from the left for this element caused by padding, margin and the border in pixels. More...
 
int MarginTop
 The size of the margin on the top of this element in pixels. More...
 
int MarginLeft
 The size of the margin on the left of this element in pixels. More...
 
int MarginRight
 The size of the margin on the right of this element in pixels. More...
 
int MarginBottom
 The size of the margin on the bottom of this element in pixels. More...
 
int PaddingTop
 The amount of padding on the top of this element in pixels. More...
 
int PaddingLeft
 The amount of padding on the left of this element in pixels. More...
 
int PaddingRight
 The amount of padding on the right of this element in pixels. More...
 
int PaddingBottom
 The amount of padding on the bottom of this element in pixels. More...
 
bool AutoMarginX
 True if the elements left/right margins are auto. More...
 
bool AutoMarginY
 True if the elements top/bottom margins are auto. More...
 
int Baseline
 The position of the baseline in pixels. More...
 
int PositionTop
 The value of the top: css property. More...
 
int PositionLeft
 The value of the left: css property. More...
 
int PositionRight
 The value of the right: css property. More...
 
int PositionBottom
 The value of the bottom: css property. More...
 
bool RightPositioned
 True if PositionRight active. More...
 
bool BottomPositioned
 True if PositionBottom active. More...
 
ComputedStyle NextPacked
 When being rendered, a linked list of computed styles being 'packed' into a parent element is built up. NextPacked is the one that was packed after this element. More...
 
ComputedStyle NextOnLine
 When being rendered, a linked list of computed styles on this line is built up. This is the next one on this line. More...
 
DisplayType Display =DisplayType.Inline
 Defines the display of this element. More...
 
PositionType Position =PositionType.Relative
 Defines the position of this element. More...
 
WhiteSpaceType WhiteSpace =WhiteSpaceType.Normal
 Defines if the content of this element should wrap automatically or not. More...
 
VisibilityType Visibility =VisibilityType.Visible
 Defines the visibility of this element. More...
 
VerticalAlignType VerticalAlign =VerticalAlignType.Top
 Defines how content within this element should be aligned vertically. More...
 
HorizontalAlignType HorizontalAlign =HorizontalAlignType.Auto
 Defines how content within this element should be aligned horizontally. More...
 
HorizontalAlignType HorizontalAlignLast =HorizontalAlignType.Auto
 Defines how the last line of content within this element should be aligned horizontally. More...
 
BorderProperty Border
 This handles rendering the border around this element, if any. More...
 
BackgroundImage BGImage
 This handles rendering a tiled, clipped, offset background image for this element. More...
 
BackgroundColour BGColour
 This handles rendering a solid background colour for this element. More...
 
TextRenderingProperty Text
 This handles rendering text contained by this element. More...
 
int FullHeight
 The full height of this element. May be depreciated; see PowerUI.ComputedStyle.PixelHeight. More...
 
int FullWidth
 The full width of this element. May be depreciated; see PowerUI.ComputedStyle.PixelWidth. More...
 
string IDSelector
 The ID css selector for this element if any. It's the value within the id="" attribute with a "#" at the start. More...
 
string TagSelector
 The tag css selector for this element. This is always the elements tag, e.g. "div". More...
 
string ClassSelector
 The class css selector for this element if any. It's the value within the class="" attribute with a "." at the start. If there are more than one, this is the last one. More...
 
string[] ExtraClassSelectors
 The set of additional class selectors (since there can be more than one). Each entry has a "." at the start. More...
 
int MaximumWidth =int.MaxValue
 The maximum width of the content in pixels. More...
 
int MaximumHeight =int.MaxValue
 The maximum height of the content in pixels. More...
 
int MinimumWidth =int.MinValue
 The minimum width of the content in pixels. More...
 
int MinimumHeight =int.MinValue
 The minimum height of the content in pixels. More...
 
OverflowType OverflowX =OverflowType.Visible
 Defines how horizontally overflowing content is treated. Visible by default. Only applicable to block/inline-block elements. More...
 
OverflowType OverflowY =OverflowType.Visible
 Defines how vertically overflowing content is treated. Visible by default. Only applicable to block/inline-block elements. More...
 
DirectionType DrawDirection =DirectionType.LTR
 The direction of rendering. This is used for managing arabic languages and others (i.e by inverting the direction). More...
 
FloatType Float =FloatType.None
 The float state of this element. More...
 
ShaderData Shading
 The shading information for this style. Stores shadow, stroke/glow, lighting and more. More...
 
- Public Attributes inherited from PowerUI.Css.Style
Element Element
 The element that this style belongs to, if any. More...
 
Dictionary< CssProperty, ValueProperties =new Dictionary<CssProperty,Value>()
 The mapping of css property (e.g. display) to value ("none" as a PowerUI.Css.Value). More...
 

Protected Member Functions

void ApplyTransform ()
 Applies the transform (rotate, scale etc) of this element to its background/border/content. More...
 

Properties

int EndSpaceSize [get]
 The width in pixels of the last whitespace of this element, if it's got one. More...
 
bool HasBackground [get]
 True if this element has some form of background applied to it. More...
 
ShadowData TextShadow [get, set]
 The text shadow for this computed style. More...
 
StrokeData TextStroke [get, set]
 The text shadow for this computed style. More...
 
- Properties inherited from PowerUI.Css.Style
string cssText [set]
 Sets the css text of this style as a css string seperated by semicolons (;). More...
 
Value this[string cssProperty] [get, set]
 Gets or sets the parsed value of this style by property name. More...
 
Value this[CssProperty property] [get, set]
 Gets or sets the parsed value of this style by property name. More...
 

Private Member Functions

bool SetModifier (SelectorType type, string selector, string modifier)
 Called when the mouse is now over this element. More...
 
bool SetModifier (SelectorType type, string selector, string modifier, int innerIndex)
 Called when the mouse is now over this element. More...
 
void UnsetClassModifier (string modifier)
 Called to unset a class :modifier when multiple classes are in use. More...
 
void UnsetModifier (SelectorType type, string selector, string modifier)
 Called when the mouse is no longer over this element. More...
 
bool NeedsScrollbar (OverflowType type)
 Checks if the given overflow type requires a scrollbar. More...
 
InputTag MakeScrollbar (bool horizontal)
 Generates a new scrollbar with the given orientation. More...
 

Additional Inherited Members

- Static Public Attributes inherited from PowerUI.Css.Style
static char[] Delimiter =new char[]{':'}
 The delimiter that seperates the property name from its value in css. More...
 

Constructor & Destructor Documentation

PowerUI.Css.ComputedStyle.ComputedStyle ( Element  element)
inline

Creates a new computed style for the given element.

Parameters
elementThe element that this is a computed style for.

Member Function Documentation

bool PowerUI.Css.ComputedStyle.AddStyle ( string  selector,
SelectorType  type 
)
inline

Adds the given style from this computed style as a style of the given type.

Parameters
selectorThe style to add.
typeThe type of style that it is.
void PowerUI.Css.ComputedStyle.ApplyTransform ( )
inlineprotected

Applies the transform (rotate, scale etc) of this element to its background/border/content.

bool PowerUI.Css.ComputedStyle.BoxOverlap ( ComputedStyle  style)
inline
void PowerUI.Css.ComputedStyle.ChangeClassProperty ( string  cssProperty,
Css.Value  newValue 
)
inline

This is called to change a property defined by a css selector that matches the class of this element. The request may be rejected if an ID selector or a style attribute on the element overrides this change.

Parameters
cssPropertyThe css property being changed.
newValueThe new property value.
void PowerUI.Css.ComputedStyle.ChangeClassProperty ( CssProperty  property,
Css.Value  newValue 
)
inline

This is called to change a property defined by a css selector that matches the class of this element. The request may be rejected if an ID selector or a style attribute on the element overrides this change.

Parameters
propertyThe css property being changed.
newValueThe new property value.
void PowerUI.Css.ComputedStyle.ChangeIDProperty ( string  cssProperty,
Css.Value  newValue 
)
inline

This is called to change a property defined by a css selector that matches the ID of this element. This change may be rejected if a style attribute on the element overrides this change.

Parameters
cssPropertyThe css property being changed.
newValueThe new property value.
void PowerUI.Css.ComputedStyle.ChangeIDProperty ( CssProperty  property,
Css.Value  newValue 
)
inline

This is called to change a property defined by a css selector that matches the ID of this element. This change may be rejected if a style attribute on the element overrides this change.

Parameters
propertyThe css property being changed.
newValueThe new property value.
void PowerUI.Css.ComputedStyle.ChangeParentProperty ( CssProperty  property,
Css.Value  newValue 
)
inline

Called when a parent object changes its properties. This applies the value only if this element wants to 'inherit' the property.

Parameters
propertyThe css property being changed.
newValueThe new property value.
void PowerUI.Css.ComputedStyle.ChangeProperty ( CssProperty  property,
Css.Value  newValue 
)
inline

This is called to change the named property on this element.

Parameters
propertyThe css property being changed.
newValueThe new property value.
void PowerUI.Css.ComputedStyle.ChangeTagProperty ( CssProperty  property,
Css.Value  newValue 
)
inline

This is called to change a property defined by a css selector that matches the tag of this element. The request may be rejected if a class selector, ID selector or a style attribute on the element overrides this change.

Parameters
propertyThe css property being changed.
newValueThe new property value.
void PowerUI.Css.ComputedStyle.ChangeTagProperty ( string  cssProperty,
Css.Value  newValue 
)
inline

This is called to change a property defined by a css selector that matches the tag of this element. The request may be rejected if a class selector, ID selector or a style attribute on the element overrides this change.

Parameters
cssPropertyThe css property being changed.
newValueThe new property value.
bool PowerUI.Css.ComputedStyle.Contains ( int  x,
int  y 
)
inline

Checks if this element's box contains the given co-ordinates.

Parameters
xThe x coordinate to check.
yThe y coordinate to check.
Returns
True if the bounding box of this element contains the coordinate.
void PowerUI.Css.ComputedStyle.DisplayNone ( )
inline
void PowerUI.Css.ComputedStyle.EnforceNoInline ( )
inline

Inline elements with border/bg colour/bg image should split the properties across multiple lines. This looks pretty ugly and is complex enough that it is instead replaced with enforcing inline-block in this situation. This method enforces inline-block if it's required.

Css.Value PowerUI.Css.ComputedStyle.GetClassStyle ( CssProperty  property)
inline

Gets the CSS property value defined by the class selector for the given property.

Parameters
propertyThe CSS property to get the value for.
Css.Value PowerUI.Css.ComputedStyle.GetClassStyle ( string  property)
inline

Gets the CSS property value defined by the class selector for the given property.

Parameters
propertyThe CSS property to get the value for.
Css.Value PowerUI.Css.ComputedStyle.GetIDStyle ( CssProperty  property)
inline

Gets the CSS property value defined by the ID selector for the given property.

Parameters
propertyThe CSS property to get the value for.
Css.Value PowerUI.Css.ComputedStyle.GetIDStyle ( string  property)
inline

Gets the CSS property value defined by the ID selector for the given property.

Parameters
propertyThe CSS property to get the value for.
Css.Value PowerUI.Css.ComputedStyle.GetLocalStyle ( string  property)
inline

Gets the CSS property value defined by the style="" attribute for the given property. Fully resolved properties only.

Parameters
propertyThe CSS property to get the value for.
Css.Value PowerUI.Css.ComputedStyle.GetLocalStyle ( CssProperty  property)
inline

Gets the CSS property value defined by the style="" attribute for the given property.

Parameters
propertyThe CSS property to get the value for.
float PowerUI.Css.ComputedStyle.GetMidpointX ( )
inline

Gets the position of the midpoint on the x axis.

float PowerUI.Css.ComputedStyle.GetMidpointY ( )
inline

Gets the position of the midpoint on the y axis.

bool PowerUI.Css.ComputedStyle.HasModifier ( string  modifier)
inline

Is the named modifier in use on this style?

Parameters
modifierThe modifier, e.g. "hover".
Returns
True if the modifier was detected.
bool PowerUI.Css.ComputedStyle.Hover ( )
inline

Called when the mouse is now over this element. Internally, it simply tacks :hover onto all the selectors this tag uses and reloads, but only if the :hover selector exists.

bool PowerUI.Css.ComputedStyle.IsOffset ( )
inline

Checks if this element is offset or positioned.

Returns
True if this element is offset/positioned in any way.
InputTag PowerUI.Css.ComputedStyle.MakeScrollbar ( bool  horizontal)
inlineprivate

Generates a new scrollbar with the given orientation.

Parameters
horizontalTrue for a horizontal scrollbar, false for vertical.
bool PowerUI.Css.ComputedStyle.NeedsScrollbar ( OverflowType  type)
inlineprivate

Checks if the given overflow type requires a scrollbar.

Parameters
typeThe overflow type to check.
Returns
True if it's auto or scroll; false otherwise.
void PowerUI.Css.ComputedStyle.ParentChanged ( )
inline

Called when the parent of the element was changed.

void PowerUI.Css.ComputedStyle.RefreshSelector ( SelectorType  type)
inline

Makes this element refetch the style of the given selector. E.g. This is called if an element is loaded before the style tag is. The body element is currently the only one this occurs with. When the style loads, it tells the body tag to refresh itself with this method.

Parameters
typeThe type of selector to refetch.
bool PowerUI.Css.ComputedStyle.RemoveStyle ( string  selector,
SelectorType  type 
)
inline

Removes the given style from this computed style.

Parameters
selectorThe style to remove.
typeThe type of style that it is.
void PowerUI.Css.ComputedStyle.Render ( )
inline

Draws this at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values.

void PowerUI.Css.ComputedStyle.Repaint ( )
inline

Repaints this element at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values. A paint is less intensive than a layout as it only updates the uv/vert colours of the mesh.

void PowerUI.Css.ComputedStyle.RequestLayout ( )
inline

Requests that the renderer performs a layout on the next update. Note that layouts are more expensive than a paint. Paints simply update vertex colours and uvs where as layouts rebuild the whole mesh.

void PowerUI.Css.ComputedStyle.RequestTransform ( )
inline

Requests that this element and all it's kids are retransformed. Transforming is a post process, so this is like calling for a paint.

ShaderData PowerUI.Css.ComputedStyle.RequireShading ( )
inline

Requires a shading data block on this computed style.

void PowerUI.Css.ComputedStyle.ResetScrollbars ( )
inline

Resets the scrollbar elements for this element.

bool PowerUI.Css.ComputedStyle.SetModifier ( string  modifier)
inline

Applies the given CSS modifier (e.g. "hover") to this element. Note: Modifier order matters!

Parameters
modifierThe modifier to apply.
Returns
True if the modifier was found and applied.
bool PowerUI.Css.ComputedStyle.SetModifier ( SelectorType  type,
string  selector,
string  modifier 
)
inlineprivate

Called when the mouse is now over this element.

Parameters
typeThe selector to hover.
selectorThe selector's current value. Should not end in :hover.
bool PowerUI.Css.ComputedStyle.SetModifier ( SelectorType  type,
string  selector,
string  modifier,
int  innerIndex 
)
inlineprivate

Called when the mouse is now over this element.

Parameters
typeThe selector to hover.
selectorThe selector's current value. Should not end in :hover.
innerIndexThe selector index in ExtraClassSelectors, if any.
void PowerUI.Css.ComputedStyle.SetParentDimension ( int  dimension,
bool  isWidth,
ComputedStyle  parent 
)
inline

Called when either height or width of the parent element changes. This is used to convert % into actual pixels and may recurse to it's children.

Parameters
dimensionThe new value of the width/height in pixels.
isWidthTrue if width is what changed and the dimension is width.
parentThe parents computed style that has changed.
void PowerUI.Css.ComputedStyle.SetPixelHeight ( bool  tellHandler)
inline

Recalculates the pixel height, padded height and full height of this element.

Parameters
tellHandlerTrue if the Handler should be told the height changed.
void PowerUI.Css.ComputedStyle.SetPixelWidth ( bool  tellHandler)
inline

Recalculates the pixel width, padded width and full width of this element.

Parameters
tellHandlerTrue if the Handler should be told the width changed.
void PowerUI.Css.ComputedStyle.SetSelector ( SelectorType  type,
string  value 
)
inline

Sets a css selector that will apply to this element (e.g. it's class or id).

Parameters
typeThe type of the selector being applied.
valueThe selector value/ name to use. Note this is just the name; no # etc.
void PowerUI.Css.ComputedStyle.SetSize ( )
inline

Recalculates the pixel width/height and style offsets.

bool PowerUI.Css.ComputedStyle.SetupTransform ( Css.Value  newValue)
inline

Sets up the PowerUI.ComputedStyle.Transform object if one is needed.

Parameters
newValueIf this value is null, no transform will be created as it's not needed.
Returns
True if transform is set.
bool PowerUI.Css.ComputedStyle.TransformedOverlap ( ComputedStyle  style)
inline
void PowerUI.Css.ComputedStyle.Unhover ( )
inline

Called when the mouse is no longer over this element. This essentially reverses PowerUI.ComputedStyle.Hover.

void PowerUI.Css.ComputedStyle.UnsetClassModifier ( string  modifier)
inlineprivate

Called to unset a class :modifier when multiple classes are in use.

Parameters
modifier":aModifier" e.g. ":hover".
void PowerUI.Css.ComputedStyle.UnsetModifier ( string  modifier)
inline

Unapplies the given CSS modifier (e.g. "hover") to this element.

Parameters
modifierThe modifier to apply.
void PowerUI.Css.ComputedStyle.UnsetModifier ( SelectorType  type,
string  selector,
string  modifier 
)
inlineprivate

Called when the mouse is no longer over this element.

Parameters
typeThe selector to unhover.
selectorThe selector's current value. Should end in ":aModifier".
void PowerUI.Css.ComputedStyle.VisibilityNone ( )
inline
float PowerUI.Css.ComputedStyle.VisiblePercentageX ( )
inline

How much of this elements horizontal content is currently visible? Used by scrolling.

Returns
A value from 0-1 of how much of the horizontal content is visible. 1 is all of it.
float PowerUI.Css.ComputedStyle.VisiblePercentageY ( )
inline

How much of this elements vertical content is currently visible? Used by scrolling.

Returns
A value from 0-1 of how much of the vertical content is visible. 1 is all of it.
void PowerUI.Css.ComputedStyle.WentOffScreen ( )
inline

Member Data Documentation

bool PowerUI.Css.ComputedStyle.AutoMarginX

True if the elements left/right margins are auto.

bool PowerUI.Css.ComputedStyle.AutoMarginY

True if the elements top/bottom margins are auto.

int PowerUI.Css.ComputedStyle.Baseline

The position of the baseline in pixels.

BackgroundColour PowerUI.Css.ComputedStyle.BGColour

This handles rendering a solid background colour for this element.

BackgroundImage PowerUI.Css.ComputedStyle.BGImage

This handles rendering a tiled, clipped, offset background image for this element.

BorderProperty PowerUI.Css.ComputedStyle.Border

This handles rendering the border around this element, if any.

int PowerUI.Css.ComputedStyle.BorderLeft

The width of the border on the left in pixels.

int PowerUI.Css.ComputedStyle.BorderTop

The width of the border at the top in pixels.

bool PowerUI.Css.ComputedStyle.BottomPositioned

True if PositionBottom active.

string PowerUI.Css.ComputedStyle.ClassSelector

The class css selector for this element if any. It's the value within the class="" attribute with a "." at the start. If there are more than one, this is the last one.

bool PowerUI.Css.ComputedStyle.Clip =true

Should this element be clipped at all?

Color PowerUI.Css.ComputedStyle.ColorOverlay =Color.white

A colour that is applied over the top of this element.

int PowerUI.Css.ComputedStyle.ContentHeight

The height of the content in this element.

int PowerUI.Css.ComputedStyle.ContentWidth

The width of content in this element.

DisplayType PowerUI.Css.ComputedStyle.Display =DisplayType.Inline

Defines the display of this element.

DirectionType PowerUI.Css.ComputedStyle.DrawDirection =DirectionType.LTR

The direction of rendering. This is used for managing arabic languages and others (i.e by inverting the direction).

string [] PowerUI.Css.ComputedStyle.ExtraClassSelectors

The set of additional class selectors (since there can be more than one). Each entry has a "." at the start.

bool PowerUI.Css.ComputedStyle.FixedDepth

True if depth is fixed for this element with e.g. z-index:10.

bool PowerUI.Css.ComputedStyle.FixedHeight

True if height is fixed for this element with e.g. height:100px.

bool PowerUI.Css.ComputedStyle.FixedWidth

True if width is fixed for this element with e.g. width:200px.

float PowerUI.Css.ComputedStyle.FixedZIndex

The depth of this element if it has defined a fixed z-index value.

FloatType PowerUI.Css.ComputedStyle.Float =FloatType.None

The float state of this element.

int PowerUI.Css.ComputedStyle.FullHeight

The full height of this element. May be depreciated; see PowerUI.ComputedStyle.PixelHeight.

int PowerUI.Css.ComputedStyle.FullWidth

The full width of this element. May be depreciated; see PowerUI.ComputedStyle.PixelWidth.

HorizontalAlignType PowerUI.Css.ComputedStyle.HorizontalAlign =HorizontalAlignType.Auto

Defines how content within this element should be aligned horizontally.

HorizontalAlignType PowerUI.Css.ComputedStyle.HorizontalAlignLast =HorizontalAlignType.Auto

Defines how the last line of content within this element should be aligned horizontally.

string PowerUI.Css.ComputedStyle.IDSelector

The ID css selector for this element if any. It's the value within the id="" attribute with a "#" at the start.

int PowerUI.Css.ComputedStyle.InnerHeight

The height of this element excluding any padding/border or margins.

int PowerUI.Css.ComputedStyle.InnerWidth

The width of this element excluding any padding/border or margins.

int PowerUI.Css.ComputedStyle.MarginBottom

The size of the margin on the bottom of this element in pixels.

int PowerUI.Css.ComputedStyle.MarginLeft

The size of the margin on the left of this element in pixels.

int PowerUI.Css.ComputedStyle.MarginRight

The size of the margin on the right of this element in pixels.

int PowerUI.Css.ComputedStyle.MarginTop

The size of the margin on the top of this element in pixels.

int PowerUI.Css.ComputedStyle.MaximumHeight =int.MaxValue

The maximum height of the content in pixels.

int PowerUI.Css.ComputedStyle.MaximumWidth =int.MaxValue

The maximum width of the content in pixels.

int PowerUI.Css.ComputedStyle.MinimumHeight =int.MinValue

The minimum height of the content in pixels.

int PowerUI.Css.ComputedStyle.MinimumWidth =int.MinValue

The minimum width of the content in pixels.

ComputedStyle PowerUI.Css.ComputedStyle.NextOnLine

When being rendered, a linked list of computed styles on this line is built up. This is the next one on this line.

ComputedStyle PowerUI.Css.ComputedStyle.NextPacked

When being rendered, a linked list of computed styles being 'packed' into a parent element is built up. NextPacked is the one that was packed after this element.

int PowerUI.Css.ComputedStyle.OffsetLeft

The global offset from the left edge. Computed in secondary layout pass.

int PowerUI.Css.ComputedStyle.OffsetTop

The global offset from the top edge. Computed in secondary layout pass.

OverflowType PowerUI.Css.ComputedStyle.OverflowX =OverflowType.Visible

Defines how horizontally overflowing content is treated. Visible by default. Only applicable to block/inline-block elements.

OverflowType PowerUI.Css.ComputedStyle.OverflowY =OverflowType.Visible

Defines how vertically overflowing content is treated. Visible by default. Only applicable to block/inline-block elements.

int PowerUI.Css.ComputedStyle.PaddedHeight

The height of this element including it's padding.

int PowerUI.Css.ComputedStyle.PaddedWidth

The width of this element including it's padding.

int PowerUI.Css.ComputedStyle.PaddingBottom

The amount of padding on the bottom of this element in pixels.

int PowerUI.Css.ComputedStyle.PaddingLeft

The amount of padding on the left of this element in pixels.

int PowerUI.Css.ComputedStyle.PaddingRight

The amount of padding on the right of this element in pixels.

int PowerUI.Css.ComputedStyle.PaddingTop

The amount of padding on the top of this element in pixels.

int PowerUI.Css.ComputedStyle.ParentOffsetLeft

The local offset of this element relative to it's parents left edge. Computed in primary layout pass.

int PowerUI.Css.ComputedStyle.ParentOffsetTop

The local offset of this element relative to it's parents top edge. Computed in primary layout pass.

int PowerUI.Css.ComputedStyle.PixelHeight

The total height in pixels of this element.

int PowerUI.Css.ComputedStyle.PixelWidth

The total width in pixels of this element.

PositionType PowerUI.Css.ComputedStyle.Position =PositionType.Relative

Defines the position of this element.

int PowerUI.Css.ComputedStyle.PositionBottom

The value of the bottom: css property.

int PowerUI.Css.ComputedStyle.PositionLeft

The value of the left: css property.

int PowerUI.Css.ComputedStyle.PositionRight

The value of the right: css property.

int PowerUI.Css.ComputedStyle.PositionTop

The value of the top: css property.

bool PowerUI.Css.ComputedStyle.RightPositioned

True if PositionRight active.

int PowerUI.Css.ComputedStyle.ScrollLeft

The amount of pixels the content of this element is scrolled horizontally.

int PowerUI.Css.ComputedStyle.ScrollTop

The amount of pixels the content of this element is scrolled vertically.

ShaderData PowerUI.Css.ComputedStyle.Shading

The shading information for this style. Stores shadow, stroke/glow, lighting and more.

int PowerUI.Css.ComputedStyle.StyleOffsetLeft

The content offset from the left for this element caused by padding, margin and the border in pixels.

int PowerUI.Css.ComputedStyle.StyleOffsetTop

The content offset from the top for this element caused by padding, margin and the border in pixels.

string PowerUI.Css.ComputedStyle.TagSelector

The tag css selector for this element. This is always the elements tag, e.g. "div".

TextRenderingProperty PowerUI.Css.ComputedStyle.Text

This handles rendering text contained by this element.

Transformation PowerUI.Css.ComputedStyle.Transform

Defines how this element should be transformed. Transforms are a post-process; They are applied after everything else.

VerticalAlignType PowerUI.Css.ComputedStyle.VerticalAlign =VerticalAlignType.Top

Defines how content within this element should be aligned vertically.

VisibilityType PowerUI.Css.ComputedStyle.Visibility =VisibilityType.Visible

Defines the visibility of this element.

WhiteSpaceType PowerUI.Css.ComputedStyle.WhiteSpace =WhiteSpaceType.Normal

Defines if the content of this element should wrap automatically or not.

float PowerUI.Css.ComputedStyle.ZIndex

The depth of this element.

Property Documentation

int PowerUI.Css.ComputedStyle.EndSpaceSize
get

The width in pixels of the last whitespace of this element, if it's got one.

bool PowerUI.Css.ComputedStyle.HasBackground
get

True if this element has some form of background applied to it.

ShadowData PowerUI.Css.ComputedStyle.TextShadow
getset

The text shadow for this computed style.

StrokeData PowerUI.Css.ComputedStyle.TextStroke
getset

The text shadow for this computed style.