In this step you'll create Container and Widget properties files, to integrate the new classes Container and Widget with General Interface Builder. These properties files can then be used by the Properties, Events, and XSL Parameters palettes when editing instances of the new classes. After custom properties are created and loaded by the General Interface system, they appear in the Properties Editor palette when the component is selected. Then you can set properties for your custom components in General Interface Builder, just as you do with General Interface components. The properties file adheres to the Common Data Format (CDF). Properties are organized by categories (group) and each category has individual fields (record) that correspond to rows in the Properties Editor palette. For more information on CDF, see Common Data Format (CDF) in the General Interface Developer Guide. For examples of General Interface Builder files that define properties, events, and XSL parameters, see these directories in the GI_HOME directory:
Note that you can also create a file, such as master.xml, that contains common properties and then include that file in a properties file. For example: <record group="object" include="master.xml"/> For examples of how this is done, see General Interface Builder properties files in GI_Builder\plugins\jsx3.ide.palette.properties\templates.
To create the properties file for Container:
<?xml version="1.0" encoding="UTF-8"?> <data jsxid="jsxroot"> <record group="1" jsxid="object" jsxtext="Object"> <record docnoprop="true" eval="0" getter="getClass" jsxid="jsxinstanceof" jsxtext="Object Type" jsxtip="The JSX foundation class that this object is an instance of." uneditable="1"/> <record docgetter="getId" docnoprop="true" eval="0" jsxid="_jsxid" jsxtext="ID" jsxtip="The unique, system-assigned ID for this object." uneditable="1"/> <record disallow="\[\\u0022\u003C\u003E\u0027\u0026\\]" docgetter="getName" docsetter="setName" eval="0" jsxexecute="objJSX.setName(vntValue);jsx3.ide.onDomChangeSleep();" jsxid="jsxname" jsxmask="jsxtext" jsxtext="Name" jsxtip="Sets the name assigned by the developer to identify this object."/> </record> <record group="1" jsxid="position" jsxtext="Positioning"> <record docdefault="Relative(<code>jsx3.gui.Block.RELATIVE</code>\)" docgetter="getRelativePosition" docsetter="setRelativePosition" eval="1" jsxexecute="objJSX.setRelativePosition(vntValue,true);" jsxid="jsxrelativeposition" jsxmask="jsxselect" jsxtext="Relative XY" jsxtip="Sets whether to place this object relatively or absolutely with respect to its container."> <enum jsxid="jsx3.gui.Block.ABSOLUTE" jsxtext="Absolute"/> <enum jsxid="jsx3.gui.Block.RELATIVE" jsxtext="Relative"/> </record> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="If absolutely positioned,the default is 0. If relatively positioned, the default is empty." docgetter="getLeft" docsetter="setLeft" eval="0" jsxexecute="objJSX.setLeft(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue, true);" jsxid="jsxleft" jsxmask="jsxtext" jsxtext="Left" jsxtip="Sets the position of this object from left edge of container. If this object is absolutely positioned, this value is applied as an implied pixel or a percentage. For example, <code>10</code> or <code>15%</code>."/> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="If absolutely positioned, the default is 0. If relatively positioned, the default is empty." docgetter="getTop" docsetter="setTop" eval="0" jsxexecute="objJSX.setTop(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue,true);" jsxid="jsxtop" jsxmask="jsxtext" jsxtext="Top" jsxtip="Sets the position of this object from top edge of container. If this object is absolutely positioned, this value is applied as an implied pixel or a percentage. For example, <code>10</code> or <code>15%</code>."/> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="Empty" docgetter="getWidth" docsetter="setWidth" eval="0" jsxexecute="objJSX.setWidth(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue,true);" jsxid="jsxwidth" jsxmask="jsxtext" jsxtext="Width" jsxtip="Sets the width of the control as implied pixels or a percentage. For example, <code>100</code> or <code>25%</code>."/> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="Empty" docgetter="getHeight" docsetter="setHeight" eval="0" jsxexecute="objJSX.setHeight(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue,true);" jsxid="jsxheight" jsxmask="jsxtext" jsxtext="Height" jsxtip="Sets the height of the control in pixels or percentage. For example, <code>100</code> or <code>25%</code>."/> <record disallow="[^0-9^-]" docdefault="<code>1</code>" docgetter="getZIndex" docsetter="setZIndex" eval="1" jsxid="jsxzindex" jsxmask="jsxtext" jsxtext="Z-Index" jsxtip="If this object is absolutely positioned, sets the CSS z-index. The z-index sets the stack order of an element."/> </record> <record group="1" jsxid="myexamplefield" jsxtext="Category Label for Container"> <record jsxtip="This is a container. It can contain other containers as well as widgets. Click on the button to activate the custom editor mask." docgetter="getBackgroundColor" docsetter="setBackgroundColor" eval="0" jsxexecute="objJSX.setBackgroundColor(vntValue,true);" jsxid="jsxbgcolor" jsxmask="jsxtext" jsxtext="Field Label (BGColor)"/> </record> </data> When the Container properties file is loaded in the Properties Editor palette in General Interface Builder, it looks like this:
To create the properties file for Widget:
<?xml version="1.0" encoding="UTF-8"?> <data jsxid="jsxroot"> <record group="1" jsxid="object" jsxtext="Object"> <record docnoprop="true" eval="0" getter="getClass" jsxid="jsxinstanceof" jsxtext="Object Type" jsxtip="The JSX foundation class that this object is an instance of." uneditable="1"/> <record docgetter="getId" docnoprop="true" eval="0" jsxid="_jsxid" jsxtext="ID" jsxtip="The unique, system-assigned ID for this object." uneditable="1"/> <record disallow="\[\\u0022\u003C\u003E\u0027\u0026\\]" docgetter="getName" docsetter="setName" eval="0" jsxexecute="objJSX.setName(vntValue);jsx3.ide.onDomChangeSleep();" jsxid="jsxname" jsxmask="jsxtext" jsxtext="Name" jsxtip="Sets the name assigned by the developer to identify this object."/> </record> <record group="1" jsxid="position" jsxtext="Positioning"> <record docdefault="Relative(<code>jsx3.gui.Block.RELATIVE</code>\)" docgetter="getRelativePosition" docsetter="setRelativePosition" eval="1" jsxexecute="objJSX.setRelativePosition(vntValue,true);" jsxid="jsxrelativeposition" jsxmask="jsxselect" jsxtext="Relative XY" jsxtip="Sets whether to place this object relatively or absolutely with respect to its container."> <enum jsxid="jsx3.gui.Block.ABSOLUTE" jsxtext="Absolute"/> <enum jsxid="jsx3.gui.Block.RELATIVE" jsxtext="Relative"/> </record> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="If absolutely positioned, the default is 0. If relatively positioned, the default is empty." docgetter="getLeft" docsetter="setLeft" eval="0" jsxexecute="objJSX.setLeft(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue,true);" jsxid="jsxleft" jsxmask="jsxtext" jsxtext="Left" jsxtip="Sets the position of this object from left edge of container. If this object is absolutely positioned, this value is applied as an implied pixel or a percentage. For example, <code>10</code> or <code>15%</code>."/> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="If absolutely positioned, the default is 0. If relatively positioned, the default is empty." docgetter="getTop" docsetter="setTop" eval="0" jsxexecute="objJSX.setTop(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue,true);" jsxid="jsxtop" jsxmask="jsxtext" jsxtext="Top" jsxtip="Sets the position of this object from top edge of container. If this object is absolutely positioned, this value is applied as an implied pixel or a percentage. For example, <code>10</code> or <code>15%</code>."/> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="Empty" docgetter="getWidth" docsetter="setWidth" eval="0" jsxexecute="objJSX.setWidth(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue,true);" jsxid="jsxwidth" jsxmask="jsxtext" jsxtext="Width" jsxtip="Sets the width of the control as implied pixels or a percentage. For example, <code>100</code> or <code>25%</code>."/> <record disallow="[^cm^pt^\.^%^0-9^-]" docdefault="Empty" docgetter="getHeight" docsetter="setHeight" eval="0" jsxexecute="objJSX.setHeight(jsx3.util.numIsNaN(vntValue)?vntValue:+vntValue,true);" jsxid="jsxheight" jsxmask="jsxtext" jsxtext="Height" jsxtip="Sets the height of the control in pixels or percentage. For example, <code>100</code> or <code>25%</code>."/> <record disallow="[^0-9^-]" docdefault="<code>1</code>" docgetter="getZIndex" docsetter="setZIndex" eval="1" jsxid="jsxzindex" jsxmask="jsxtext" jsxtext="Z-Index" jsxtip="If this object is absolutely positioned, sets the CSS z-index. The z-index sets the stack order of an element."/> </record> <record group="1" jsxid="myexamplefield" jsxtext="Category Label for Widget"> <record jsxtip="This is a widget. It can only be contained by a container." docgetter="getText" docsetter="setText" eval="0" jsxexecute="objJSX.setText(vntValue);objJSX.repaint();" jsxid="jsxtext" jsxmask="jsxtext" jsxtext="Field Label (Text)"/> </record> </data> When the Widget properties file is loaded in the Properties Editor palette in General Interface Builder, it looks like this:
Now that you've created a properties file for each prototype, you'll create a catalog file that describes the location of these files to the General Interface system. You'll do this in Creating and Loading the Catalog File.
For more information about CDF, see the General Interface Developer Guide. |
Contents
|


