This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
OBJECT GET BEST SIZE
|
OBJECT GET BEST SIZE ( {* ;} object ; bestWidth ; bestHeight {; maxWidth} ) | ||||||||
Parameter | Type | Description | ||||||
* | Operator |
![]() |
If specified = object is an object name (String) If omitted = object is a variable | |||||
object | Form object |
![]() |
Object name (if * is specified) or Field or variable (if * is omitted) | |||||
bestWidth | Longint |
![]() |
Optimum object width | |||||
bestHeight | Longint |
![]() |
Optimum object height | |||||
maxWidth | Longint |
![]() |
Maximum object width | |||||
The OBJECT GET BEST SIZE command returns the bestWidth and bestHeight parameters, the “optimal” width and height of the form object designated by the * and object parameters. These values are expressed in pixels. This command is particularly useful for displaying or printing complex reports, associated with the OBJECT MOVE command.
If you pass the optional * parameter, this indicates that the object parameter is an object name (a character string). If you do not pass the * parameter, this indicates that object is a field or a variable. In this case, do not pass a string but rather a field or variable reference (object type only).
The optimal values returned indicate the minimum size of the object so that its current contents are entirely included within the limits. Usually these values are only meaningful for objects containing text. This calculation takes the font, font size, font style and object contents into account. It also takes hyphenation and carriage returns into consideration. Note that in the case of 3D buttons, the command works even when button contains only an icon. If the object specified is empty, the bestWidth returned is 0.
The size returned does not take into account any graphic frame applied around the object, nor any scrollbars. To obtain the real size of an object on screen, it is necessary to add the width of these elements.
The optional maxWidth parameter enables you to attribute a maximum width to the object. If the optimal width of the object is greater than this value, OBJECT GET BEST SIZE returns maxWidth in the bestWidth parameter and increases the optimal height as a consequence.
The following objects are handled by this command:
For all other form object types (group areas, tabs, rectangles, straight lines, circles/ovals, external areas, etc.), the OBJECT GET BEST SIZE command returns the current object size (defined in the form editor and possibly using the OBJECT MOVE command).
Refer to the example in the SET PRINT MARKER command.
Product: 4D
Theme: Objects (Forms)
Number:
717
Created: 4D 2003
Renamed: 4D v12 (BEST OBJECT SIZE)
4D Language Reference ( 4D v20 R7)