guides:bfs:sql:working_with_forms

Working with Forms

I. Creating a Data Entry Form

To create an OpenInsight Data Entry Form, from the OpenInsight IDE choose New, Windows Forms, Data-bound Form.

sql_039.jpg

From the New Data-Bound Form dialog box select Tables from the drop-down list. A list of native tables is displayed in the list box.

sql_040.jpg

Select the OpenInsight table from the list in the list box (by double-clicking the name). Choose SALES_SALESTERRITORY

The columns from the selected table are displayed in the Columns list box.

Select columns from the Columns list box to use in creating the OpenInsight form. To select a column, double-click on the column name in the Columns list box or select the column and click the Add button. The selected columns are displayed in the selected columns edit table. The order in which columns are selected sets the tab order for the controls in the OpenInsight form being created. Select all the fields.

The default control type for columns is an Edit line. The Edit Table control is the default control type for a multi-value column. If you want to specify another control type, select the appropriate column row in the selected columns edit table and double-click to display a list of control types. Double-click the required control type in the control type list for the specified column. The new control type is indicated in the selected columns edit table.

If you want to remove a column from the selected columns edit table, select the column row and click the Remove button. The row is deleted from the edit table and therefore not displayed on the OpenInsight form.

When all columns have been selected and the required controls specified, click the OK button to create the default OpenInsight form. The form should resemble the following:

sql_041.jpg

Rearrange and resize your controls by holding the Ctrl key and clicking on the controls you want to select. Right click to rearrange and resize the selected controls.

sql_042.jpg

Save the form by choosing File, Save from the OpenInsight IDE. The Save Form dialog box will be displayed.

sql_043.jpg

Type SALESTERRITORY in the Entity Name field and click the OK button.

sql_044.jpg

Choose Settings, IDE Settings from the OpenInsight IDE.

sql_045.jpg

sql_046.jpg

Click the test run button sql_047.jpg from the Tool Bar.

Type an initial value (1 – 10) for the TerritoryID then tab off the field. The form will display the customer information.

You can also enter a new customer record by selecting a TerritoryID greater than 10.

sql_048.jpg

5. Press the OK button on the form to save this record. The record is saved, the form is cleared. After adding or displaying the last record, choose Cancel to exit the form. This will return you to the Form Designer.

Multiple Document Interface (MDI) windows are child windows or OpenInsight forms that belong to a parent frame and are displayed in the window client area. The MDI Frame is the main window and normally contains a menu, a client area and a status line. The MDI Frame controls all of the child windows. The MDI children are the OpenInsight forms that appear within the client area of the MDI frame.

To create an OpenInsight MDI Frame, from the OpenInsight IDE choose New, Windows Forms, MDI Frame.

sql_049.jpg

An MDI frame with an MDI client window is displayed. The MDI client window is part of the frame window and cannot be deleted or copied. MDI child windows are confined to the MDI client area. The text “MDI Client Window” is visible only during OpenInsight form design so that you can distinguish the MDI client area from other controls. The Client Window should display as follows:

sql_050.jpg

The MDI Client Window can be resized.

MDI Child windows are those that reside within the MDI client area. MDI Child windows can be any OpenInsight form created for the current application. MDI Child windows are often created prior to creating the MDI frame. A feature of MDI child windows is that they do not contain menus. Menu functionality is provided by the frame.

An MDI child is executed from the MDI frame with the BASIC+ function START_MDICHILD.

Choose Edit the menu for this form button sql_051.jpg from the Toolbar. The Menu Builder designer is displayed.

sql_052.jpg

The first menu item is highlighted.

Enter Sales Territory in the Add listbox. Click the + button.

Use the arrow buttons and indent buttons to place your menu item in the correct postion.

Choose File, Save from the OpenInsight IDE.

sql_053.jpg


Check the Quick Event check box. The Quick Events dialog box is activated.

sql_054.jpg

Choose Start an MDI child window from QuickEvent Options. The EventAction Params value will be populated with default settings for the Start_MDIChild function.

sql_055.jpg


On the Specify Procedure Parameters: change WinID to ‘SALESTERRITORY’ and CreateParam to null (‘’). Include the single quotes.

sql_056.jpg

Press the OK button. This will return you to the MDI Frame.


Select File, Save from the OpenInsight IDE. Enter ADVENTUREWORKS_MDI for the name of the form.

sql_057.jpg

sql_058.jpg


Click the test run button sql_047.jpg from the Tool Bar. The following MDI Frame will display:

sql_059.jpg


Choose Sales Territiry from the File menu. The SALESTERRITORY data entry form will display:

sql_060.jpg

Your application now contains MDI capability.

  • guides/bfs/sql/working_with_forms.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1