srow, scol, erow, ecol (AUI_CONTROL)

Updated April 2015; see History

(Num)  These coordinates determine the position and size of the control, based on the grid according to the following options and considerations. For controls in the main window, the units are normally based on the main window grid. For controls within dialogs, the units are normally based on the parent Dialog Grid Units. In either case, they may be specified in rows and columns (whole units), or for more precision, Millirows and Millicolumns. There are two notable exceptions, triggered by the MBF2_PIXCOORDS and/or MBF2_PIXSIZE flags in ctype2. In the case of MBF2_PIXCOORDS, the coordinates are interpreted in units of display pixels, and negative values for erow and ecol are taken as relative to the bottom and right edge of the parent control. MBF2_PIXSIZE (with or without MBF2_PIXCOORDS) causes erow and ecol to be interpreted as the height and width, respectively, of the control in pixels.

See History below for details on using negative grid coordinates to specify the control position relative to the right/bottom edges of the parent control, rather than the top/left edges.

Regardless of the units, child control positioning is always relative to the client area of the parent control, which may be determined implicitly or by an explicit parentid. Many different control types can serve as a parent control, including the Groupbox Control, Static Text Control, Tab Control as well as all kinds of dialog controls. For the main window and dialogs, there may be a small amount of internal margin, such that srow and/or scol values of 1 (or 1000 milli-units) may not be flush against the top or left edge of the parent client area. To rectify that, use the MBF2_STICKY flag. To make the right or bottom edge of the child control extend to the right or bottom edge of the parent, set the erow and/or ecol values slightly larger than necessary and MBF2_STICKY will adjust them as needed.

The position of dialog controls may be relative to the main window or to the physical screen; see Dialog Positioning for details.

For the Toolbar Control, the coordinates should be set to all zero for them to auto-adjust to the dimensions of the main window. The one exception is if you want to split a horizontal toolbar into left and right parts, in which case set ecol the ending column for the left toolbar and scol to the starting column for the right toolbar.

See Also

Alternate Dialog Coordinate System

History

2015 April, A-Shell 6.1.1407:  AUI refinement: the logic that auto-deletes controls with conflicting coordinates now ignores controls belonging to a TAB control parent. The main purpose of the auto-deletion is to accommodate automatic conversion of text-based programs to GUI, but such program would not involve a TAB control, for which there is no text-based analog. On the other hand, some programs involving TAB controls might purposefully create child controls for multiple panels and AUI would have no way of distinguishing these because all the panels share the same effective parent ID.

2014 February, A-Shell 6.1.1377:  AUI_CONTROL enhancement / behavioral change: negative grid coordinates are now interpreted as relative to the bottom/right edges of the parent control. When using grid coordinates, srow/scol values < 0, and/or erow/ecol values <=0 are interpreted as relative to the bottom and right edge of the parent control. This was already the case for MBF2_PIXCOORDS but now works for grid coordinates. Warning: this does eliminate an ancient but probably unused feature in which negative coordinate values were assumed to be pixels. If you want to use pixel coordinates, you should use MBF2_PIXCOORDS.

2013 November, A-Shell 6.1.1368:  Introduce support for split toolbars, allow for negative erow and ecol values with with MBF2_PIXCOORDS.