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 Remove Fields DynamicallyHow You Can Restore a Field to DisplayAfter you set an object's parent to null, the object still exists. The object'sattributes (such as size and location) are unchanged. You can, therefore,restore the object to the form simply by giving it a parent. Both of thefollowing statements put the myfield field back onto the current form:field(myfield).ParentField = CurFrame.TopForm;frmfield.ParentField = CurFrame.TopForm;If you want to place the field in a new location or change any other attributes,you can do this either before or after giving it a parent.When you set attributes of a dynamically created field, OpenROAD might setother attributes implicitly based on the values you set. For example,OpenROAD uses the point size specified for a field's TypeSize as well as thelength of the string provided as its TextValue to set the Width attribute of thefield. To perform calculations based on implicitly set attributes, first attach thefield to a parent.For example, assume you want to determine the width of a dynamic field tocenter it horizontally in the window. You must parent the field before youattempt to center it. The trimfield.ParentField = CurFrame.TopForm statementin the following example attaches the field to the form before the statementbelow it, which centers the field on the form:trimfield = FreeTrim.Create();trimfield.TypeSize = 14;trimfield.TextValue = 'Frame Title';trimfield.ParentField = CurFrame.TopForm;trimfield.AbsXLeft = (CurFrame.WindowWidth -trimfield.Width) / 2;If the parenting statement had followed the statement that centers the newfield based on its width, the field would not be positioned correctly.How You Can Remove Columns from a Table FieldTo remove a column from a table field, use the DeleteColumn method. Forexample, the following statement deletes the second column from a table fieldnamed tblfld:tblfld.DeleteColumn(position = 2);Creating Dynamic Frames 379

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

Saved successfully!

Ooh no, something went wrong!