How can I improve drawing environments





Forms form the interface through which information is entered, changed and printed. A user works with the data in an application using forms and prints reports using forms. You can use forms to create your own dialog windows and palettes in your own applications

Each table in your database generally has at least two forms: one to list the records on the screen, and one to display a record in order to enter or edit data. The form that lists records is called the output form or list form, the form that displays one record at a time is called the input form or detail form. When viewing records with the list form, you can double-click a record to view it in the current detail form.

In your own applications, you can use the programming language to control which forms are to be used. For example, you could make a set of forms dependent on whether they are accessed by sales or accounting. You can also use the programming language to implement different sets of forms for web browsers and 4D remote users. If you are developing your own application, you can create forms for your own dialog boxes or palette windows. In your own applications, you can use multiple processes to enable users to work with multiple forms at the same time.

A form can display data fields from more than one table. You can insert data fields from a linked A table into a form and allow users to enter values ​​directly into the linked A table. You can also include a subform that displays a list of the records from a linked Many table. A subform shows a list of records from another table or a subtable in the main table. With a subform, the user can view, enter and change records in another table. An invoices application can, for example, contain a subform in the invoice entry form in which the user can enter invoice items. They appear in the invoice form, but are saved in the linked many table.

A form that is used for data entry can also contain multiple subforms. For example, an application contacts have a subform for phone numbers, another for tasks, and a third for previous contacts with the person. Each subform shows records from a different linked Many table.

A single form can use some of the data fields in a table or all of the data fields. For example, you can have two different input forms - one for input for employees, another for input for supervisors - neither of the two contains all of the data fields. You can use certain data fields for on-screen display and others for a printed report
Forms can be changed at any time, regardless of whether you have entered data in the database or not. Changes to a form in no way affect the data that is stored on the hard drive.

Each form has one or more pages in which data fields or other input objects appear. If your data fields do not fit on one page, you can create additional pages. If you are creating a multi-page form, you can also add buttons or a tab to allow users to move from one page to the next.

Each form has a background page (a page zero) on which you insert objects that appear on all pages. You use the background page to insert background graphics, buttons, tabs, and other graphic objects that determine the appearance of the page, such as frames and labels.

Note: If a multi-page form is used as an output form (e.g. for printing), only the first page appears.

With 4D you can quickly create standard forms. The powerful tools make it possible to create forms with sophisticated operator guidance. Your forms can provide exactly what you need for your application. You can create a basic form with fields, buttons, variables, etc. simply by point and click processes

4D offers two tools for creating and modifying forms: the Form wizard and the Form editor.

The form wizard is your starting point for generating all types of forms. With the form wizard you can create a new form by selecting the desired data fields from a list and the desired form template from a drop-down list. Form templates determine the appearance of the forms. A template determines properties such as form size, platform surface, font properties and buttons. For more information, see the section Creating a Form Using the Form Wizard.

The form editor is an object-oriented drawing environment in which you can customize forms by directly editing the objects in the form. For example, you can move objects or add new ones that the form wizard does not support, create multi-page forms with tabs, specify work rules through restrictions on data entry, determine access rights to forms, link your own menu bar to a form and write form and object methods that processed automatically when the form is used. For more information, see the Editing Form section.

There are two types of forms that can be created with 4D: Table forms and Project forms. Table forms are assigned to a specific table and can thus use automatic processes that are helpful when developing database-controlled applications. Project forms are independent forms, i.e. they are not assigned to any table. They are used in particular to create dialog windows for surfaces and components.

You can use project forms to create interfaces that better match the standards of operating systems. In order to display data records in list form, we recommend that you now use the 4D DIALOG command to call up project forms which can display data record selections in subforms. With little additional programming effort, you can improve the 4D commands MODIFY SELECTION and DISPLAY SELECTION

Table forms and project forms each appear in the Explorer on the Forms page as a separate group.

Each form is linked to a table. Each table must have at least one form so that information can be entered into data fields and displayed on the screen. Usually a table has separate input and output forms. The input form is used to enter data. It shows one data record each on the screen and contains buttons for saving and deleting changes to the data record and for navigating between the data records (e.g. first data record, last data record, previous data record, next data record). The output form shows a list of records with one record per line. The results of searches appear in the output form. By double-clicking on a line, the user can display the input form for this data record.

The following figure shows a typical input form and output form:

If you try to display the records of a table before creating a form for that table, a message will appear asking whether 4D should create a standard input and standard output form:

Note: You can change this standard setting in the database properties, e.g. specify that the standard forms are created automatically and the above dialog does not appear. Further information can be found in the 4D Settings on the General page.

Click the button Yesto generate standard forms. You can return to the design environment at any time and change it or replace it with more sophisticated forms. You can also use these forms to enter and display data in your database without changes. click on Noif you do not want to assign a standard form to the table. You can then enter and view data using project forms.
Your database can use up to 32,000 forms per table that perform specific tasks.

Project forms differ from table forms in the following ways:

  • Project forms can only be of the input (page) type. The functionalities for output forms (list) are not compatible with project forms.
  • Project forms do not appear in the table list and cannot be defined as the current input or output form. They cannot be used in the label editor or in the 4D import / export editor (see Importing and Exporting Data).
  • Project forms can only be displayed with the DIALOG command or as inherited forms (see section Using inherited forms).
  • Project forms can contain the same object types as table forms, including fields.
    In the case of fields, the project form saves the number of the table and the field. If a form is copied from one database to another or within a component, the references are also copied. The table and fields used are those of the target database. If there are discrepancies such as a non-existent table, incorrect field type, etc., the form does not work correctly.
    Since project forms are mainly used via the DIALOG command, the buttons with the standard actions such as next data record, delete data record are not available in the editor or in the form wizard. You have to control the display and modification of data records using commands in the programming language.
    If, on the other hand, you are using project methods as inherited forms for table forms, you can also use the automatic operations for records management.
  • Just like table forms, project forms can have a form method that you can call up on the Methods page in the Explorer.

You can convert a table form into a project form and vice versa at any time. Please note, however, that when converting to project forms, the automatic data management operations will no longer work. In addition, the form type “List form” or “List form for printing” is converted into a project form of the “Page” type.

You can change the form type on the Forms page of the Explorer using drag and drop or copy / paste. This can be done in the same application and between two different applications.

To convert a project form to a table form and vice versa, do the following:

  1. On the Forms page of Explorer, click the form you want and drag it onto the target entry.
    When converting a project form to a table form, you must drag the form onto the name of the table to which you want to assign it.
    The form is moved when the drag and drop operation is performed within the same application. If you want to copy the form, hold down the during the drag & drop operation under Windows Alt key, on Mac OS the Option key pressed. When dragging and dropping between two different applications, the form can only be copied.
    You can also use the standard entries Cut / Copy / Paste use in the context menu of the explorer.

Dynamic forms

Product: 4D
Topic: Managing forms

4D design mode (4D v17)
4D design mode (4D v17.1)
4D design mode (4D v17.2)
4D design mode (4D v17.3)
4D design mode (4D v17.4)
4D design mode (4D v17.5)