14. Creating a Frame at Runtime : How You Can Build a Frame Dynamically : How You Can Create the FrameSource Object
 
Share this page                  
How You Can Create the FrameSource Object
The first step in the construction of a frame is the creation of its FrameSource object, which contains the source definition of a frame. The attributes of the FrameSource object represent the initial settings of the frame when it is first called or opened. The example application creates the FrameSource with the following code:
/* No frame found. Generate a new one. */
fieldtop = 200;        /* Starting field on frame */
test_frame = FrameSource.Create();
The Create method creates a new instance of an object of the specified class. In this case, it returns a new instance of a FrameSource object to the test_frame reference variable.
The fieldtop variable designates the starting position of the top of each field on the form. It is incremented by the size of each field and some predetermined amount (identifying the amount of space between fields) in each iteration of the select loop. The example frame sets this variable at this point so that if the user selects the Go menu item more than once, to create more than one frame, the top field on each new frame starts in the correct position.