4D v13.4Inserting and organizing form objects |
||
|
4D v13.4
Inserting and organizing form objects
Inserting and organizing form objects
You can add objects to forms in several ways:
Once the object is placed in the form, you can modify its characteristics using the Form editor. You can work with two types of objects in your forms:
Before you can perform any operation on an object (such as changing a line width or font), you need to select the object that you want to modify. To select an object using the toolbar:
To select an object using the Property List:
To deselect an object, click outside the object’s boundary or Shift+click the object. Note: It is also possible to select objects by double-clicking them in the result window of an overall search in the database (see Renaming). If you have difficulty selecting an object that was created by the Form Wizard, switch to the background page by clicking on the button or by choosing 0 in the pages menu and try again. You can also hold down Alt (Windows) or Option (Mac OS) and click on an object on page 0 in order to access it directly. You may want to perform the same operation on more than one form object — for example, to move the objects, align them, or change their appearance. 4D lets you select several objects at the same time. There are several ways to select multiple objects:
The figure below shows a marquee being drawn to select two objects: To deselect an object that is part of a set of selected objects, hold down the Shift key and click the object. The other objects remain selected. To deselect all the selected objects, click outside the boundaries of all the objects. You can duplicate any object in the form, including active objects. Copies of active objects retain all the properties of the original, including name, type, standard action, display format, and object method. When duplicating a variable, you can use specific duplication features that allow you to include an automatic number in the copies’ names. For more information on this point, refer to Duplicating on a matrix. To duplicate one or more objects:
The "Duplicate Many" dialog box appears when you select one or more object(s) and choose the Duplicate Many... command from the Object menu.
You can move any graphic or active object in the form including fields and objects created with a template. When moving an object, you have the following options:
As you begin dragging the selected object, its handles disappear. 4D displays markers that show the location of the object’s boundaries in the rulers so that you can place the object exactly where you want it. Be careful not to drag a handle. Dragging a handle resizes the object. You can press the Shift key to carry out the move with a constraint. When the magnetic grid is on, objects are moved in stages indicating noticeable locations. For more information about this point, refer to Using the magnetic grid. To move an object one pixel at a time:
To move an object by steps:
4D lets you group objects so that you can select, move, and modify the group as a single object. Objects that are grouped retain their position in relation to each other. You would typically group a field and its label, an invisible button and its icon, and so forth. Groups can be part of other groups. When you resize a group, all the objects in the group are resized proportionally (except text areas, which are resized in steps according to their font sizes. Groups of objects are necessary for the coordinated functioning of radio buttons (see Radio Buttons and Picture Radio Buttons). They are also used to synchronize Grouped Scrollable Areas. You can ungroup a group of objects to treat them as individual objects again. An active object that has been grouped must be ungrouped before you can access its properties or method. However, it is possible to select an object belonging to a group without degrouping the set: to do this, Ctrl+click (Windows) or Command+click (Mac OS) on the object (the group must be selected beforehand). Grouping only affects objects in the Form editor. When the form is executed, all grouped objects (except for radio buttons and scrollable areas) act as if they were ungrouped. Note: It is not possible to group objects belonging to different views and only those objects belonging to the current view can be grouped (see Using object views ). To group objects:
To ungroup an object:
You can align objects with each other or using an invisible grid on the form.
The alignment tools in the toolbar (see Form editor) and in the Align submenu of the Object menu allow you to quickly align selected objects. When 4D aligns objects, it leaves one selected object in place and aligns the remaining objects to that one. This object is the “anchor.” It uses the object that is the furthest in the alignment’s direction as the anchor and aligns the other objects to that object. For instance, if you want to perform a right alignment on a set of objects, the rightmost object will be used as the anchor. The Alignment Assistant allows you to perform any type of alignment and/or distribution of objects. To display this dialog box, select the objects you want to align then choose the Alignment command from the Align submenu in the Object menu or from the context menu of the editor.
You can preview the results of the alignment by clicking the Preview button. The objects are then aligned in the Form editor but since the dialog box does not go away, you can still cancel or apply the alignment. Note: This dialog box allows you to align and distribute objects in one operation. For more information on how to distribute objects, refer to Distributing objects. The Form editor provides a virtual magnetic grid that can help you place and align objects in a form. Magnetic alignment of objects is based on their position in relation to each other. The magnetic grid can only be used when at least two objects are present in the form. This works as follows: When you move an object in the form, 4D indicates possible locations for this object based on noticeable alignments with other form objects. A noticeable alignment is established each time that:
When this happens, 4D places the object at the location and displays a red line indicating the noticeable alignment taken into account: Concerning the distribution of objects, 4D proposes a distance based on interface standards. Like with magnetic alignment, red lines indicate the noticeable differences once they are reached. This operation applies to all types of form objects. The magnetic grid can be enabled or disabled at any time using the Turn Magnetic Grid On command in the Form menu or in the editor context menu. It is also possible to set the activation of this feature by default on the Forms Page of the application Preferences. You can manually activate or deactivate the magnetic grid when an object is selected by pressing the Ctrl (Windows) or Control (Mac OS) key . Note: The magnetic grid also influences the manual resizing of objects. You can distribute objects so that they are set out with an equal amount of space between them. To do this, you can distribute objects using either the Distribute tools in the Tools palette or the Alignment Assistant. The latter allows you to align and distribute objects in one operation. Note: When the magnetic grid is on, a visual guide is also provided for distribution when an object is moved manually. For more information, refer to the previous section. To distribute objects with equal spacing:
To distribute objects using the Align and Distribute dialog box:
Note: This dialog box lets you combine object alignment and distribution. For more information about alignment, refer to Aligning objects. You will sometimes have to rearrange objects that are obstructing your view of other objects in the form. For example, you may have a graphic that you want to appear behind the fields in a form. 4D provides four menu items, Move to Back, Move to Front, Up One Level and Down One Level that let you “layer” objects on the form. These layers also determine the default entry order (see Modifying data entry order). The figure below shows objects in front of and behind other objects: To move an object to another level, select it and choose:
Note: When several objects are superimposed, the Ctrl+click / Command+click shortcut can be used to select each object successively by going down a layer with each click. When ordering different levels, 4D always goes from the background to the foreground. As a result, the previous level moves the selection of objects one level towards the background. The next level moves the selection one level towards the foreground of the form. The Use as Template command, available in the context menu of the editor when an object is clicked, saves the clicked object as a template. This template and its properties will then be used when creating all objects of the same type. In the following example, the command is applied to a Text object. All Text objects created afterwards will use the properties of the designated object by default:
A customized template can be used for each object type. There is a single customized template per object type for the entire database. The template saves all object properties set when the command was executed, with the exception of fixed coordinates and the object method (if applicable). To modify or replace an object template, you must create a new one for the object type in question. You can also remove all object templates (and go back to the standard template) using the Clear Custom Templates command in the Object menu of the Form editor. When you select this command, a confirmation dialog box appears. If you validate this dialog box, all the object templates are reset to their default values. |
PROPERTIES
Product: 4D |