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 Build a Frame DynamicallyHow You Can Create the FieldsTo create each field, use the Create method to create the specific field objectand then set its required attributes. The attributes that you set depend on thetype of field you are constructing. In addition, if you want the field to have atitle on the form, you must construct the field trim as well.If your fields correspond to columns in a database table, as do the fields in theexample application, retrieve the column name, length, and data typeinformation from the database to create the fields. You can retrieve thisinformation in any of the following ways:• A select loop• An SQLSelect object• A QueryObject objectThe DynamicFrame frame uses a select loop to retrieve information for buildingthe columns. For an example of using a select loop to create fieldsdynamically, see How You Can Construct the Fields (see page 405). For anexample of using a query object to retrieve this information, see CreatingDynamic Frames (see page 363).How You Can Attach Fields to the FormAfter a field is constructed, attach the field to the form by setting the field'sParentField attribute. The data type of ParentField is CompositeField. Setting afield's ParentField attribute to the name of a reference variable, pointing to aform, attaches the field to that form.For example, the following statement attaches the field represented byfield_ptr to the form represented by test_frame.TopForm:field_ptr.ParentField = test_frame.TopForm;The preceding statement says that the parent field of the field identified byfield_ptr is the form identified by test_frame.TopForm.How You Can Create the MenuA frame's menu is a MenuBar object displayed across the top of the window,containing a single line of menu selections. The MenuBar object is contained inthe StartMenu attribute of the FrameSource object.MenuBar objects contain menu groups, which can contain other menu groups,individual menu items, and menu separators. Menu groups allow a variety ofmenu structures beneath the top level of the menu bar.394 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!