GraphicObject classes

Figure 6-1 shows the hierarchy of the GraphicObject classes.

Figure 6-1: GraphicObject class hierarchy

The image shows the classes that inherit from GraphicObject as described above.

Table 6-2 describes each of the GraphicObject classes.

Table 6-2: GraphicObject classes

Class

Description

GraphicObject

The ancestor of all classes representing DataWindow controls. This class includes property expressions for the sizing, positioning, and visibility of the control on the DataWindow. The three methods defined for this class (SendToBack, BringToFront, SetBand) allow controls to be moved dynamically between bands on the DataWindow and to be positioned in front of or behind other objects (z-ordering).

GraphicObjectText

Represents a text object on a DataWindow control and includes properties for setting the foreground and background colors as well as the text itself.

GraphicObjectButton

Represents a button on a DataWindow control and includes properties for setting the foreground and background colors as well as the text itself.

GraphicObjectReport

Used with a composite DataWindow or a DataWindow containing a nested report. The only property currently exposed is DataWindowObject, which specifies the name of the DataWindow displayed in that nested report.

GraphicObjectPicture

Represents a picture control placed on the DataWindow and provides a FileName property pointing to the GIF, JPEG, or BitMap file that is displayed in the control.

GraphicObjectGraph

Represents a graph control within a DataWindow, including graph-style DataWindows and graphs inserted into other DataWindows. This is the most complex of the GraphicObject classes. It offers several properties relating to categories and series within the graph and many methods allowing displays and values in the graph to be manipulated. A GraphObjectUnderMouse property grants access to the specific graph element that an end user has clicked on or is hovering over.

GraphicObjectColumn

An abstract class that is an ancestor of DataWindow columns that contain OLE data, simple columns mapping to a back-end database, and computed columns. Each of these types of columns has a BorderStyle and a DataType property, both of which are defined on this class.

GraphicObjectBlobColumn

Represents OLE Blob columns on the DataWindow, which contain data to be interpreted by an OLE server application, such as Microsoft Word or RealPlayer. This class is the ancestor of GraphicObjectInkPicture and provides a read-only ColumnNumber property.

GraphicObjectInkPicture

Represents an InkPicture control on the DataWindow and provides properties that set or get ink collection modes and attributes of the ink collected.

GraphicObjectSimpleColumn

An abstract class that defines properties common to columns representing database data of standard types such as string, integer, and decimal, as well as to columns whose values are computed at runtime based on other columns or DataWindow expressions. You can set format expressions as well as background and foreground colors for these types of objects.

GraphicObjectEditableColumn

Represents column objects on a DataWindow that map to DataWindow buffers and, with the exception of external DataWindows, to data in the back-end data source. Each column includes a column number and a tab order property. For columns with an edit style that uses a code table, this class provides three methods to manipulate a code table.

GraphicObjectComputedColumn

Exposes the expression that defines the value displayed in a computed column as a property. A computed column displays values of standard datatypes, but its value is based on a potentially complex expression that can include other column and computed column objects as well as many DataWindow expressions.

Obtaining a class instance

There are several ways to obtain the class instance that is associated with a given control on a DataWindow:

When you use any of these three techniques, you will probably need to cast the GraphicObject (or GraphicObjectColumn) instance to one of the final classes that precisely represents the specific DataWindow control of interest.

In a Visual Basic program, for example, you might use the following code to determine the actual text displayed in a label on the DataWindow control:

Dim label As Sybase.DataWindow.GraphicObjectText
label = CType(dw1.GetObjectByName("t2"),
   Sybase.DataWindow.GraphicObjectText)
MsgBox("The label selected is: " + label.Text)

Some DataWindow controls are not supported in this hierarchy, specifically drawing controls and the group box, nor are all properties directly available. In future releases of DataWindow .NET, more of the DataWindow control properties will be exposed in the GraphicObject hierarchy.