ctype2

Updated December 2018; see History

This is an extension of the ctype parameter, and specifies any valid combination of options from the following table. The symbols come from ashell.def.

Symbol

Value

Description

MBF2_STICKY

&h00000001

Causes child control to "stick" to the edge of the parent container, if otherwise close to or overlapping the edge. Starting with A-Shell 6.0.1261, it also applies to MBF2_DLGNOCAP dialogs. Prior to 6.1.1355, to activate, the scol coordinate must be 1. After 1355, this is still true for the left edge but stickiness can now apply to the right edge independent of the left. To stick the right edge to the parent's right edge, the ecol coordinate must be larger than the maximum coordinate of the parent. 

MBF2_DLGICON

&h00000010

May be used with MBF_DIALOG to cause the dialog to display the application icon on its title bar. This is equivalent to MBF_DLGNOPARENT except without the other aspects of MBF_DLGNOPARENT (i.e. retains the parent child relationship).

MBF2_PIXCOORDS

&h00000020

Allows the coordinates of a control to be specified in pixels rather than in row/col units.

MBF2_PIXSIZE

&h00000080

Causes erow and ecol to be interpreted as the desired control height and width (respectively) in pixels. May be combined with MBF2_PIXCOORDS, in which case srow and scol are interpreted as coordinates while erow and ecol are interpreted as height and width. As of A-Shell build 5.1.1176, may also be used with dialogs. Previously was only supported for child controls. If used with MBF_DIALOG and MBF_ALTPOS, the dialog borders and caption dimensions will be added to erow and ecol so that the resulting dialog's client area will be of the requested size; otherwise the erow and ecol will determine the outer dimensions of the dialog.

MBF2_NOTHEME

&h00000100

Disables theme (visual style) for the control. In the case of MBF_GROUPBOX, this also causes the control to be manually drawn by A-Shell rather than by Windows, allowing the FGC and BGC values to be taken into account. (Otherwise, the themed version of a groupbox ignores the FGC value, and only applies the BGC value to the background of the text.) Note that for the new implementation, you must use an RGB value for FGC and/or BGC if you want custom colors. (For black, you should use &h00010101 rather than &h00000000 to avoid any confusion with palette color numbers, which range from 0-15.)

MBF2_CUSTDRAW

&h00000200

Causes A-Shell to draw the control, rather than let Windows draw it. Generally this is a bad idea (a lot of work, guaranteed never to match the way Windows does it). But, sometimes it is useful, in order to implement a visual variation that Windows does not support. Currently there are only two control types this applies to: MBF_GROUPBOX (see notes for MBF2_NOTHEME) and MBF_STATIC. In the case of MBF_STATIC, the MBF2_CUSTDRAW flag allows us to create variations of the standard rectangular static control (rounded corner rectangles, ellipses, circles, and controls with a border matching the text color.) To get any of these effects, combine MBF2_CUSTDRAW with MBF2_ROUNDRECT or MBF2_ELLIPSE.

MBF2_ROUNDRECT

&h00000400

Causes the corners of the static control be slightly rounded. This is only noticeable if the BGC parameter is set to an RGB value, or if the WS_BORDER flag is used.

MBF2_DLGNOCAP

&h00000800

Creates a dialog with no caption. Such a dialog is effectively anchored to its parent, as if it were a child control, except that it can host its own child controls. These dialogs are positioned using the same logic as for child controls.

MBF2_ELLIPSE

&h00000800

Causes the control to have an elliptical rather than rectangular shape. As with MBF2_ROUNDRECT, the effect is invisible unless you define a non-standard BGC value or use the WS_BORDER flag.

If the display width and height of an ellipse are equal, you have a circle. Unfortunately, at present, there is no good way to calculate how many columns are needed to match a particular number of rows or millirows, so circles may end up as ellipses. (Actually, you could use the MBF2_PIXCOORD flag to specify the dimensions in pixels, and that would work, but leads to a different problem which is how to calculate the desired number of pixels. (We may need to add another flag to force the width of the ellipse to match the height so that you end up with a perfect circle, regardless of the window aspect ratio or resolution.)

MBF2_RESIZE

&h00001000

May be used with an MBF_ALTPOS dialog to allow it to be resized with the mouse. The range of resizing is from 50% of the original dialog size to maximized.

MBF2_STATICWIN

&h00004000

Creates a static child control window that looks something like a dialog box but can be used as a variation of a group box.

MBF2_TABX

h00008000

Combine with MBF_TAB (ctype) for the TabX Control variation of the Tab control. Set SBR=AUTO_TABX to automatically convert all Tab controls to TabX controls.

MBF2_NOMOVE

&h00040000

Prevents a dialog from being moved. This does not interfere with the ability to minimize, maximize or resize the dialog, which are controlled by other options (MBF_MODELESS, MBF_MAXBUTTON, and MBF2_RESIZE, respectively). See History note below.

MBF2_MINBUTTON

&h000080000

Used with MBF_SYSMENU to add a minimize button to a modal dialog. A minimize button is not normally allowed in this case, because if the dialog is minimized, it may make the parent window appear to be unresponsive. But if you are sure that won't be a problem (perhaps you've made the dialog's parent invisible already), you can force the minimize button option with this flag (in the cflag2 parameter).

MBF2_FNTPTSIZE

&h00100000

Interpret font scale factors as points (x 10) rather than as a percentage.

MBF2_DLGMWFNTGRID

&h00100000

May be used with captionless dialogs based on the main window grid (i.e. without MBF_ALTPOS) to force the text controls within the dialog to use the same font scaling logic as the main window uses. This is mainly of use when the Misc Settings font scaling option is non-zero—i.e. when the main window controls use a font scaled to the main window grid. In particular, if you are using the MX_AUTOPARENT and AUTOTPRINT features to run a non-GUI-aware program in a dialog, this allows you to scale the dialog and the fonts within it to the main window size. Note: due to context, this function does not conflict with the one above having the same value.

MBF2_DLGSTATE

&h00200000

Can be specified with MBF_DIALOG to cause the previous last state (normal or maximized) and position of the dialog to override the state and position specified in the AUI_CONTROL statement. The saved state is keyed to the combination of the current program name and the dialog control name, so you must use an alphanumeric control name. MBF2_DLGSTATE overrides the MBST_xxxx options relating to dialog positioning—e.g. MBST_CENTER, etc. The system parameter OPTIONS=AUTODLGSTATE allows you to make the MBF2_DLGSTATE option be the default for all dialogs. Dialogs with the MBF2_DLGSTATE option are moved back to the default position if the previously saved position is no longer visible due to a monitor configuration change. The dialog is considered visible if enough of its caption bar is visible to reasonably be able to spot it and drag it. This allows you to deliberately set the dialog's initial position so that only a fraction of its title bar is visible. Note that saved coordinates are ignored—i.e. reset back to the design coordinates—if the design coordinates have changed since the dialog was last saved, or if the dialog no longer fits entirely within the virtual desktop space.

MBF2_GDIPLUS

&h00400000

Set for images using the GDI Plus library. Set automatically for some image types and mainly of internal interest; may be set manually to force images with <32 bpp to use the GDI. See Disabled and Hot Images.

MBF2_GLOBAL

&h00800000

May be specified for a clickable control to make it active even when not part of the current modal dialog. It has the additional effect of changing the default parent from the current modal dialog to the main window, if applicable. This is the only way you can create a control outside of the current modal dialog.

MBF2_NOAUTOPARENT

&h01000000

Overrides the normal logic for defaulting the parent of a new control that doesn't specify an explicit parent. Normally, if the new control does not specify a parent and a modal dialog exists, the new control is assigned that dialog as its parent. With this flag set, the main window (ctl #0) would instead become the default parent.

Hex-Decimal Values

History

2018 December, A-Shell 6.4.1651:  the MBF2_NOMOVE flag may now be set when creating the control to stifle the logic which otherwise shifts the control up and/or to the left as needed so that it fits in within the parent window.

2014 Feburary, A-Shell 6.1.1376:  Added MBF2_DLGMWFNTGRID

2013 July, A-Shell 6.1.1356:  Added MBF2_NOAUTOPARENT

2012 May, A-Shell 6.0.1250:  Added MBF2_DLGSTATE

2012 May, A-Shell 6.0.1249:  Added MBF2_FNTPTSIZE