|
// STYLES
function SDX_Styles()
{
this.StyleClass = StyleClass ;
this.FontClass = FontClass ;
this.AlternatingItemStyle = new StyleClass() ;
this.EditItemStyle = new StyleClass() ;
this.Style = new StyleClass() ;
this.FooterStyle = new StyleClass() ;
this.HeaderStyle = new StyleClass() ;
this.ItemStyle = new StyleClass() ;
this.PagerStyle = new StyleClass() ;
this.SelectedItemStyle = new StyleClass() ;
this.GroupByTableStyle = new StyleClass() ;
this.GroupByTableItemStyle = new StyleClass() ;
this.GroupByItemStyle = new StyleClass() ;
this.SelectorItemStyle = new StyleClass() ;
this.NavigatorStyle = new StyleClass() ;
this.SearchStyle = new StyleClass() ;
this.GetStyleHTML = GetStyleHTML ;
this.GetFontHTML = GetFontHTML ;
this.SetFont = SetFont ;
this.RemoveFonts = RemoveFonts ;
function RemoveFonts(_StyleObject)
{
_StyleObject.fontWeight = '' ;
_StyleObject.fontSTYLE = '' ;
_StyleObject.fontSize = '' ;
_StyleObject.textDecorationOverline = '' ;
_StyleObject.textDecorationLineThrough = '' ;
_StyleObject.textDecorationUnderline = '' ;
_StyleObject.color = '' ;
_StyleObject.borderStyle = '' ;
_StyleObject.backgroundColor = '' ;
_StyleObject.backgroundColor = '' ;
_StyleObject.fontFamily = '' ;
}
function SetFont(_StyleObject,_Style)
{
if(_Style.Font.Bold)
_StyleObject.fontWeight = 'bold' ;
if(_Style.Font.Italic)
_StyleObject.fontSTYLE = 'italic' ;
if(_Style.Font.Size)
_StyleObject.fontSize = _Font.Size ;
if(_Style.Font.Overline)
_StyleObject.textDecorationOverline = _Font.Overline ;
if(_Style.Font.Strikeout)
_StyleObject.textDecorationLineThrough = _Font.Strikeout ;
if(_Style.Font.Underline)
_StyleObject.textDecorationUnderline = _Font.Underline ;
if(_Style.Font.ForeColor)
_StyleObject.color = _Font.ForeColor ;
if(_Style.Font.BorderStyle)
_StyleObject.borderStyle = _Font.BorderStyle ;
if(_Style.BackColor)
_StyleObject.backgroundColor = _Style.BackColor ;
if(_Style.Font.Names!=null)
_StyleObject.fontFamily = _Style.Font.Names;
}
function GetFontHTML(_Style,_Font)
{
return "STYLE=\"" +
(_Font.Bold?"font-weight: bold;":"") +
(_Font.Italic?"FONT-STYLE: italic;":"") +
(_Font.Size!=null?"FONT-SIZE: " + _Font.Size + "pt;":"") +
((_Font.Overline || _Font.Strikeout || _Font.Underline)?"TEXT-DECORATION: ":"") +
(_Font.Overline?"overline ":"") +
(_Font.Strikeout?"line-through ":"") +
(_Font.Underline?"underline ":"") +
((_Font.Overline || _Font.Strikeout || _Font.Underline)?";":"") +
(_Font.Names!=null?"font-family:" + _Font.Names + ";":"") +
(_Style.ForeColor!=null?" COLOR:" + _Style.ForeColor + "; ":"") +
(_Style.BorderStyle!=null?" border-style:" + _Style.BorderStyle + "; ":"") +
(_Style.BackColor!=null?" background-color:" + _Style.BackColor + "; ":"") +
" border-collapse:collapse;" +
"\"" ;
}
function GetStyleHTML(_Style)
{
return (_Style.BorderColor!=null?" borderColor=\"" + _Style.BorderColor + "\" ":"") +
(_Style.BorderWidth!=null?" Border=\"" + _Style.BorderWidth + "\" ":"") +
(_Style.CssClass!=null?" Class=\"" + _Style.CssClass + "\" ":"") +
this.GetFontHTML(_Style,_Style.Font) +
(_Style.Height!=null?" Height=\"" + _Style.Height + "\" ":"") +
(_Style.HorizontalAlign!=null?" HorizontalAlign=\"" + _Style.HorizontalAlign + "\" ":"") +
(_Style.VerticalAlign!=null?" VerticalAlign=\"" + _Style.VerticalAlign + "\" ":"") +
(_Style.Width!=null?" Width=\"" + _Style.Width + "\"":"") +
(_Style.GridLines!=null?" rules=\"" + _Style.GridLines + "\" ":"") +
(_Style.CellSpacing!=null?" CellSpacing=\"" + _Style.CellSpacing + "\"":"") +
(_Style.CellPadding!=null?" CellPadding=\"" + _Style.CellPadding + "\" ":"") +
(_Style.Wrap?" noWrap ":"") ;
}
// FONT
function FontClass()
{
this.Bold = false ;
this.Italic = false ;
this.Names = null ;
this.Overline = false ;
this.Size = null ;
this.Strikeout = false ;
this.Underline = false ;
}
// STYLE
function StyleClass()
{
this.BackColor = null ;
this.BorderColor = null ;
this.BorderStyle = null ;
this.BorderWidth = null ;
this.CssClass = null ;
this.Font = new FontClass() ;
this.ForeColor = null ;
this.Height = null ;
this.HorizontalAlign = null ;
this.VerticalAlign = null ;
this.Width = null ;
this.Wrap = true
this.CellSpacing = null ;
this.CellPadding = null ;
this.GridLines = 'none' ; // none None horizontal Cols vertical Rows both Both
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.