SizeToFit Command

The SizeToFit command adjusts the size of the current cell to fit its content

SizeToFit <#1>

where

Notes

  1. This command works for all cells except for GroupBox cells. It must be called after setting all content of the cell (e.g., text, images, menu items, etc.) to get the correct size.
  2. Most cells adjust both width and height. These changes may cause elements to line up differently. If needed, you can realign the elements by setting their offset property (available to all cells). Another options, which is most useful for TextCells, is to use tabwidth 0 to resize width of the cell without changing its height.
  3. For TextCells and ButtonCells, the padding is added only to the width direction.
  4. For TextField cells, the width will remain the same and the height will be adjusted to display all the text. Any padding will be added to the height. The resulting height can be restricted by setting the MinHeight and MaxHeight properties of the TextField cell. The default minimum height is 44 which is the minimum needed to properly display a vertical scroll bar. The default maximum height is unlimited.
  5. For PopupMenuEdit cells, only the width will be adjusted and it will be set to displayed the longest menu item. Any padding will be added to the width.
  6. Padding is ignored for PaneBar cells.