4D v13.4

Duplicating on a matrix

Home

 
4D v13.4
Duplicating on a matrix

Duplicating on a matrix  


 

 

Sometimes you may want to place several similar active objects in a form at the same time, numbering them sequentially so that their names are unique. For example, you may want to create a series of buttons that perform database operations. Duplicating on a matrix has the additional advantage of quickly and easily aligning multiple objects. 

You can either duplicate an active object on a matrix manually or use the Duplicate Many dialog box, which allows you to quickly populate the matrix. 

To duplicate one or several objects using the Duplicate Many dialog box:

  1. Select the object(s) you want to duplicate.
  2. Select Duplicate Many... from the Object menu.
    The Duplicate Many dialog box appears:
  3. In the Matrix area, enter the number of lines and columns as well as the offset between them.
    For more information about this point, refer to “Duplicating Objects” in Inserting and organizing form objects.
  4. Select the “Number Variables” option.
    This option is enabled only if you selected a variable.
  5. Select the order of the numbering.
    If you select the Line(s) option, 4D will number active objects from left to right starting from the top towards the bottom (line by line). If you select the Column(s) option, 4D will number active objects from top to bottom starting from the left towards the right (column by column).
    The objects are copied and numbered according to your settings.
  6. Click the OK button.
    You will obtain the number of columns and rows of objects requested.

  1. Select the Matrix tool in the object bar (variation of the Rectangle group) and create a matrix on the form.
    Make sure that each cell in the matrix is large enough to contain the object you want to duplicate.
  2. In the “Grid” theme of the Property List, set the number of rows and columns of the Matrix.
  3. Set the appearance of the matrix using the options in the Appearance theme (optional).
    You can set the border style, the line thickness, the color, and the fill pattern.
  4. Make sure the cells in the matrix are large enough to contain the object that you want to duplicate.
  5. Create a new active object and place it in the upper left cell of the matrix.
  6. Select both the object and the matrix.
  7. Choose Duplicate on Matrix... from the Object menu.
    4D copies the active object into each cell in the matrix, giving each active object a unique number.

The objects are copied along with their size and style properties as well as their associated method (where applicable).
4D numbers the active objects from top to bottom in each column. These numbers are added to the object name for each object, thus creating a unique object in every matrix cell.

Note: To number the series of active objects from left to right in each row, hold down the Shift key when you choose Duplicate on Matrix in the Object menu.

You can refer to these objects in methods using the names they have been given. You can delete the matrix or leave it in the form.

 
PROPERTIES 

Product: 4D
Theme: Building forms