10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Change Field and Frame Appearance and BehaviorIt is not necessary to declare field and menu item variables in your scripts;OpenROAD declares them automatically when the Variable Declared togglefield is set to on. If you do declare title or another field name as a variable inyour 4GL script, you get a compile error.To reference the field object represented by a field or menu item instead of itsvalue, use the field function with the data variable. For example, the followingstatement changes the background color of the entry field described in theprevious code example:field(title).bgcolor = CC_ORANGE;When you create a field dynamically, you do so by declaring and instantiating areference variable that points to the field object. You use that variable to setthe field's attributes and attach it to the form. Because the field functionoperates on the data variable to return its reference variable, it is irrelevant todynamically created fields. Fields created dynamically do not have a datavariable.Moreover, the field function is unnecessary with fields created dynamicallybecause the variable used in creating the dynamic field references its fieldobject. However, because the data value is not an attribute of an object,accessing the data value of such an object requires the GetFieldValue andSetFieldValue methods or the use of dynamic expressions (DynExpr).How You Can Change Field and Frame Appearance andBehaviorEvery field and menu item in OpenROAD has a bias. Biases let you change theway the user can interact with a field under certain conditions. The field's biasdetermines whether the field is visible and how the user can interact with it.For example, when a field is set to the Changeable bias, the user can changethe data in the field. When the same field is set to the Visible bias, the usercan see the field but is unable to select it.The bias of a field also determines which events it can receive. For example,when a field is set to the DragSegment bias, it can receive a DragSegmentevent. When set to any other bias, it cannot receive this event.In addition to providing bias settings for every field and menu item,OpenROAD provides six different modes for every frame. Modes are sets ofbiases that let you change the appearance and behavior of several fields on aform with a single line of code.Creating Dynamic Frames 365

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

Saved successfully!

Ooh no, something went wrong!