Progress
Programming
Handbook
Grids
Progress allows the user to use grids to align widgets within frames. A grid is a framework of crisscrossed bars whose width and height you can control by setting the appropriate attributes. Figure 24–5 shows how a grid appears on screen.
Figure 24–5: Grid
![]()
The dots in Figure 24–5 are called visible grid points. The distance between two of these small dots is called a minor grid unit. The distance between one grid line and another grid line is called a major grid unit. Inside each of the squares on the grid there are invisible grid points (see Figure 24–6).
Figure 24–6: Grid Enlargement
![]()
You can control the appearance of grids with the following attributes (these attributes apply to frames only):
- GRID–VISIBLE — Determines whether the grid is visible or not.
- GRID–FACTOR–HORIZONTAL — Determines the number of horizontal minor grid units per major unit.
- GRID–FACTOR–VERTICAL — Determines the number of vertical minor grid units per major unit.
- GRID–SNAP — Determines whether objects align to (snap to) the grid when the user moves or resizes them.
- GRID–UNIT–WIDTH–CHARS — Determines the width in character units of a minor grid unit (that is, the distance in character units between adjacent horizontal grid points).
- GRID–UNIT–WIDTH–PIXELS — Determines the width in pixels of a minor grid unit (that is, the distance in pixels between adjacent horizontal grid points).
- GRID–UNIT–HEIGHT–CHARS — Determines the height in characters of a minor grid unit (that is, the distance in character units between adjacent vertical grid points).
- GRID–UNIT–HEIGHT–PIXELS — Determines the height in pixels of a minor grid unit (that is, the distance in pixels between adjacent vertical grid points).
When the user moves a widget and the frame’s GRID–SNAP attribute is set to TRUE, the widget’s upper left corner snaps to the nearest grid point. This is true even if the GRID–VISIBLE attribute is set to FALSE. Note that widgets that are already placed in the frame are not affected when you set GRID–SNAP to TRUE. However, if you move or resize a widget in the frame, it then snaps to the nearest grid point.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |