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 Build a Frame DynamicallyTo prevent the window's height from exceeding a predetermined amount, theexample code contains an if statement that checks the height. If it exceeds thelimit (the value of the maxformheight variable), the WindowHeight attribute isset to the value of the maxformheight variable and scroll bars are added to thewindow, allowing the user to scroll to hidden fields. If the window's height doesnot exceed the limit, the scroll bars are not added.How You Can Complete the SQL StatementsThe Go operation finishes creating the text of the SQL statements begun in theselect loop. Adding formatting characters and the final clause completes theselectstring variable. Adding the terminating semicolon completes theselectupdatestring and fetchstring variables. The following code from theDynamicFrame frame completes the text for the variables used in the SQLstatements:/* Now complete the select and fetch strings */selectstring = selectstring + HC_NEWLINE + HC_TAB +HC_TAB + 'from ' + table_choices;selectupdatestring = selectupdatestring + ';';fetchstring = fetchstring + ';';The completed strings are used later when the frame script for the generatedframe is constructed.How You Can Create the Frame Menu ItemsThe generated frame created by the DynamicFrame frame contains a menu barthat has two selections, File and Edit. If the user selects File, two new choicesappear, Commit and Close, and Rollback and Close. If the user selects Edit,three new choices appear: Delete and Next, Update and Next, and Next.The bar across the top of the generated frame's window, which displays theinitial menu choices, is an instance of the MenuBar class. Each initial menuoption and the submenu options accessed through the initial option is aninstance of the MenuGroup class. In the generated frame, each of thesubmenu choices is an instance of the MenuButton class.In the FrameSource object, which contains the frame's definition, the menubar is contained in the StartMenu attribute. Therefore, to construct a menu fora frame, first create the MenuBar object and assign it to the StartMenuattribute. The following code creates the menu bar and attaches it to thegenerated frame:test_frame.StartMenu = MenuBar.Create();Creating a Frame at Runtime 411

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

Saved successfully!

Ooh no, something went wrong!