Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

nr:Properties

The nr:Properties primitive is used to declare a table of UI Widgets properties in a theme resource file. Each widget has a theme tag property that specifies its associated tables of properties.

Prototype

nr:Properties(t)

nr:Properties is used to create a RESTYPE_WPROPEXS resource. A RESTYPE_WPROPEXS resource contains one or more pairs of property IDs and values, which is referred to as a table of properties. A theme is composed of one or more tables of properties.

Parameters

  • t: table that contains one or more pairs of property IDs and values. Each property/value pair is a field of an individual table. The first field of the property/value table is the property ID. The second field is the value. Property IDs can be a hexadecimal value, but if the property is defined in a C header, you can include the header file in the theme resource file and use the property ID's symbol. The format of the value field depends on the property type.

nr:Properties example

The following example declares a table of Button Widget properties that sets the background color to green, the border color to yellow, and the border width to 2:

AEECLSID_CButtonWidget = { --Applied by default to all button widgets
   properties = nr:Properties {
      {PROP_BGCOLOR, green},
      {PROP_BORDERCOLOR, yellow},
      {PROPEX_BORDERWIDTH, 2}, --Propexs are treated the same as props
   },
},

See Writing a Theme Resource File for a more detailed example.