10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How You Can Create Fields from User ClassesHow You Can Create Fields from User ClassesYou can create fields that correspond to the simple attributes of a user class.In the Frame Editor, click Insert, Fields from User Class. A pop-up window letsyou select a user class from those defined in your application. You can alsospecify whether you want to create simple fields or a table field. Once youselect a user class, the Frame Editor lets you place the new field or fields onthe frame. If the user class contains both simple attributes and attributes thatare objects, fields are created only for the simple attributes.If the data type of a composite field (except tablefield) is set to be a userclass, the displayed values of the fields in the composite field can be modifiedby changing the value of the underlying user class object—if the Updfieldmethod is called on the field. However, setting the underlying user class objectto NULL does not change the display.How You Can Manipulate Objects Generically: CastingIn developing OpenROAD applications, you generally work with an object of aspecific class. For example, when you set the background color for a button,you use the BgColor attribute of the ButtonField class. When your code iscompiled, OpenROAD ensures that the attribute or method you specify isdefined for the system class or one of its superclasses.There are occasions, however, when you do not know at development timewhat object you will be manipulating at runtime. For example, if you want tochange the characteristics of a field based on user interaction, such aschanging the color of a field as the user enters and leaves it, you must be ableto set attributes for an object whose type you do not know as you write thecode. To facilitate your writing such generic code, OpenROAD provides specialattributes and methods for certain system classes.FrameExec's TriggerField attribute, for example, lets you detect which fieldtriggered the executing event block. To color-highlight a field when the usermoves into and out of it, you can use the TriggerField attribute to locate thefield triggering the Entry and Exit events.There are also occasions when you code generically with methods. Forexample, when you send a MessageObject from one frame to another bypassing it as a parameter to FrameExec's SendUserEvent method, thereceiving frame must know what kind of object to expect.Working with Classes 139

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!