Changing Resource Information

To change resource information, change the resource definition in the WML file. While reading the following sections, please refer to the OSF/Motif Programmer's Guide, Release 1.2.

The resource specification tells Builder Xcessory how to manipulate a resource for a widget or component. Resources are globally defined, but specific classes can override various resource attributes. In addition to the OSF/Motif Programmer's Reference resource directives, many new directives are also supported.


Note: In the discussions of grammar in the following sections, the construction "A | B | C" means "one of the values A, B, or C".


Specifying a resource in the WML file

A resource is specified in the WML file as follows:

Resource <resourcename> : <resourcetype> {
<resource_attribute>
<resource_attribute>
<...>
};

<resourcetype> can have one of the following values:

Argument Specifies a simple attribute of an object class. Builder Xcessory presents this resource in the Resource Editor list of any instance of any object class that uses the resource.

Constraint Specifies a constraint attribute of an object class. Builder Xcessory presents this resource in the Resource Editor list of any child of the object class that uses the resource.

Reason Defines an Xt-style callback.

VkReason Defines a ViewKit-style callback.

Additionally, the value SubResource is parsed by Builder Xcessory and the other tools, but is unused.

The name-value pairs for the Resource Attributes follow. The same values are also used for the Resources section in a Class definition, where they override, for a specific class, the general attributes of a resource; differences between the two are noted where they exist: (Attributes marked as Not Used are read by Builder Xcessory, but have no effect.)


Note: Values unused by Builder Xcessory are not guaranteed to be written to generated WML files.

 
Name    Type 
Alias  Not used 
AllView  Boolean 
AllowEmptyValue  Boolean 
AlwaysDefault  Boolean 
AlwaysOutput  Boolean 
AlwaysSetValues  Boolean 
AppDefaults  Boolean 
AugmentDefault  Text 
AutoSet  Boolean 
CallbackFunc  Boolean 
CodeOutput  Boolean 
CreationSet  Boolean 
CustomView  Boolean 
DbResource  Boolean 
Default  Text 
DocName  Text 
DropFunc  Boolean 
EnumerationSet  Text 
Exclude  Boolean 
Excuse  Text 
Expose  Boolean 
Forced  Boolean 
FreeConvert  Text 
FuncDef  Text 
FuncProto  Text 
GetRoutine  Text 
Ignore  Boolean 
Insensitive  Boolean 
InternalLiteral  Text 
KeepAlloc  Boolean 
KeepOnMove  Boolean 
LangDir  Text 
LastWordConvert  Boolean 
MethodName  Text 
NeverSet  Boolean 
NeverVerify  Boolean 
OverrideDefault  Text 
ProgView  Boolean 
ReadInitialValue  Boolean 
ReadOnly  Boolean 
Recreate  Boolean 
RecreateParent  Boolean 
Related  Text 
RelatedFont  Text 
ResourceLiteral  Text 
SetRoutine  Text 
SimpleView  Boolean 
TclScript  Text 
ThrowAwayOnPaste  Boolean 
Type  Text 
TypeName  Text 
TypeSize  One-of-Many 
UnderscoreConvert  Boolean 
UpdateAllRsc  Boolean 
WlShellsOnly  Boolean 
WlSkipSelf  Boolean 
WlUseAll  Boolean 
WlUseClasses  List 
WlUseSOSC  Boolean 
WlUseSiblings  Boolean 
XrmResource  Boolean 
 

The following sections define the Builder Xcessory resource directives listed in the previous table. Builder Xcessory does not use all attributes. In particular, some attributes are retained by Builder Xcessory only for backward compatibility. Also, Builder Xcessory may use some attributes marked Not Used in the OSF WML documentation.

Some values are used by Builder Xcessory to control how Builder Xcessory manipulates or displays the resource, while closely-related values are used by the code generator to emit code that manipulates the widgets or class components.

AllView

Syntax

AllView = True | False;

Used By

Builder Xcessory only.

Description

Specifies that the resource is displayed in Resource Editor when the view option is set to All Resources.

If unspecified, the value is True.

AllowEmptyValue

Syntax

AllowEmptyValue = True | False;

Used By

Builder Xcessory only.

Description

Specifies that a "NULL" string is a valid value for the resource and should not be interpreted as resetting the value to its default value.

If unspecified, the value is False.

AlwaysDefault

Syntax

AlwaysDefault = True | False;

Used By

Unused. Maintained for backward compatibility.

AlwaysOutput

Syntax

AlwaysOutput = True | False;

Used By

Builder Xcessory only.

Description

Specifies that Builder Xcessory should always save the value of the resource to the save file.

If unspecified, the value is False.

AlwaysSetValues

Syntax

AlwaysSetValues = True | False;

Used By

Builder Xcessory and Code Generator.

Description

When setting the resource value internally and in generated code, Builder Xcessory never passes the value to the creation routine. Rather, the resource value is set after the object has been created.

If unspecified, the value is False.

AppDefaults

Syntax

AppDefaults = True | False;

Used By

Builder Xcessory only.

Description

Specifies that the resource can be specified in an application defaults file.

If unspecified, the value is True.

AugmentDefault

Syntax

AugmentDefault = "DefaultValue";

Used By

Unused. Maintained for backward compatibility.

AutoSet

Syntax

AutoSet = True | False;

Used By

Unused. Maintained for backward compatibility.

CallbackFunc

Syntax

CallbackFunc = "FunctionName";

Used By

Unused. Maintained for backward compatibility.

CodeOutput

Syntax

CodeOutput = True | False;

Used By

Builder Xcessory only.

Description

Specifies that the resource can be hard-coded in the generated source code.

If unspecified, the value is True.

CreationSet

Syntax

CreationSet = True | False

Used By

Code Generator only.

Description

Used only for Constraint resources. Specifies whether the resource should be set when an object is created.

If unspecified, the value is False.

CustomView

Syntax

CustomView = True | False;

Used By

Builder Xcessory only.

Description

A misnomer. Specifies that the resource is displayed in Resource Editor when the view option is set to Modified Resources.

If unspecified, the value is True.

Default

Syntax

Default = "ValueString";

Used By

Builder Xcessory only.

Description

Indicates the default value of the resource.

DocName

Syntax

DropFunc = "String";

Used By

Unused. Maintained for backward compatibility.

DropFunc

Syntax

DropFunc = "FunctionName";

Used By

Unused. Maintained for backward compatibility.

EnumerationSet

Syntax

EnumerationSet = EnumerationSetName;

Used By

Builder Xcessory only.

Description

Defines the EnumerationSet to use as the set of values for this resource. For example, the XmForm constraint resource XmNbottomAttachment uses the enumeration set name "Attachment" as the set of all possible values.

If unspecified, Builder Xcessory uses a text field for the user to enter the resource value, not a One of Many editor.

Exclude

Syntax

Exclude = True | False;

Used By

Builder Xcessory only.

Description

Indicates that Builder Xcessory should hide this resource. This attribute is used only in a Class specification's Resources section. For example, the XmNautoUnmanage resource that all subclasses of XmBulletinBoard use is only used when the widget is a dialog variant (XmFormDialog versus XmForm). In the Resources section of XmForm, the XmNautoUnmanage resource is set to Exclude = True to hide the resource.

If unspecified, the value is False.

Excuse

Syntax

Excuse = "String";

Used By

Builder Xcessory only.

Description

Specifies a string to print instead of allowing a resource value to be set. For example, the XmNchildren resource is not allowed to be set, so Excuse is set to Read Only.

If unspecified, the resource value can be set.

Expose

Syntax

Expose = True | False;

Used By

Builder Xcessory only.

Description

Specifies whether or not the resource can be exposed when creating class components in Builder Xcessory.

If unspecified, the value is True.

Forced

Syntax

Forced = True | False;

Used By

Unused. Maintained for backward compatibility.

FreeConvert

Syntax

FreeConvert = "MemoryFreeFunctionName";

Used By

Code Generator only.

Description

Specifies the function to call in the generated code in order to free values for this resource that are converted from string values using an Xt-style converter.

Functions that can be used in this way are void functions taking a single argument of a pointer to the type to be freed.

If unspecified, converted values are not freed in generated code. In most cases, this is the desired behavior. However, some widgets copy certain resource values (such as the XmLabel with values of the XmNlabelString resource), so that memory allocated by the converter needs to be freed.

FuncDef

Syntax

FuncDef = "String";

Used By

Unused. Maintained for backward compatibility.

FuncProto

Syntax

FuncProto = "String";

Used By

Unused. Maintained for backward compatibility.

GetRoutine

Syntax

GetRoutine = "String";

Used By

Unused. Maintained for backward compatibility.

Ignore

Syntax

Ignore = True | False;

Used By

Builder Xcessory only.

Description

Specifies that a given resource should not appear in the resource list of instances of a particular class.

If unspecified, the resource is listed where appropriate.

Insensitive

Syntax

Insensitive = True | False;

Used By

Unused. Maintained for backward compatibility.

InternalLiteral

Syntax

InternalLiteral = "SymbolName";

Used By

Unused. Maintained for backward compatibility.

KeepAlloc

Syntax

KeepAlloc = True | False;

Used By

Builder Xcessory only.

Description

Tells Builder Xcessory not to free memory allocated when this resource is set internally.

If unspecified, Builder Xcessory frees the internally allocated memory.

KeepOnMove

Syntax

KeepOnMove = True | False;

Used By

Unused. Maintained for backward compatibility.

LangDir

Syntax

LangDir = "C" | "CXX" | "VK" | "JAVA" | "C_UIL";

Used By

Builder Xcessory only.

Description

Indicates the code generation language for which this resource can be used.

If unspecified, the resource is assumed to be available for all languages other than Java.

LastWordConvert

Syntax

LastWordConvert = True | False;

Used By

Builder Xcessory only.

Description

Use the last "word" of the enumeration symbol name of the current value of this resource as the string value in an application defaults file. The last word begins at the last capitalized letter in the symbol name and continues to the end of the symbol name. This is very rarely used.

If unspecified, the value is False.

MethodName

Syntax

MethodName = "MethodNameString";

Used By

Code Generator only.

Description

The name of the class method to use to set the value of this resource on an instance of a class object. The set method has no return value and takes one argument--the value to set.

If MethodName is unspecified, the code generator uses the TclAttributeScript of the object class to set values. If neither of those is set, the code generator uses XtSetValues on the widget or the top-level widget of a C++ component.

NeverSet

Syntax

NeverSet = True | False;

Used By

Builder Xcessory only.

Description

Tells Builder Xcessory to never set the resource value.

If unspecified, Builder Xcessory always tries to set the value on the object instance in question.

NeverVerify

Syntax

NeverVerify = True | False;

Used By

Builder Xcessory only.

Description

Indicates that Builder Xcessory should accept the value entered by the user as the value for the resource and not attempt to fetch the resource value from the object instance after setting it.

OverrideDefault

Syntax

OverrideDefault = "DefaultValue";

Used By

Builder Xcessory only.

Description

Indicates that Builder Xcessory should not allow the user to set this resource value and to display the given DefaultValue as the resource value. This is only set on resource specifications in the Resources section of a Class specification.

ProgView

Syntax

ProgView = True | False;

Used By

Builder Xcessory only.

Description

Specifies that the resource is displayed in Resource Editor when the view option is set to Programmer Resources.

If unspecified, the value is False.

ReadInitialValue

Syntax

ReadInitialValue = True | False;

Used By

Unused. Maintained for backward compatibility.

ReadOnly

Syntax

ReadOnly = True | False;

Used By

Builder Xcessory only.

Description

Indicates that the resource cannot be set by the user. Its value is displayed by Builder Xcessory.

Recreate

Syntax

Recreate = True | False;

Used By

Builder Xcessory only.

Description

Indicates that Builder Xcessory must recreate the object instance whenever it sets this resource value. Essentially, this is used to indicate creation-time only resources.

RecreateParent

Syntax

RecreateParent = True | False;

Used By

Builder Xcessory only.

Description

Indicates that Builder Xcessory must recreate the object instance's parent whenever it sets this resource value.

Related

Syntax

Related = ResourceName;

Used By

Builder Xcessory and Code Generator.

Description

Names a resource for which this resource acts as a counter.

RelatedFont

Syntax

RelatedFont = ResourceName;

Used By

Builder Xcessory only.

Description

Names a XmFontList resource that provides the font tags used by this XmString resource.

ResourceLiteral

Syntax

ResourceLiteral = "String";

Used By

Unused. Maintained for backward compatibility.

SetRoutine

Syntax

SetRoutine = "SetEnabled" | "SetListResource" |        "SetFormAttachment" | "SetFormOffsetPosition" |        "SetRecomputeSize" | "SetSensitive" | "SetTearOffModel";

Used By

Builder Xcessory only.

Description

Tells Builder Xcessory to use one of several special routines to set this resource. Avoid using this attribute.

SimpleView

Syntax

SimpleView = True | False;

Used By

Builder Xcessory only.

Description

Specifies that the resource is displayed in Resource Editor when the view option is set to Simple Resources.

If unspecified, the value is False.

TclScript

Syntax

TclScript = "TclProcName";

Used By

Code Generator only.

Description

Specifies a tcl function that the code generator should call when generating source code to set this resource value.

ThrowAwayOnPaste

Syntax

ThrowAwayOnPaste = True | False;

Used By

Builder Xcessory only.

Description

Indicates that Builder Xcessory should not try to set this resource value when pasting an instance of an object class that originally set this resource value.

Type

Syntax

Type = WMLDataType;

Used By

Builder Xcessory and Code Generator.

Description

Matches the resource to a defined data type. Builder Xcessory uses this attribute to determine default attributes for the resource as well as to match the resource to an editor. This attribute is required.

TypeName

Syntax

TypeName = "ConverterTypeName";

Used By

Builder Xcessory and Code Generator.

Description

This value is the to_type used by XtConvertAndStore. Builder Xcessory and the code generator use this when converting strings to actual resource values. For example, the basic widget resource XmNheight has a TypeName of "Dimension".

TypeSize

Syntax

TypeSize = sizeofBoolean | sizeofChar | sizeofDouble |        sizeofFloat | sizeofInt | sizeofLong | sizeofPointer |         sizeofShort;

Used By

Builder Xcessory only.

Description

Indicates the size in bytes of the variable that holds the value of this resource. The actual size of the type is determined dynamically by Builder Xcessory, and can vary from platform to platform. It is important that this size be correct for each resource so that Builder Xcessory can allocate sufficient space to hold a resource value and also so that values can be correctly interpreted.

UnderScoreConvert

Syntax

UnderScoreConvert = True | False;

Used By

Builder Xcessory only.

Description

Use the last "word" preceded by an underscore character (_) of the enumeration symbol name of the current value of this resource as the string value in an application defaults file. This is very rarely used.

If unspecified, the value is False.

UpdateAllRsc

Syntax

UpdateAllRsc = True | False;

Used By

Builder Xcessory only.

Description

If this resource value is changed, forces the Resource Editor to update all the displayed data.

WlShellsOnly

Syntax

WlShellsOnly = True | False;

Used By

Builder Xcessory only.

Description

The extended editor for this resource presents a list of all of the shells currently instantiated by Builder Xcessory.

WlSkipSelf

Syntax

WlSkipSelf = True | False;

Used By

Builder Xcessory only.

Description

The extended editor for this resource never lists the object instance for which this resource is being set.

WlUseAll

Syntax

WlUseAll = True | False;

Used By

Builder Xcessory only.

Description

The extended editor for this resource presents a list of all of the object instances currently instantiated by Builder Xcessory.

WlUseClasses

Syntax

WlUseClasses = ClassName [ | ClassName... ];

Used By

Builder Xcessory only.

Description

The extended editor for this resource presents a list of all of the object instances of the given object classes currently instantiated by Builder Xcessory.

WlUseSOSC

Syntax

WlUseSOSC = True | False;

Used By

Builder Xcessory only.

Description

The extended editor for this resource presents a list of all of the grandchildren of the object instance for which this resource is being set.

WlUseSiblings

Syntax

WlUseSiblings = True | False;

Used By

Builder Xcessory only.

Description

The extended editor for this resource presents a list of all of the siblings of the object instance for which this resource is being set.

XrmResource

Syntax

XrmResource = True | False;

Used By

Unused. Maintained for backward compatibility.

Documentation: