Type: Integer (button, OCX, and table controls), Boolean (labels, edit mask, status line, and multimedia controls)
Availability: Read or write at any time
The autoSize property determines whether a control is automatically resized to fit its contents. The following example shows the use of the autoSize property.
cb_autoSize_click(checkbox: CheckBox input) updating; begin multimedia.autoSize := checkbox.value; end;
The autoSize property settings for Label controls are listed in the following table.
Value | Description |
---|---|
true | Automatically resizes the control to fit its contents. |
false | Keeps the size of the control constant (the default). Contents are clipped when they exceed the area of the control. |
When the autoSize property for a Label control is set to true, the setting of the wordWrap property also affects the meaning.
The following table lists the results on the Label class autoSize property of setting the wordWrap property.
Value | Result |
---|---|
false | Text is placed in a single line. |
true | Current width of the control is used to size the text using word wrap. This adjusts the height of the control to fit the text. If a single word cannot fit within the width, the label is widened to accommodate that word. If there is no text, the autoSize property is ignored. |
For Button controls, this property determines whether the picture of the button is resized to fit the button. The autoSize property settings for Button controls are listed in the following table.
Button Class Constant | Value | Description |
---|---|---|
AutoSize_None | 0 | No resize of the button picture (the default). |
AutoSize_Button | 1 | Button picture is resized to fit the picture. |
AutoSize_Picture | 2 | Button is resized to fit the picture. |
When the value of the autoSize property for a Button control is set to AutoSize_Picture (2), the non‑border area of the button is set to the size of the picture set in the picture property. Only the picture is displayed; the caption of the button is not displayed.
If the picture property is not set, this option is ignored. This option is ideal for creating toolbar buttons that display only an image. If the picture image includes a border, turn off the borderStyle property of the button, to avoid duplicate border images.
The autoSize property settings for Ocx controls are listed in the following table.
Ocx Class Constant | Value | Description |
---|---|---|
AutoSize_Control | 0 | Resizes the ActiveX control to the size defined by Painter or your logic (the default) |
AutoSize_Object | 1 | Resizes the ActiveX control to the size of the OLE object |
The autoSize property settings for StatusLine controls are listed in the following table.
Value | Description |
---|---|
true | The height of the status line is adjusted according to the height of any controls placed inside the status line and the font size of the caption property for the status line. |
false | The height of the status line is set by you (the default). |
If the value is false, the status line control can be resized vertically;.if true, the control cannot be manually resized. When a child control is resized, the status line control is also resized.
The autoSize property determines whether the MultiMedia control is automatically sized according to the size of the displayed image.
The autoSize property settings for MultiMedia controls are listed in the following table.
Value | Description |
---|---|
true | The device or file being played does not have a playback image, the values of the showPlayBar, showName, showMode, and showPosition properties are false, and the control has no size and is not visible. |
The size of the control is set to the size of the displayed image (multiplied by the value of the zoom property divided by 100) plus the size of any playbar and caption. If the device or file being played does not involve a playback image, the control is not visible. If the value of the zoom property is zero (0), 100 is used. | |
false | When the value of the zoom property is zero (0), the displayed image is stretched to fit the client area of the control. When the value of the zoom property is not zero, the control size is not affected by the size of the displayed image. Only as much of the displayed image that fits in the client area of the control is displayed. |
The autoSize property settings for Table controls are listed in the following table.
Table Class Constant | Value | Description |
---|---|---|
AutoSize_None | 0 | No automatic sizing |
AutoSize_Row | 1 | Row resized to fit the table |
AutoSize_Column | 2 | Column resized to fit the table |
AutoSize_Both | 3 | Row and column resized to fit the table (the default) |
AutoSize_ColumnMinimum | 4 | Column resized to the minimum |
AutoSize_BothColumnMinimum | 5 | Both row and column resized to the column minimum |
The code fragment in the following example shows the use of the autoSize property for the Table class.
table1.autoSize := comboAutoSize.listIndex - 1;
When the autoSize property for the Table control is set to:
AutoSize_None (0), each column is set to 50 pixels wide and the height of rows is set to the size of a single line of text using the default font for that table.
AutoSize_Row (1), the height of rows is set so that all cells in the row can be fully displayed vertically, with the text determined by the font and picture.
Row automatic sizing has little effect on tables unless you include unstretched pictures in cells, as row heights are set automatically within the table according to the text size and font (which may require word wrap).
Text in table cells wraps only when the value of the autoSize property is set to AutoSize_Row (1).
AutoSize_Column (2), the width of columns is set so that all cells in the column can be fully displayed horizontally without word wrapping. The text is determined by the font and picture. The width of the columns is padded, as described following this list.
AutoSize_Both (3), the width of columns is established, followed by the height of the row.
The width of the columns is padded, as described following this list.
AutoSize_ColumnMinimum (4), the column is resized to the minimum size (that is, the size of the cell).
AutoSize_BothColumnMinimum (5), both the width of the column and then the height of the row are resized to the minimum size.
When using the AutoSize_Both and AutoSize_Column values, if all columns fit within the client width of the table control, the width of each column is incremented so that the columns are stretched to exactly fit the table client width. If not all columns fit within the table client width, the AutoSize_Row and AutoSize_Column values are equivalent to the AutoSize_ColumnMinimum and AutoSize_BothColumnMinimum values.
If you require both column and row automatic sizing, the width of the column is established, followed by the height of the row. When the autoSize property is set to AutoSize_None (0), cells have a minimum width of 50 pixels.
When the property is set to a Table class constant representing a non-zero value, cells have a minimum width of 20 pixels, even when they are empty. If a user resizes a row or a column or your JADE logic specifically sets the row height or column width, the automatic sizing of the row or column no longer applies at any subsequent change of cell contents.
The autoSize property of the JadeEditMask class determines whether a control is automatically resized to fit its contents. If the value of autoSize is false (the default), the height of the child text box or text boxes is set to the height of the edit mask control. If the last field is a text box child, it has its width expanded to the right edge of the control. Any labels that are defined in the mask are centered vertically in the control. However, if the top position or the height of a text box child is set by the mask property, the text box children are automatically sized except for any specific width or height settings defined in the mask for a child. If there is insufficient room to show a full single line of text in a child text box, the height of the control is expanded regardless of the setting of the autoSize property.
If the value of autoSize is true, the size of the control is determined by the maximum size and height of the literal and text data that can be entered into that field according to the value of the mask property (a single line of text).
The size is based on the largest character that can be entered into each character position, which generally means that the control is larger than required. For example, a mask of three alphabetic characters WWW takes up considerably more space than iii.
In addition, the size can be larger than required because the prompt character requires more space than the character for which it is prompting. The fields of the control are always defined according to the maximum size of the characters in that field, regardless of the value of the autoSize property.