up: ZWT     index Zimbu documentation

CLASS ZWT.Style @public

summary

     

A style to be attached to a Widget or Table cell. Specifies various properties for the item.

ENUM  Wrap @public 
 
string  $name @public  name used for CSS
 
NEW() @public  Create a new, default Style.
$clear() @public  Remove all properties.
$copy() ZWT.Style @public  Return a copy of this style that can be modified.
$setName(newName) @public  Set the name. It's up to the caller to make sure it's unique.
$setValue(prop, v) ZWT.Style @public  Generic way to add a property value.
$getValue(prop) string @public  Return the string value for prop. Returns ""1 if there is no value.
$setPixelValue(prop, v) ZWT.Style @public  TODO: add "em" and "ex", with a float value
$getPixelValue(prop) int @public  Return the pixel value for prop. Returns -1 if there is no pixel value.
$setUnitValue(prop, v, u) ZWT.Style @public  "in", "cm", "mm", "pt" and "pc" are not generally used.
$setColorProp(prop, color) ZWT.Style @public  Set color property prop to color.
$clearValue(prop) ZWT.Style @public  Clear the value for property prop if it exists.
$setMarginLeft(v) ZWT.Style @public  Set the left margin in pixels / units
$getMarginLeft() int @public  Get the left margin value in pixels / units
$setMarginLeft(v, u) ZWT.Style @public  Set the left margin to v in unit u.
$clearMarginLeft() ZWT.Style @public  Clear the left margin.
$setMarginRight(v) ZWT.Style @public  Set the right margin in pixels / units
$getMarginRight() int @public  Get the right margin value in pixels / units
$setMarginRight(v, u) ZWT.Style @public  Set the right margin to v in unit u.
$clearMarginRight() ZWT.Style @public  Clear the right margin.
$setMarginTop(v) ZWT.Style @public  Set the top margin in pixels / units
$getMarginTop() int @public  Get the top margin value in pixels / units
$setMarginTop(v, u) ZWT.Style @public  Set the top margin to v in unit u.
$clearMarginTop() ZWT.Style @public  Clear the top margin.
$setMarginBottom(v) ZWT.Style @public  Set the bottom margin in pixels / units
$setMarginBot(v) ZWT.Style @public  Set the bottom margin in pixels / units
$getMarginBot() int @public  Get the bottom margin value in pixels / units
$getMarginBottom() int @public  Get the bottom margin value in pixels / units
$setMarginBottom(v, u) ZWT.Style @public  Set the bottom margin to v in unit u.
$setMarginBot(v, u) ZWT.Style @public  Set the bottom margin to v in unit u.
$clearMarginBottom() ZWT.Style @public  Clear the bottom margin.
$clearMarginBot() ZWT.Style @public  Clear the bottom margin.
$setPadding(v) ZWT.Style @public  Set padding on all sides in pixels / units
$setPaddingLeft(v) ZWT.Style @public  Set left padding in pixels / units
$setPaddingLeft(v, u) ZWT.Style @public  Set the left padding to v in unit u.
$getPaddingLeft() int @public  Get the left padding value in pixels / units
$clearPaddingLeft() ZWT.Style @public  Clear the left padding.
$setPaddingRight(v) ZWT.Style @public  Set right padding in pixels / units
$setPaddingRight(v, u) ZWT.Style @public  Set the right padding to v in unit u.
$getPaddingRight() int @public  Get the right padding value in pixels / units
$clearPaddingRight() ZWT.Style @public  Clear the right padding.
$setPaddingTop(v) ZWT.Style @public  Set top padding in pixels / units
$setPaddingTop(v, u) ZWT.Style @public  Set the top padding to v in unit u.
$getPaddingTop() int @public  Get the top padding value in pixels / units
$clearPaddingTop() ZWT.Style @public  Clear the top padding.
$setPaddingBottom(v) ZWT.Style @public  Set bottom padding in pixels / units
$setPaddingBot(v) ZWT.Style @public  Set bottom padding in pixels / units
$setPaddingBottom(v, u) ZWT.Style @public  Set the bottom padding to v in unit u.
$setPaddingBot(v, u) ZWT.Style @public  Set the bottom padding to v in unit u.
$getPaddingBot() int @public  Get the bottom padding value in pixels / units
$getPaddingBottom() int @public  Get the bottom padding value in pixels / units
$clearPaddingBottom() ZWT.Style @public  Clear the bottom padding.
$clearPaddingBot() ZWT.Style @public  Clear the bottom padding.
$setHorAlign(align) ZWT.Style @public  Set the horizontal alignment to align
$getHorAlign() ZWT.HorAlign @public  Get the horizontal alignment.
$clearHorAlign() ZWT.Style @public  Clear the horizontal alignment.
$setVerAlign(align) ZWT.Style @public  Set the vertical alignment to align
$getVerAlign() ZWT.VerAlign @public  Get the vertical alignment.
$clearVerAlign() ZWT.Style @public  Clear the vertical alignment.
$setWrap(on) ZWT.Style @public  Set text wrapping on or off.
$setWrap(how) ZWT.Style @public  Set text wrapping specifically
$setWidth(width) ZWT.Style @public  Set the width to width pixels.
$setWidth(width, u) ZWT.Style @public  Set the width to width in unit u.
$setFullWidth() ZWT.Style @public  Set the width to 100%.
$setHeight(height) ZWT.Style @public  Set the height to height pixels.
$setHeight(height, u) ZWT.Style @public  Set the height to height in unit u.
$setFullHeight() ZWT.Style @public  Set the height to 100%.
$setBorder(thickness, bs, c) ZWT.Style @public  Set the border thickness to thickness pixels , style to bs and color to c.
$setBorderThickness(thickness) ZWT.Style @public  Set the border thickness to thickness pixels.
$setBorderThickness(thickness, u) ZWT.Style @public  Set the border thickness to thickness in unit u.
$clearBorderThickness() ZWT.Style @public  Clear the border thickness, no border.
$setBorderStyle(bs) ZWT.Style @public  Set the border style to bs.
$getBorderStyle() ZWT.BorderStyle @public  Get the border style.
$clearBorderStyle() ZWT.Style @public  Clear the border style.
$setBorderColor(c) ZWT.Style @public  Set the border color to c.
$clearBorderColor() ZWT.Style @public  Clear the border color.
$setColor(c) ZWT.Style @public  Set the foreground color to c.
$setColorName(colorName) ZWT.Style @public  Set the foreground color to colorName.
$clearColor() ZWT.Style @public  Clear the color, back to black.
$setBGColor(c) ZWT.Style @public  Set the background color to c.
$setBGColorName(colorName) ZWT.Style @public  Set the background color to colorName.
$clearBGColor() ZWT.Style @public  Clear the background color.
$setOpacity(percent) ZWT.Style @public  Set the opacity to percent.
$setFontName(fontName) ZWT.Style @public  Set the font name.
$setFontSize(v) ZWT.Style @public  Set the font size in pixels.
$getFontSize() int @public  Get the font size value in pixels.
$setFontSize(v, u) ZWT.Style @public  Set the font size to v in unit u.
$clearFontSize() ZWT.Style @public  Clear the font size.
 

members (alphabetically)

     

string $name @public

     

name used for CSS

PROC NEW() @public

     

Create a new, default Style.

sets name to a unique name.

PROC $clear() @public

     

Remove all properties.

FUNC $clearBGColor() ZWT.Style @public

     

Clear the background color.

FUNC $clearBorderColor() ZWT.Style @public

     

Clear the border color.

FUNC $clearBorderStyle() ZWT.Style @public

     

Clear the border style.

FUNC $clearBorderThickness() ZWT.Style @public

     

Clear the border thickness, no border.

FUNC $clearColor() ZWT.Style @public

     

Clear the color, back to black.

FUNC $clearFontSize() ZWT.Style @public

     

Clear the font size.

FUNC $clearHorAlign() ZWT.Style @public

     

Clear the horizontal alignment.

FUNC $clearMarginBot() ZWT.Style @public

     

Clear the bottom margin.

FUNC $clearMarginBottom() ZWT.Style @public

     

Clear the bottom margin.

FUNC $clearMarginLeft() ZWT.Style @public

     

Clear the left margin.

FUNC $clearMarginRight() ZWT.Style @public

     

Clear the right margin.

FUNC $clearMarginTop() ZWT.Style @public

     

Clear the top margin.

FUNC $clearPaddingBot() ZWT.Style @public

     

Clear the bottom padding.

FUNC $clearPaddingBottom() ZWT.Style @public

     

Clear the bottom padding.

FUNC $clearPaddingLeft() ZWT.Style @public

     

Clear the left padding.

FUNC $clearPaddingRight() ZWT.Style @public

     

Clear the right padding.

FUNC $clearPaddingTop() ZWT.Style @public

     

Clear the top padding.

FUNC $clearValue(string prop) ZWT.Style @public

     

Clear the value for property prop if it exists.

FUNC $clearVerAlign() ZWT.Style @public

     

Clear the vertical alignment.

FUNC $copy() ZWT.Style @public

     

Return a copy of this style that can be modified.

FUNC $getBorderStyle() ZWT.BorderStyle @public

     

Get the border style.

FUNC $getFontSize() int @public

     

Get the font size value in pixels.

Returns -1 if the font size was not set or not set in pixels.

FUNC $getHorAlign() ZWT.HorAlign @public

     

Get the horizontal alignment.

FUNC $getMarginBot() int @public

     

Get the bottom margin value in pixels / units

FUNC $getMarginBottom() int @public

     

Get the bottom margin value in pixels / units

FUNC $getMarginLeft() int @public

     

Get the left margin value in pixels / units

FUNC $getMarginRight() int @public

     

Get the right margin value in pixels / units

FUNC $getMarginTop() int @public

     

Get the top margin value in pixels / units

FUNC $getPaddingBot() int @public

     

Get the bottom padding value in pixels / units

FUNC $getPaddingBottom() int @public

     

Get the bottom padding value in pixels / units

FUNC $getPaddingLeft() int @public

     

Get the left padding value in pixels / units

FUNC $getPaddingRight() int @public

     

Get the right padding value in pixels / units

FUNC $getPaddingTop() int @public

     

Get the top padding value in pixels / units

FUNC $getPixelValue(string prop) int @public

     

Return the pixel value for prop. Returns -1 if there is no pixel value.

FUNC $getValue(string prop) string @public

     

Return the string value for prop. Returns ""1 if there is no value.

FUNC $getVerAlign() ZWT.VerAlign @public

     

Get the vertical alignment.

FUNC $setBGColor(ZWT.Color c) ZWT.Style @public

     

Set the background color to c.

FUNC $setBGColorName(ZWT.ColorName colorName) ZWT.Style @public

     

Set the background color to colorName.

FUNC $setBorder(int thickness, ZWT.BorderStyle bs, ZWT.Color c) ZWT.Style @public

     

Set the border thickness to thickness pixels , style to bs and color to c.

FUNC $setBorderColor(ZWT.Color c) ZWT.Style @public

     

Set the border color to c.

FUNC $setBorderStyle(ZWT.BorderStyle bs) ZWT.Style @public

     

Set the border style to bs.

FUNC $setBorderThickness(int thickness) ZWT.Style @public

     

Set the border thickness to thickness pixels.

FUNC $setBorderThickness(int thickness, ZWT.Unit u) ZWT.Style @public

     

Set the border thickness to thickness in unit u.

FUNC $setColor(ZWT.Color c) ZWT.Style @public

     

Set the foreground color to c.

FUNC $setColorName(ZWT.ColorName colorName) ZWT.Style @public

     

Set the foreground color to colorName.

FUNC $setColorProp(string prop, ZWT.Color color) ZWT.Style @public

     

Set color property prop to color.

FUNC $setFontName(string fontName) ZWT.Style @public

     

Set the font name.

Example: setFontName("arial,sans-serif") Pass an empty string to clear.

FUNC $setFontSize(int v) ZWT.Style @public

     

Set the font size in pixels.

FUNC $setFontSize(int v, ZWT.Unit u) ZWT.Style @public

     

Set the font size to v in unit u.

FUNC $setFullHeight() ZWT.Style @public

     

Set the height to 100%.

FUNC $setFullWidth() ZWT.Style @public

     

Set the width to 100%.

FUNC $setHeight(int height) ZWT.Style @public

     

Set the height to height pixels.

FUNC $setHeight(int height, ZWT.Unit u) ZWT.Style @public

     

Set the height to height in unit u.

FUNC $setHorAlign(ZWT.HorAlign align) ZWT.Style @public

     

Set the horizontal alignment to align

FUNC $setMarginBot(int v) ZWT.Style @public

     

Set the bottom margin in pixels / units

FUNC $setMarginBot(int v, ZWT.Unit u) ZWT.Style @public

     

Set the bottom margin to v in unit u.

FUNC $setMarginBottom(int v) ZWT.Style @public

     

Set the bottom margin in pixels / units

FUNC $setMarginBottom(int v, ZWT.Unit u) ZWT.Style @public

     

Set the bottom margin to v in unit u.

FUNC $setMarginLeft(int v) ZWT.Style @public

     

Set the left margin in pixels / units

FUNC $setMarginLeft(int v, ZWT.Unit u) ZWT.Style @public

     

Set the left margin to v in unit u.

FUNC $setMarginRight(int v) ZWT.Style @public

     

Set the right margin in pixels / units

FUNC $setMarginRight(int v, ZWT.Unit u) ZWT.Style @public

     

Set the right margin to v in unit u.

FUNC $setMarginTop(int v) ZWT.Style @public

     

Set the top margin in pixels / units

FUNC $setMarginTop(int v, ZWT.Unit u) ZWT.Style @public

     

Set the top margin to v in unit u.

PROC $setName(string newName) @public

     

Set the name. It's up to the caller to make sure it's unique.

FUNC $setOpacity(int percent) ZWT.Style @public

     

Set the opacity to percent.

FUNC $setPadding(int v) ZWT.Style @public

     

Set padding on all sides in pixels / units

FUNC $setPaddingBot(int v) ZWT.Style @public

     

Set bottom padding in pixels / units

FUNC $setPaddingBot(int v, ZWT.Unit u) ZWT.Style @public

     

Set the bottom padding to v in unit u.

FUNC $setPaddingBottom(int v) ZWT.Style @public

     

Set bottom padding in pixels / units

FUNC $setPaddingBottom(int v, ZWT.Unit u) ZWT.Style @public

     

Set the bottom padding to v in unit u.

FUNC $setPaddingLeft(int v) ZWT.Style @public

     

Set left padding in pixels / units

FUNC $setPaddingLeft(int v, ZWT.Unit u) ZWT.Style @public

     

Set the left padding to v in unit u.

FUNC $setPaddingRight(int v) ZWT.Style @public

     

Set right padding in pixels / units

FUNC $setPaddingRight(int v, ZWT.Unit u) ZWT.Style @public

     

Set the right padding to v in unit u.

FUNC $setPaddingTop(int v) ZWT.Style @public

     

Set top padding in pixels / units

FUNC $setPaddingTop(int v, ZWT.Unit u) ZWT.Style @public

     

Set the top padding to v in unit u.

FUNC $setPixelValue(string prop, int v) ZWT.Style @public

     

TODO: add "em" and "ex", with a float value

FUNC $setUnitValue(string prop, int v, ZWT.Unit u) ZWT.Style @public

     

"in", "cm", "mm", "pt" and "pc" are not generally used.

TODO: value should be float

FUNC $setValue(string prop, string v) ZWT.Style @public

     

Generic way to add a property value.

FUNC $setVerAlign(ZWT.VerAlign align) ZWT.Style @public

     

Set the vertical alignment to align

FUNC $setWidth(int width) ZWT.Style @public

     

Set the width to width pixels.

FUNC $setWidth(int width, ZWT.Unit u) ZWT.Style @public

     

Set the width to width in unit u.

FUNC $setWrap(bool on) ZWT.Style @public

     

Set text wrapping on or off.

When on is TRUE works like Wrap.none. When on is FALSE works like Wrap.normal.

FUNC $setWrap(ZWT.Wrap how) ZWT.Style @public

     

Set text wrapping specifically

credits

      The Class hierarchy, generated Javascript and a few other things are based on the Google Web Toolkit. http://code.google.com/webtoolkit/overview.html

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0