Graphic Object Metaclass


Overview

The Graphic class defines the basic methods that apply to all INT Graphic objects, including methods to display, select, move and resize objects. Additional methods include hardcopy output for Postscript and CGM, group and ungroup, cut and paste, and file import and export. Most methods defined in the Graphic class are accessible through actions or functions defined in the EditObject widget class. Do not instantiate the Graphic object class directly.

Interactive Editing

Interactive editing of an object is defined by specifying a translation table on the parent widget. The EditObject widget class defines a comprehensive set of actions for object editing. Examples of actions include ObjectSelect, ObjectEdit, ObjectAddPoint and ObjectDeletePoint. The Graphic class defines a set of resources, including XmNsensitive, XmNshape and XmNmove to selectively enable or disable any editing action on a Graphic object.

Visual Attributes

The Graphic class defines all the basic graphic attributes necessary to describe the appearance an object, including line color, size and style. Other resources are available to describe the fill style, fill color, and pattern. The bitmap pattern can be specified from a pixmap or from a file containing a bitmap definition.

Coordinate System

Each object class defines a specific resource or set of resources that describe the geometry of the object. The coordinate system used to describe the object geometry is normally the one defined by its parent. Two resources, XmNverticalAxis and XmNhorizontalAxis, can be used to specify a different coordinate system vertically, horizontally or both.

Inherited Behavior and Resources

The Graphic object class inherits behavior and resources from the Xt Object class.
The following resources are defined by the Graphic object class:
NameTypeDefaultAccess
XmNclipGridBooleanFalseCSG
XmNcolorPixelforegroundCSG
XmNdashListchar *NULLCSG
XmNdisplayNameBooleanFalseCSG
XmNfillColorPixelbackgroundCSG
XmNfillFilenamechar *NULLCSG
XmNfillPixmapPixmapNULLCSG
XmNfillStyleintXintFILL_NONECSG
XmNfontchar *"Helvetica*120*"CSG
XmNgroupObjectNULLCSG
XmNhighlightModeintXintHIGHLIGHT_HANDLECSG
XmNhorizontalAxisWidgetNULLCSG
XmNlineStyleintXintLINE_SOLIDCSG
XmNlineThicknessint1CSG
XmNmoveBooleanTrueCSG
XmNmoveDirectionintXintMOVE_ANYCSG
XmNnamechar *NULLCSG
XmNresourceDialogBooleanTrueCSG
XmNsensitiveBooleanTrueCSG
XmNshapeBooleanTrueCSG
XmNstippleColorPixelforegroundCSG
XmNuserDataXtPointerNULLCSG
XmNverifyCallbackXtCallbackListNULLC
XmNverticalAxisWidgetNULLCSG
XmNvisibleBooleanTrueCSG


XmNclipGrid

Specifies whether the object will be clipped to the Grid boundaries if its parent is a Grid widget or a widget which class is derived from Grid.

XmNcolor

Specifies the color (as a pixel value) used to draw the Graphic object edges.

XmNdashList

Specifies a string containing an X Window-style dash pattern. This resource will be used when resource XmNlineStyle is set to XintLINE_ON_OFF_DASH or XintLINE_DOUBLE_DASH.

XmNdisplayName

Specifies whether the Graphic object name (from resource XmNname) will be drawn.

XmNfillColor

Specifies the pixel color used to draw a filled Graphic object. This resource is used when resource XmNfillStyle is set to XintFILL_SOLID or XintFILL_OPAQUE_STIPPLED.

XmNfillFilename

Specifies a filename containing the description of a bitmap that will be used for the fill pattern. This resource is used when the value of resource XmNfillStyle is set to XintFILL_STIPPLED or XintFILL_OPAQUE_STIPPLED.

XmNfillPixmap

Specifies a pixmap of depth 1 (bitmap) that will be used for the fill pattern. This resource is used when resource XmNfillStyle is set to XintFILL_STIPPLED or XintFILL_OPAQUE_STIPPLED.

XmNfillStyle

Specifies the fill style for the Graphic object. You can specify one of the following constants:

Resource ValueDescription
XintFILL_NONENo fill is drawn.
XintFILL_STIPPLEDThe fill pattern is drawn using the stipple color pixel masked by the specified fill pixmap.
XintFILL_OPAQUE_STIPPLEDThe fill pattern is drawn using the fill color pixel for unset bits and the stipple color pixel for set bits of the specified fill pixmap.
XintFILL_SOLIDThe fill pattern is solid and drawn using the fill color pixel.


XmNfont

Specifies the name of the X-Window font used to draw the object's label. This resource is used only if resource XmNdisplayName is set to True.

XmNgroup

Specifies the ID of a group object in which you want the graphic object to be inserted. You only need to specify this resource if you want this object to be inserted in a group. See Group Object class section for more information on group objects.

XmNhighlightMode

Specifies how an object will be highlighted when selected. The value of this resource is specified as one of the defined constants listed below:

Resource ValueDescription
XintHIGHLIGHT_NONEObject will not be highlighted when selected.
XintHIGHLIGHT_HANDLE(default)Object's handles will appear when it is selected.
XintHIGHLIGHT_COLORObject's color will change to the object's hightlight color when it is selected. The object's highlight color is the value of its parent's XmNhighlightColor resource.


XmNhorizontalAxis

Specifies the ID of an Axis object which the Graphic object will use for its horizontal coordinate system. If this resource is set to NULL, the horizontal coordinate system of the object's parent will be used.

XmNlineStyle

Specifies the line style used to draw the object's edges. This resource is specified as one of the defined constants listed below:

Resource ValueDescription
XintLINE_NONEThe object lines are not drawn.
XintLINE_SOLIDThe object lines are drawn using a solid line.
XintLINE_ON_OFF_DASHThe object lines are drawn using a dashed line.
XintLINE_DOUBLE_DASHThe object lines are drawn using a double dashed line.


XmNlineThickness

Specifies the line thickness used to draw the Graphic object's edges.

XmNmove

Specifies whether or not the Graphic object can be moved interactively by the enduser.

XmNmoveDirection

Specifies whether a Graphic object move operation is constrained. You can specify one of the following defined constants:

Resource ValueDescription
XintMOVE_ANYThe object can be moved freely in any direction
XintMOVE_VERTICALThe object can only be moved vertically.
XintMOVE_HORIZONTALThe object can only be moved horizontally


XmNname

Specifies the name of the Graphic object. The name of the object will be drawn if resource XmNdisplayLabel is set to True. If this resource is NULL (default), the object name as specified at creation time will be used.

XmNresourceDialog

Specifies whether or not the built-in resource editor dialog will be enabled. When this entry is set to False, the built-in resource editor cannot be activated.

XmNsensitive

Specifies whether or not a Graphic object can be selected and manipulated interactively by the end-user. When this resource is set to False, the object cannot be selected, moved or resized by the end-user. When this resource is set to True, the object can be selected and manipulated according to the settings of resources such as XmNmove.

XmNshape

Specifies whether or not a Graphic object can be shaped interactively by the end-user. For most objects, the shape is equivalent to a resize. For objects based on the MultiPoint class (like Polyline), the shape operation allows the end-user to edit the points of the object.

XmNstippleColor

Specifies the color (as a pixel value) used to draw the set bits of the fill pixmap when the resource XmNfillStyle is set to XintFILL_STIPPLED or XintFILL_OPAQUE_STIPPLED.

XmNuserData

Allows the application to attach any specific data to the Graphic object. This resource is not used internally.

XmNverifyCallback

Specifies a callback list, called each time an object is modified interactively by the end-user. The operation type, new object position and new object size are returned in the callback structure. A confirmation flag allows the application to cancel the operation.

XmNverticalAxis

Specifies the ID of an Axis object which the Graphic object will use for its vertical coordinate system. If this resource is set to NULL, the vertical coordinate system of the object's parent will be used.

XmNvisible

Specifies whether or not the object is drawn on the screen.

Defined Callbacks

The following callback is defined by the Graphic object class.

NameStructureReason
XmNverifyCallbackXintGraphicVerifyCallbackStructXintCR_OBJECT_MOVE
XintCR_OBJECT_SHAPE
XintCR_OBJECT_ADD_POINT
XintCR_OBJECT_DELETE_POINT

Whenever a Graphic object has been modified interactively by the end-user, callback XmNverifyCallback is invoked so that the application can validate the modification. The operation type, the new position and size of the object are returned in the callback structure. A confirmation flag, doit, allows the application to cancel the operation.

The following ordered table lists the members of the callback structure, XintGraphicVerifyCallbackStruct, associated with callback XmNverifyCallback.

Data TypeMemberDescription
intreasonIndicates why the callback was invoked.
XEvent *eventPoints to the XEvent that triggered the callback.
BooleandoitSet to False to cancel the operation.

Some of the subclasses of the Graphic object class define different callback structures for the callback list specified as the value of the XmNverifyCallback resource. The above structure describes only the common members in all of the verify callback structures. Please refer to each Graphic object class reference section for a full description of the data structure returned to the verify callback list.


Graphic Functions

The following function can be used to unmanage the dialog panel associated with the specified object. Some objects, like Text, AxisObject or Chart have a built-in dialog panel that can be used to edit the object resources interactively. If the specified object is a group, this function will also unmanage all panels that may be associated with objects contained in the group.

     XintGraphicUnmanageDialog (Object object)

where object is the Object ID.


Macros

Macro XintIsGraphic returns True if the specified object is a Graphic object.

     Boolean XintIsGraphic (Object object)