Resources | Resources |




The nr:PropertySkip primitive is used to skip theming a property at runtime.



nr:PropertySkip is used as the value of an nr:Properties() property. When an nr:Properties() property is set using this nr:PropertySkip, the value for that property is skipped when the property table is applied to a UI Widget.

This is useful when multiple tables of properties are applied to the same UI Widget. In this case, if this primitive is used in a property, the values in tables with less precedence are ignored.



nr:PropertySkip example

The following example defines, an nr:Properties() property that skips the PROP_BORDERWIDTH property. The table of properties shown is an example of a default theme tag for Button Widgets. A default theme tag is declared for a UI Widget using its ClassID.

AEECLSID_CButtonWidget = { --Applied by default to all button widgets
   properties = nr:Properties {
      {PROP_BGCOLOR, black},
      {PROP_BORDERCOLOR, yellow},
      {PROPEX_BORDERWIDTH, 10}, --Propexs are treated the same as props
--Applied to all widgets with a "greenbgnoborderwidth" theme tag
greenbgnoborderwidth = { 
   properties = nr:Properties {
      {PROP_BGCOLOR, green},
      {PROPEX_BORDERWIDTH, nr:PropertySkip()},

When the theme tags are applied to a widget, as follows:

ERR_TRY( IWidget_SetThemeTags(piwButton,
      ";") );

When the theme tags are applied to a widget, he following properties are applied in no particular order:

  • PROP_BGCOLOR is applied as a green color because "" has precedence.
  • PROP_BORDERCOLOR is applied as a yellow color, because even though "" has the least precedence, "" does not define that property.
  • PROP_BORDERWIDTH is not applied, because it's set to nr:PropertySkip() and keeps its original runtime value.

For a more detailed example, see Writing a Theme Resource File.