Properties
Properties are specific to the widget that is using the appearance key where the properties are defined. Some properties are translated to "style" settings on the widget DOM element, while others may only affect internal behavior.
Each widget decides how to use a property. Unlike styles, properties are not limited by CSS specs.
This is the list of the common (shared) properties by all widgets. However, specific widgets may have additional themeable properties that are not listed here. See the Other Properties section for more information on how to find out which properties to use in a theme.
- paddingProperty group: [ paddingTop, paddingRight, paddingBottom, paddingLeft ]
- paddingTopThe top padding in pixels.
- paddingRightThe right padding in pixels.
- paddingBottomThe bottom padding in pixels.
- paddingLeftThe left padding in pixels.
- backgroundColorThe background color of the rendered widget. It overrides the backgroundColor set in the styles and it is overridden by the BackColor set in the application.
- textColorThe text color of the rendered widget. It is overridden by the ForeColor set in the application.
- fontThe widget's font. The value is either a font name defined in the fonts section or a full font definition.
- opacityA decimal between 0 (invisible) and 1 (fully visible) that defines the opacity of the widget. See CSS3 opacity.
- cursorThe name of the cursor to show when the pointer is over the widget. Allowed values: "default", "crosshair", "pointer", "move", "n-resize", "ne-resize", "e-resize", "se-resize", "s-resize", "sw-resize", "w-resize", "nw-resize", "nesw-resize", "nwse-resize", "text", "wait", "help", "not-allowed", "row-resize", "col-resize".
- nativeContextMenuDetermines whether the native context menu should be enabled for this widget. Default: false.
- minWidthThe minimum width of the widget in pixels.
- maxWidthThe maximum width of the widget in pixels.
- widthThe preferred width of widget in pixels. The actual size may change depending on the minWidth, maxWidth and the layout engine used by the widget. It is overridden by the Width property set in the application.
- minHeightThe minimum height of the widget in pixels.
- maxHeightThe maximum height of the widget in pixels.
- heightThe preferred height of widget in pixels. The actual size may change depending on the minHeight, maxHeight and the layout engine used by the widget. It is overridden by the Height property set in the application.
- allowStretchXProperty group: [ allowGrowX, allowShrinkX ]
- allowGrowXDetermines whether the widget can grow horizontally. It is used by the internal layout engines.
- allowShrinkXDetermines whether the widget can shrink horizontally. It is used by the internal layout engines.
- allowStretchYProperty group: [ allowGrowY, allowShrinkY ]
- allowGrowYDetermines whether the widget can grow vertically. It is used by the internal layout engines.
- allowShrinkYDetermines whether the widget can shrink vertically. It is used by the internal layout engines.
- marginProperty group: [ marginTop, marginRight, marginBottom, marginLeft ]
- marginTopThe top margin in pixels.
- marginRightThe right margin in pixels.
- marginBottomThe bottom margin in pixels.
- marginLeftThe left margin in pixels.
- alignXDetermines the horizontal alignment of the item in the parent layout. It is used (or ignored) by the internal layout engines.
- alignYDetermines the vertical alignment of the item in the parent layout. It is used (or ignored) by the internal layout engines.
- decorationSets the text decoration for text in the widget. Allowed values: "none", "underline", "line-through", "overline".
- iconThe URL or theme image name of the icon to show in the widget. It's supported only by widgets that include a child Image element: buttons, labels, check boxes, radio buttons, ...
- gapThe space, in pixels, between the icon and the label in the container widget. It's supported only by widgets that include a child Image element: buttons, labels, check boxes, radio buttons, ...
- showDetermines whether the widget shows the icon, label, or both. Allowed values: "both", "label", "icon". It's supported only by widgets that include a child Image element: buttons, labels, check boxes, radio buttons, ...
- iconPositionDetermines the position of the icon in relation to the text. Allowed values: "top", "right", "bottom", "left", "top-left", "bottom-left", "top-right", "bottom-right". It's supported only by widgets that include a child Image element: buttons, labels, check boxes, radio buttons, ...
- centerDetermines whether the content should be rendered centrally. It is used (or ignored) by the internal layout engines.
All the properties that are marked themeable in the widget's JavaScript code can be defined in a theme.
One way to find which properties are supported is to use the excellent qooxdoo API viewer and search for a base widget that corresponds to the Wisej.NET control. When using the API Viewer, note that themeable properties show a pencil icon.
Another way is to look at the JavaScript source code for the Wisej.NET widgets and their base classes to determine which properties are themeable.
checkAlign property definition on wisej.web.CheckBox.js
/**
* CheckAlign property.
*
* Gets or sets the horizontal and vertical alignment of the check mark.
*/
checkAlign: {
themeable: true,
init: "middleLeft",
apply: "_applyCheckAlign",
check: ["topRight", "middleRight", "bottomRight", "topLeft", "topCenter", "middleLeft", "middleCenter", "bottomLeft", "bottomCenter"]
}
Property groups are composite properties that can set the values of other properties using a shorthand array. The code below shows a property group used to set related properties. In a theme definition file you can set a property group or a single property or both; they are applied in the order they are declared.
padding property group
"properties":
{
"padding": [4, 0, 2, 4]
}
The definition above is equivalent to:
paddingTop, paddingRight, paddingBottom, paddingLeft
"styles":
{
"paddingTop": 4,
"paddingRight": 0,
"paddingBottom": 2,
"paddingLeft": 4
}
Property groups that contain values for the four sides of an element follow the TRBL pattern (top, right, bottom, left).
Last modified 3mo ago