Program Manager Alias | markcarr |
Developer Alias | FelixA |
Test Reviewer (if appropriate) | |
Technical Editor (if appropriate) | |
Title | RCML |
Filename | RCML |
Version | 1.0 |
Team/Group | Apps+ as part of Win+ |
Feature Area | UI Presentation |
For internal user only, or OK for external distribution | Internal Use. |
Summary Design Goals File Definition Rendering Data-Binding Usage |
Open Issues For More Information Change History Appendices Testing |
RCML is a new resource file format, that is designed to provide access to more Win32 UI features than existing RC files. In addition to the RC file format, there is an enhance version of DialogBox that works hand in hand with the RCML file to make use of the enhanced data in the RCML file.
RCML exposes current technology used in Win32 applications today, which currently are underused or require menial coding efforts to make use of, here are a list of examples / deficiencies.
In addition it is a goal that the existing DialogProc can be re-used, as is, with no alterations.
There will be a tool provided that will convert existing (static) dialogs into RCML file format.
Leveraging new features require minimal change to the RCML file, and where possible will resemble HTML like syntax (e.g. STYLE elements).
The resulting RCML file will then be bound back into the resources for the application, and used/referenced like any other RC file format. This allows the RC dialogs to participate in the whole RC file (including access to ICONS, BMPs etc).
The file format will be extensible, but any elements not understood by the loader will be skipped in their entirety. This allows other applications to inject elements into the RCML stream for their own private use. Access to these skipped elements may be provided at runtime through the XMLDialogProc.
The file definition will support all existing Dialog resources, by simply exposing all the current properties as properties on the CONTROL element. Higher level elements will be substituted where applicable (e.g. <BUTTON> rather than <CONTROL CLASS="BUTTON" STYLE=xxxx SYLTEEX=yyyy>).
Elements support so far:
Control is the base element for specifying the type location size and style of windows controls. This is the base element for all higher level controls.
ATTRIBUTES : ID CLASS TEXT WIDTH HEIGHT X Y STYLE WINDOWSTYLE STYLEEX
ELEMENTS : LOCATION STYLE HELP
The toplevel element, derives from CONTOL.
ATTRIBUTES : TITLE FONT FONTSIZE RESIZE (see also CONTROL)
ELEMENTS : STYLE CONTROL BUTTON EDIT LIST LABEL
A push button. See control for more attributes / elements.
ATTRIBUTE : DEFPUSHBUTTON
ELEMENTS : (see control)
A check button. See control for more attributes / elements.
ATTRIBUTE : (see also control)
ELEMENTS : (see control)
An edit control. See control for more attributes / elements.
ATTRIBUTE : CLASSIFICATION LENGTH (see also control)
ELEMENTS : (see control)
A GroupBox control. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A Static / Label control. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A Spinner (msctls_updown32) control. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A Slider (msctls_trackbar32) control. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A progressbar (msctls_progress32) control. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A combobox (COMBO) control. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A combobox (COMBO) control. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A more complex version of LISTBOX (SysListView32). See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
A control capable of displaying an image. Expect to support GIF JPEG PNG and Alpha levels. See control for more attributes / elements.
ATTRIBUTE :
ELEMENTS : (see control)
This element contains all manner of additional help related to the control, including "TOOLTIP" "BALLOONTIP" "CONTEXT"
ATTRIBUTE : TOOLTIP BALLOONTIP CONTEXT
ELEMENTS :
The location element is used to specify a relative location for a control (required RELATIVE=YES attribute on the parent element).
ATTRIBUTE : X Y WIDTH HEIGHT EDGE WIDER TALLER
ELEMENTS : <NONE>
Example:
<BUTTON X=10 Y=10 WIDTH=40 HEIGHT=10 TEXT="OK" ID="1"/>
<BUTTON RELATIVE="YES" TEXT="Cancel" ID="2">
<LOCATION Y="+14" EDGET="0"/>
</BUTTON>
This will produce two buttons one at (10,10) the other at (10,24). The width and height of the Cancel button will be inherited from the OK button, and will be 40 and 10 respectively. The buttons will 'move' in a group, so changing the X=10 to X=120 will place BOTH buttons on the right hand edge of the dialog.
To obtain an 'intra' control spacing, the delta can be made from the bottom left corner of the control.
<BUTTON X=10 Y=10 WIDTH=40 HEIGHT=10 TEXT="OK" ID="1"/>
<BUTTON RELATIVE="YES" TEXT="Cancel" ID="2">
<LOCATION Y="+4" EDGET="3"/>
</BUTTON>
This ensures that there is always a gap of 4 DLUs between controls, regardless of the height of the previous control.
The style element is similar to the style element in HTML.
ATTRIBUTE : FONT-FAMILY FONT-SIZE FONT-STYLE FONT-WEGHT BACKGROUND-COLOR
COLOR
ELEMENTS : <NONE>
You should refer to the W3C documentation for the meaning of these attributes. If the style element is added at the dialog level, all child controls 'inherit' this style. HOWEVER if a child specifies its own STYLE element, this overrides ALL the styles, there is no 'merging' of attributes. This is work in progress.
In addition to Style and Location
Default Style for control classes, e.g.
<STYLE ID="BUTTON" COLOR="LightBlue" />
<BUTTON TEXT="Cancel" ID="2" .../>
</BUTTON>
Results in a LightBlue colored button.
Default Style for control classes, e.g.
<STYLE ID="BUTTON" COLOR="LightBlue" />
<STYLE ID="OKBUTTON" COLOR="Red" />
<BUTTON TEXT="OK" ID="1" STYLEID="OKBUTTON"/>
</BUTTON>
Would result in a Red OK button, but all other buttons would be LightBlue.
Here is the set of information provide about their style bits:
If you create a button by specifying the BUTTON class with the CreateWindow or CreateWindowEx function, you can specify a combination of the button styles in the following table.
Style | RCML | Meaning |
---|---|---|
BS_3STATE | TRISTATE="YES" | Creates a button that is the same as a check box, except that the box can be grayed as well as checked or cleared. Use the grayed state to show that the state of the check box is not determined. |
BS_AUTO3STATE | implied by TRISTATE="YES" | Creates a button that is the same as a three-state check box, except that the box changes its state when the user selects it. The state cycles through checked, grayed, and cleared. |
BS_AUTOCHECKBOX | CHECKBOX is by default, autocheckbox. | Creates a button that is the same as a check box, except that the check state automatically toggles between checked and cleared each time the user selects the check box. |
BS_AUTORADIOBUTTON | RADIODUTTON is by default, auto. | Creates a button that is the same as a radio button, except that when the user selects it, The system automatically sets the button's check state to checked and automatically sets the check state for all other buttons in the same group to cleared. |
BS_CHECKBOX | <CHECKBOX> | Creates a small, empty check box with text. By default, the text is displayed to the right of the check box. To display the text to the left of the check box, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style). |
BS_DEFPUSHBUTTON | DEFPUSH="YES" | Creates a push button that behaves like a BS_PUSHBUTTON style button, but also has a heavy black border. If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful for enabling the user to quickly select the most likely (default) option. |
BS_GROUPBOX | <GROUP> | Creates a rectangle in which other controls can be grouped. Any text associated with this style is displayed in the rectangle's upper left corner. |
BS_LEFTTEXT | By default. | Places text on the left side of the radio button or check box when combined with a radio button or check box style. Same as the BS_RIGHTBUTTON style. |
BS_OWNERDRAW | Creates an owner-drawn button. The owner window receives a WM_MEASUREITEM message when the button is created and a WM_DRAWITEM message when a visual aspect of the button has changed. Do not combine the BS_OWNERDRAW style with any other button styles. | |
BS_PUSHBUTTON | <BUTTON> | Creates a push button that posts a WM_COMMAND message to the owner window when the user selects the button. |
BS_RADIOBUTTON | <RADIOBUTTON> | Creates a small circle with text. By default, the text is displayed to the right of the circle. To display the text to the left of the circle, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style). Use radio buttons for groups of related, but mutually exclusive choices. |
BS_USERBUTTON | Obsolete. | Obsolete, but provided for compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAW instead. |
BS_BITMAP | IMAGE="..." | Specifies that the button displays a bitmap. |
BS_BOTTOM | Use VERTICAL-ALIGN="BOTTOM" | Places text at the bottom of the button rectangle. |
BS_CENTER | Use TEXT-ALIGN="JUSTIFY" | Centers text horizontally in the button rectangle. |
BS_ICON | IMAGE="..." | Specifies that the button displays an icon. |
BS_FLAT | Use BORDER-STYLE="FLAT" | Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D image. |
BS_LEFT | Use TEXT-ALIGN="LEFT" | Left-justifies the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is left justified on the right side of the check box or radio button. |
BS_MULTILINE | MULTI-LINE="YES" | Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle. |
BS_NOTIFY | Enables a button to send BN_KILLFOCUS and BN_SETFOCUS
notification messages to its parent window.
Note that buttons send the BN_CLICKED notification message regardless of whether it has this style. To get BN_DBLCLK notification messages, the button must have the BS_RADIOBUTTON or BS_OWNERDRAW style. |
|
BS_PUSHLIKE | Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked. | |
BS_RIGHT | Use TEXT-ALIGN="RIGHT" | Right-justifies text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is right justified on the right side of the check box or radio button. |
BS_RIGHTBUTTON | Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style. | |
BS_TEXT | Default. | Specifies that the button displays text. |
BS_TOP | Use VERTICAL-ALIGN="TOP" | Places text at the top of the button rectangle. |
BS_VCENTER | Use VERTICAL-ALIGN="center" | Places text in the middle (vertically) of the button rectangle. |
To create a combo box using the CreateWindow or CreateWindowEx function, specify the COMBOBOX class, appropriate window style constants, and a combination of the following combo box styles.
Style | RCML | Description |
---|---|---|
CBS_AUTOHSCROLL | Automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed. | |
CBS_DISABLENOSCROLL | Shows a disabled vertical scroll bar in the list box when the box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items. | |
CBS_DROPDOWN | Similar to CBS_SIMPLE, except that the list box is not displayed unless the user selects an icon next to the edit control. | |
CBS_DROPDOWNLIST | Similar to CBS_DROPDOWN, except that the edit control is replaced by a static text item that displays the current selection in the list box. | |
CBS_HASSTRINGS | Specifies that an owner-drawn combo box contains items consisting of strings. The combo box maintains the memory and address for the strings so the application can use the CB_GETLBTEXT message to retrieve the text for a particular item. | |
CBS_LOWERCASE | Converts to lowercase all text in both the selection field and the list. | |
CBS_NOINTEGRALHEIGHT | Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, the system sizes a combo box so that it does not display partial items. | |
CBS_OEMCONVERT | Converts text entered in the combo box edit control from the Windows character set to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the CharToOem function to convert a Windows string in the combo box to OEM characters. This style is most useful for combo boxes that contain file names and applies only to combo boxes created with the CBS_SIMPLE or CBS_DROPDOWN style. | |
CBS_OWNERDRAWFIXED | Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are all the same height. The owner window receives a WM_MEASUREITEM message when the combo box is created and a WM_DRAWITEM message when a visual aspect of the combo box has changed. | |
CBS_OWNERDRAWVARIABLE | Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message for each item in the combo box when you create the combo box and a WM_DRAWITEM message when a visual aspect of the combo box has changed. | |
CBS_SIMPLE | Displays the list box at all times. The current selection in the list box is displayed in the edit control. | |
CBS_SORT | Automatically sorts strings added to the list box. | |
CBS_UPPERCASE | Converts to uppercase all text in both the selection field and the list. |
To create an edit control using the CreateWindow or CreateWindowEx function, specify the EDIT class, appropriate window style constants, and a combination of the following edit control styles.
Style | RCML | Meaning |
---|---|---|
ES_AUTOHSCROLL | Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position zero. | |
ES_AUTOVSCROLL | Automatically scrolls text up one page when the user presses the ENTER key on the last line. | |
ES_CENTER | Windows NT 5.0 and later; Windows 98: Centers text
in a single-line or multiline edit control.
Earlier versions of Windows and Windows NT: Centers text in a multiline edit control. |
|
ES_LEFT | Left aligns text. | |
ES_LOWERCASE | Converts all characters to lowercase as they are typed into the edit control. | |
ES_MULTILINE | Designates a multiline edit control. The default is single-line edit control. | |
When the multiline edit control is in a dialog box, the default response to pressing the ENTER key is to activate the default button. To use the ENTER key as a carriage return, use the ES_WANTRETURN style. | ||
When the multiline edit control is not in a dialog box and the ES_AUTOVSCROLL style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If you do not specify ES_AUTOVSCROLL, the edit control shows as many lines as possible and beeps if the user presses the ENTER key when no more lines can be displayed. | ||
If you specify the ES_AUTOHSCROLL style, the multiline edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press the ENTER key. If you do not specify ES_AUTOHSCROLL, the control automatically wraps words to the beginning of the next line when necessary. A new line is also started if the user presses the ENTER key. The window size determines the position of the wordwrap. If the window size changes, the wordwrapping position changes and the text is redisplayed. | ||
Multiline edit controls can have scroll bars. An edit control with scroll bars processes its own scroll bar messages. Note that edit controls without scroll bars scroll as described in the previous paragraphs and process any scroll messages sent by the parent window. | ||
ES_NOHIDESEL | Negates the default behavior for an edit control. The default behavior hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. If you specify ES_NOHIDESEL, the selected text is inverted, even if the control does not have the focus. | |
ES_NUMBER | Allows only digits to be entered into the edit control. | |
ES_OEMCONVERT | Converts text entered in the edit control. The text is converted from the Windows character set to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the CharToOem function to convert a Windows string in the edit control to OEM characters. This style is most useful for edit controls that contain filenames. | |
ES_PASSWORD | Displays an asterisk (*) for each character typed into the edit control. You can use the EM_SETPASSWORDCHAR message to change the character that is displayed. The ES_PASSWORD style is valid only for single-line edit controls. | |
ES_READONLY | Prevents the user from typing or editing text in the edit control. | |
ES_RIGHT | Windows NT 5.0 and later; Windows 98: Right aligns
text in a single-line or multiline edit control.
Earlier versions of Windows and Windows NT: Right aligns text in a multiline edit control. |
|
ES_UPPERCASE | Converts all characters to uppercase as they are typed into the edit control. | |
ES_WANTRETURN | Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box's default push button. This style has no effect on a single-line edit control. |
To create a list box by using the CreateWindow or CreateWindowEx function, use the LISTBOX class, appropriate window style constants, and the following style constants to define the list box.
List box style | RCML | Description |
---|---|---|
LBS_DISABLENOSCROLL | Shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll. If you do not specify this style, the scroll bar is hidden when the list box does not contain enough items. | |
LBS_EXTENDEDSEL | Allows multiple items to be selected by using the SHIFT key and the mouse or special key combinations. | |
LBS_HASSTRINGS | Specifies that a list box contains items consisting of strings. The list box maintains the memory and addresses for the strings so that the application can use the LB_GETTEXT message to retrieve the text for a particular item. By default, all list boxes except owner-drawn list boxes have this style. You can create an owner-drawn list box either with or without this style. | |
LBS_MULTICOLUMN | Specifies a multicolumn list box that is scrolled horizontally. The LB_SETCOLUMNWIDTH message sets the width of the columns. | |
LBS_MULTIPLESEL | Turns string selection on or off each time the user clicks or double-clicks a string in the list box. The user can select any number of strings. | |
LBS_NODATA | Specifies a no-data list box. Specify this style when the
count of items in the list box will exceed one thousand. A no-data list
box must also have the LBS_OWNERDRAWFIXED style, but must not have the
LBS_SORT or LBS_HASSTRINGS style.
A no-data list box resembles an owner-drawn list box except that it contains no string or bitmap data for an item. Commands to add, insert, or delete an item always ignore any given item data; requests to find a string within the list box always fail. The system sends the WM_DRAWITEM message to the owner window when an item must be drawn. The itemID member of the DRAWITEMSTRUCT structure passed with the WM_DRAWITEM message specifies the line number of the item to be drawn. A no-data list box does not send a WM_DELETEITEM message. |
|
LBS_NOINTEGRALHEIGHT | Specifies that the size of the list box is exactly the size specified by the application when it created the list box. Normally, the system sizes a list box so that the list box does not display partial items. | |
LBS_NOREDRAW | Specifies that the list box's appearance is not updated when changes are made. You can change this style by sending a WM_SETREDRAW message at any time. | |
LBS_NOSEL | Specifies that the list box contains items that can be viewed but not selected. | |
LBS_NOTIFY | Notifies the parent window with an input message whenever the user clicks or double-clicks a string in the list box. | |
LBS_OWNERDRAWFIXED | Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are the same height. The owner window receives a WM_MEASUREITEM message when the list box is created and a WM_DRAWITEM message when a visual aspect of the list box has changed. | |
LBS_OWNERDRAWVARIABLE | Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message for each item in the combo box when the combo box is created and a WM_DRAWITEM message when a visual aspect of the combo box has changed. | |
LBS_SORT | Sorts strings in the list box alphabetically. | |
LBS_STANDARD | Sorts strings in the list box alphabetically. The parent window receives an input message whenever the user clicks or double-clicks a string. The list box has borders on all sides. | |
LBS_USETABSTOPS | Enables a list box to recognize and expand tab characters when drawing its strings. You can use the LB_SETTABSTOPS message to specify tab stop positions. The default tab positions are 32 dialog template units apart. Dialog template units are the device-independent units used in dialog box templates. To convert measurements from dialog template units to screen units (pixels), use the MapDialogRect function. | |
LBS_WANTKEYBOARDINPUT | Specifies that the owner of the list box receives WM_VKEYTOITEM messages whenever the user presses a key and the list box has the input focus. This enables an application to perform special processing on the keyboard input. |
To create a scroll bar control using the CreateWindow or CreateWindowEx function specify the SCROLLBAR class, appropriate window style constants, and a combination of the following scroll bar control styles. Some of the styles create a scroll bar control that uses a default width or height. However, you must always specify the x- and y-coordinates and the other dimensions of the scroll bar when you call CreateWindow or CreateWindowEx.
Style | RCML | Meaning |
---|---|---|
SBS_BOTTOMALIGN | Aligns the bottom edge of the scroll bar with the bottom edge of the rectangle defined by the x, y, nWidth, and nHeight parameters of CreateWindowEx function. The scroll bar has the default height for system scroll bars. Use this style with the SBS_HORZ style. | |
SBS_HORZ | Designates a horizontal scroll bar. If neither the SBS_BOTTOMALIGN nor SBS_TOPALIGN style is specified, the scroll bar has the height, width, and position specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx. | |
SBS_LEFTALIGN | Aligns the left edge of the scroll bar with the left edge of the rectangle defined by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The scroll bar has the default width for system scroll bars. Use this style with the SBS_VERT style. | |
SBS_RIGHTALIGN | Aligns the right edge of the scroll bar with the right edge of the rectangle defined by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The scroll bar has the default width for system scroll bars. Use this style with the SBS_VERT style. | |
SBS_SIZEBOX | Designates a size box. If you specify neither the SBS_SIZEBOXBOTTOMRIGHTALIGN nor the SBS_SIZEBOXTOPLEFTALIGN style, the size box has the height, width, and position specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx. | |
SBS_SIZEBOXBOTTOMRIGHT ALIGN |
Aligns the lower right corner of the size box with the lower right corner of the rectangle specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The size box has the default size for system size boxes. Use this style with the SBS_SIZEBOX style. | |
SBS_SIZEBOXTOPLEFTALIGN | Aligns the upper left corner of the size box with the upper left corner of the rectangle specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The size box has the default size for system size boxes. Use this style with the SBS_SIZEBOX style. | |
SBS_SIZEGRIP | Same as SBS_SIZEBOX, but with a raised edge. | |
SBS_TOPALIGN | Aligns the top edge of the scroll bar with the top edge of the rectangle defined by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The scroll bar has the default height for system scroll bars. Use this style with the SBS_HORZ style. | |
SBS_VERT | Designates a vertical scroll bar. If you specify neither the SBS_RIGHTALIGN nor the SBS_LEFTALIGN style, the scroll bar has the height, width, and position specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx. |
To create a static control using the CreateWindow or CreateWindowEx function, specify the STATIC class, appropriate window style constants, and a combination of the following static control styles.
Style | RCML | Description |
---|---|---|
SS_BITMAP | <IMAGE> | Specifies a bitmap is to be displayed in the static control. The given text is the name of a bitmap (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the bitmap. |
SS_BLACKFRAME | <RECT> & <STYLE COLOR="BLACK" BORDER-STYLE="SOLID"> | Specifies a box with a frame drawn in the same color as the window frames. This color is black in the default color scheme. |
SS_BLACKRECT | <RECT FILL="YES"> & <STYLE COLOR="BLACK" BORDER-STYLE="SOLID"> | Specifies a rectangle filled with the current window frame color. This color is black in the default color scheme. |
SS_CENTER | TEXT-ALIGN="JUSTIFY" | Specifies a simple rectangle and centers the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next centered line. Words that are longer than the width of the control are truncated. |
SS_CENTERIMAGE | FILL-BACKGROUND="YES" | Specifies that, if the bitmap or icon is smaller than the client area of the static control, the rest of the client area is filled with the color of the pixel in the top left corner of the bitmap or icon. If the static control contains a single line of text, the text is centered vertically in the client area of the control. |
SS_ENDELLIPSIS or SS_PATHELLIPSIS |
ELLIPSIS="END"
ELLIPSIS="PATH" |
Windows NT: Replaces part of the given string with
ellipses, if necessary, so that the result fits in the specified
rectangle.
You can specify SS_END_ELLIPSIS to replace characters at the end of the string, or SS_PATHELLIPSIS to replace characters in the middle of the string. If the string contains backslash (\) characters, SS_PATHELLIPSIS preserves as much of the text after the last backslash as possible. |
SS_ENHMETAFILE | <IMAGE > | Specifies an enhanced metafile is to be displayed in the static control. The given text is the name of a metafile. An enhanced metafile static control has a fixed size; the metafile is scaled to fit the static control's client area. |
SS_ETCHEDFRAME | <RECT> & <STYLE COLOR="BLACK" BORDER-STYLE="SOLID"> | Draws the frame of the static control using the EDGE_ETCHED edge style. For more information, see the DrawEdge function. |
SS_ETCHEDHORZ | Draws the top and bottom edges of the static control using the EDGE_ETCHED edge style. For more information, see the DrawEdge function. | |
SS_ETCHEDVERT | Draws the left and right edges of the static control using the EDGE_ETCHED edge style. For more information, see the DrawEdge function. | |
SS_GRAYFRAME |
<RECT> & <STYLE COLOR="GRAY"
BORDER-STYLE="SOLID">
|
Specifies a box with a frame drawn with the same color as the screen background (desktop). This color is gray in the default color scheme. |
SS_GRAYRECT | <RECT FILL="YES"> & <STYLE COLOR="GRAY" BORDER-STYLE="SOLID"> | Specifies a rectangle filled with the current screen background color. This color is gray in the default color scheme. |
SS_ICON | <IMAGE> | Specifies an icon is to be displayed in the dialog box. The given text is the name of an icon (not a filename) defined elsewhere in the resource file. The icon can be an animated cursor. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the icon. |
SS_LEFT | TEXT-ALIGN="LEFT" | Specifies a simple rectangle and left-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next left-aligned line. Words that are longer than the width of the control are truncated. |
SS_LEFTNOWORDWRAP | MULTILINE="FALSE" | Specifies a simple rectangle and left-aligns the given text in the rectangle. Tabs are expanded, but words are not wrapped. Text that extends past the end of a line is clipped. |
SS_NOPREFIX | Prevents interpretation of any ampersand (&) characters in the control's text as accelerator prefix characters. These are displayed with the ampersand removed and the next character in the string underlined. This static control style may be included with any of the defined static controls. You can combine SS_NOPREFIX with other styles. This can be useful when filenames or other strings that may contain an ampersand (&) must be displayed in a static control in a dialog box. | |
SS_NOTIFY | Sends the parent window STN_CLICKED, STN_DBLCLK, STN_DISABLE, and STN_ENABLE notification messages when the user clicks or double-clicks the control. | |
SS_OWNERDRAW | Specifies that the owner of the static control is responsible for drawing the control. The owner window receives a WM_DRAWITEM message whenever the control needs to be drawn. | |
SS_REALSIZEIMAGE | <IMAGE AUTOSIZE="NO"> | Prevents a static icon or bitmap control (that is, static controls that have the SS_ICON or SS_BITMAP style) from being resized as it is loaded or drawn. If the icon or bitmap is larger than the destination area, the image is clipped. |
SS_RIGHT | TEXT-ALIGN="RIGHT" | Specifies a simple rectangle and right-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next right-aligned line. Words that are longer than the width of the control are truncated. |
SS_RIGHTJUST | <IMAGE ..> | Specifies that the lower right corner of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon. |
SS_SIMPLE | Specifies a simple rectangle and displays a single line of left-aligned text in the rectangle. The text line cannot be shortened or altered in any way. The control's parent window or dialog box must not process the WM_CTLCOLORSTATIC message. | |
SS_SUNKEN | BORDER-STYLE=" | Draws a half-sunken border around a static control. |
SS_WHITEFRAME | <RECT> & <STYLE COLOR="WHITE" BORDER-STYLE="SOLID"> | Specifies a box with a frame drawn with the same color as the window background. This color is white in the default color scheme. |
SS_WHITERECT | <RECT FILL="YES"> & <STYLE COLOR="WHITE" BORDER-STYLE="SOLID"> | Specifies a rectangle filled with the current window background color. This color is white in the default color scheme. |
SS_WORDELLIPSIS | ELLIPSIS="WORD" | Windows NT: Truncates text that does not fit and adds ellipses. |
See Also CWnd::Create, CWnd::CreateEx
See Also CWnd::CreateEx
ANIMATE_CLASS | RCML | Creates animation controls. These controls silently display an audio video interleaved (AVI) clip. |
DATETIMEPICK_CLASS | Creates date and time picker controls. These controls provide a simple and intuitive interface to exchange date and time information with a user. | |
HOTKEY_CLASS | Creates hot key controls. These controls make it easy for the user to define hot keys. | |
MONTHCAL_CLASS | Creates month calendar controls. These controls provide a simple and intuitive way for a user to select a date from a familiar interface. | |
PROGRESS_CLASS | Creates progress bars. These controls indicate the progress of a lengthy operation. | |
REBARCLASSNAME | Creates rebar controls. These controls act as a container for child windows. | |
STATUSCLASSNAME | Creates status windows. These controls display status information in a horizontal window. | |
TOOLBARCLASSNAME | Creates toolbars. These controls contain buttons that carry out menu commands. | |
TOOLTIPS_CLASS | Creates tooltip controls. These controls display a small pop-up window containing a line of text that describes the purpose of a tool in an application. | |
TRACKBAR_CLASS | Creates trackbars. These controls let the user select from a range of values by moving a slider. | |
UPDOWN_CLASS | Creates up-down controls. These controls combine a pair of arrows with an edit control. Clicking the arrows increments or decrements the value in the edit control. | |
WC_COMBOBOXEX | Creates ComboBoxEx controls. These controls provide an extension of the combo box control that provides native support for item images. | |
WC_HEADER | Creates header controls. These controls display headings at the top of columns of information and let the user sort the information by clicking the headings. | |
WC_IPADDRESS | Creates IP address controls. These controls are similar to an edit control, but they allow you to enter a numeric address in Internet protocol (IP) format. | |
WC_LISTVIEW | Creates list view controls. These controls display a collection of items, each consisting of an icon and a label, and provide several ways to arrange the items. | |
WC_PAGESCROLLER | Creates pager controls. These controls are used to contain and scroll another window. | |
WC_TABCONTROL | Creates tab controls. These controls define multiple pages for the same area of a window or dialog box. Each page consists of a set of information or a group of controls that an application displays when the user selects the corresponding tab. | |
WC_TREEVIEW | Creates tree view controls. These controls display a hierarchical list of items. Each item consists of a label and an optional bitmap. |
The following window styles are used with animation controls:
ComboBoxEx controls support most standard combo box control styles. Additionally, ComboBoxEx controls support the following extended styles, which you can set and retrieve by using CBEM_SETEXTENDEDSTYLE and CBEM_GETEXTENDEDSTYLE messages:
Note: if you try to set an extended style for a ComboBoxEx control created with the CBS_SIMPLE style, it may not repaint properly. The CBS_SIMPLE style also does not work properly with the CBES_EX_PATHWORDBREAKPROC extended style.
The window styles listed here are specific to date and time picker controls. The DTS_XXXFORMAT styles that define the display format cannot be combined. If none of the format styles are suitable, use a DTM_SETFORMAT message to define a custom format.
DTS_APPCANPARSE | RCML | Allows the owner to parse user input and take necessary action. It enables users to edit within the client area of the control when they press the F2 key. The control sends DTN_USERSTRING notification messages when users are finished. |
DTS_LONGDATEFORMAT | Displays the date in long format. The default format string for this style is defined by LOCALE_SLONGDATEFORMAT, which produces output like "Friday, April 19, 1996". | |
DTS_RIGHTALIGN | The drop-down month calendar will be right-aligned with the control instead of left-aligned, which is the default. | |
DTS_SHOWNONE | It is possible to have no date currently selected in the control. With this style, the control displays a check box that users can check once they have entered or selected a date. Until this check box is checked, the application will not be able to retrieve the date from the control because, in essence, the control has no date. This state can be set with the DTM_SETSYSTEMTIME message or queried with the DTM_GETSYSTEMTIME message. | |
DTS_SHORTDATEFORMAT | Displays the date in short format. The default format string for this style is defined by LOCALE_SSHORTDATE, which produces output like "4/19/96". | |
DTS_SHORTDATECENTURYFORMAT | Version 5.0. Similar to the DTS_SHORTDATEFORMAT style, except the year is a four-digit field. The default format string for this style is based on LOCALE_SSHORTDATE. The output looks like: "4/19/1996". | |
DTS_TIMEFORMAT | Displays the time. The default format string for this style is defined by LOCALE_STIMEFORMAT, which produces output like "5:31:42 PM". | |
DTS_UPDOWN | Places an up-down control to the right of the DTP control to modify date-time values. This style can be used in place of the drop-down month calendar, which is the default style. |
Header controls have a number of styles, described below, that determine the control's appearance and behavior. You set the initial styles when you create the header control. To retrieve and change the styles after creating the control, use the GetWindowLong and SetWindowLong functions.
The following window styles are specific to list view controls.
For the LVS_SORTASCENDING AND LVS_SORTDESCENDING styles, item indices are sorted based on item text in ascending or descending order, respectively. Because the LVS_LIST and LVS_REPORT views display items in in the same order as their indices the results of sorting are immediately visible to the user. The LVS_ICON and LVS_SMALLICON views do not use item indices to determine the position of icons. With those views, the results of sorting are not visible to the user.
You can use the LVS_TYPEMASK mask to isolate the window styles that correspond to the current view: LVS_ICON, LVS_SMALLICON, LVS_LIST, and LVS_REPORT.
You can use the LVS_ALIGNMASK mask to isolate the window styles that specify the alignment of items: LVS_ALIGNLEFT and LVS_ALIGNTOP.
You can use the LVS_TYPESTYLEMASK mask to isolate the window styles that control item alignment (LVS_ALIGNLEFT and LVS_ALIGNTOP) and those that control header appearance and behavior (LVS_NOCOLUMNHEADER and LVS_NOSORTHEADER).
List view control styles have been extended. To use these new styles, use the LVM_SETEXTENDEDLISTVIEWSTYLE message or one of the ListView_SetExtendedListViewStyle or ListView_SetExtendedListViewStyleEx macros.
Note: To set the state of the item checkbox, use the following macro.
#ifndef ListView_SetCheckState #define ListView_SetCheckState(hwndLV, i, fCheck) \ ListView_SetItemState(hwndLV, i, \ INDEXTOSTATEIMAGEMASK((fCheck)+1), LVIS_STATEIMAGEMASK) #endif
An item becomes hot when the mouse hovers over it. If hot-tracking is enabled, hot items will be highlighted, but the user must still click the item at least once to activate it. Activating an item causes the list view control to send an LVN_ITEMACTIVATE notification. An item is activatable when it is in a state where a single click will activate it.
If the LVS_EX_ONECLICKACTIVATE style is set, only one click is required to activate any item, so all items are activatable. If the LVS_EX_TWOCLICKACTIVATE style is set, two clicks are required to activate an item. With this style, the item becomes activatable only after it has been clicked once.
Setting the LVS_EX_UNDERLINEHOT style will cause the text of a hot activatable item to be underlined. Setting the LVS_EX_UNDERLINECOLD style will cause the text of items that are activatable but not hot to be underlined.
The following are the styles used with month calendar controls.
The following window styles are used when creating pager controls.
PGS_AUTOSCROLL | The pager control will scroll when the user hovers the mouse over one of the scroll buttons. |
PGS_DRAGNDROP | The contained window can be a drag-and-drop target. The pager control will automatically scroll if an item is dragged from outside the pager over one of the scroll buttons. |
PGS_HORZ | Creates a pager control that can be scrolled horizontally. This style and the PGS_VERT style are mutually exclusive and cannot be combined. |
PGS_VERT | Creates a pager control that can be scrolled vertically. This is the default direction if no direction style is specified. This style and the PGS_HORZ style are mutually exclusive and cannot be combined. |
Progress bar controls now support control styles. You can set progress bar styles in the same way as other common controls ( CreateWindowEx, GetWindowLong, SetWindowLong). The following are the supported styles:
PBS_SMOOTH | Version 4.70. The progress bar displays progress status in a smooth scrolling bar instead of the default segmented bar. |
PBS_VERTICAL | Version 4.70. The progress bar displays progress status vertically, from bottom to top. |
RBS_AUTOSIZE | RCML | Version 4.71. The rebar control will automatically change the layout of the bands when the size or position of the control changes. An RBN_AUTOSIZE notification will be sent when this occurs. |
RBS_BANDBORDERS | Version 4.70. The rebar control displays narrow lines to separate adjacent bands. | |
RBS_DBLCLKTOGGLE | Version 4.71. The rebar band will toggle its maximized or minimized state when the user double-clicks on the band. Without this style, the maximized or minimized state is toggled when the user single-clicks on the band. | |
RBS_FIXEDORDER | Version 4.70. The rebar control always displays bands in the same order. You can move bands to different rows, but the band order is static. | |
RBS_REGISTERDROP | Version 4.71. The rebar control generates RBN_GETOBJECT notification messages when an object is dragged over a band in the control. To receive the RBN_GETOBJECT notifications, initialize OLE with a call to OleInitialize or CoInitialize. | |
RBS_TOOLTIPS | Version 4.70. Not yet supported. | |
RBS_VARHEIGHT | Version 4.70. The rebar control displays bands at the minimum required height, when possible. Without this style, the rebar control displays all bands at the same height, using the height of the tallest visible band to determine the height of other bands. | |
RBS_VERTICALGRIPPER | Version 4.71. The size grip will be displayed vertically instead of horizontally in a vertical rebar control. This style is ignored for rebar controls that do not have the CCS_VERT style. |
This section contains information about the styles used with trackbar controls.
The following window styles are used when creating tree view controls.
Version 5.0. When this style is enabled, changing the selection will automatically cause the item being selected to collapse if it was expanded, or expand if it was collapsed. The unselected item will collapse. If the user holds the CTRL key down while selecting an item, the item being unselected will not be collapsed.
The following styles are used when creating up-down controls:
UDS_ALIGNLEFT | RCML | Positions the up-down control next to the left edge of the buddy window. The buddy window is moved to the right, and its width is decreased to accommodate the width of the up-down control. |
UDS_ALIGNRIGHT | Positions the up-down control next to the right edge of the buddy window. The width of the buddy window is decreased to accommodate the width of the up-down control. | |
UDS_ARROWKEYS | Causes the up-down control to increment and decrement the position when the UP ARROW and DOWN ARROW keys are pressed. | |
UDS_AUTOBUDDY | Automatically selects the previous window in the z-order as the up-down control's buddy window. | |
UDS_HORZ | Causes the up-down control's arrows to point left and right instead of up and down. | |
UDS_HOTTRACK | The control will exhibit "hot tracking" behavior. That is, it will highlight the up and down arrows on the control as the pointer passes over them. This style requires Windows 98 or Windows NT 5. If the system is running Windows 95 or Windos NT 4, the flag is ignored. To check whether or not hot tracking is enabled, call SystemParametersInfo. | |
UDS_NOTHOUSANDS | Does not insert a thousands separator between every three decimal digits. | |
UDS_SETBUDDYINT | Causes the up-down control to set the text of the buddy window (using the WM_SETTEXT message) when the position changes. The text consists of the position formatted as a decimal or hexadecimal string. | |
UDS_WRAP | Causes the position to "wrap" if it is incremented or decremented beyond the ending or beginning of the range. |
Date |
Changes Made |
Program Manager |
13 April | Remembered to fill in this list | FelixA |
13 April | Added the MFC style explanations | FelixA |
14 April | Added the common controls. Explaining what RCML syntax to use for styles we support, and which styles we don't support. | FelixA. |
23 April | Added RESIZE="AUTOMATIC/DIRECTED", and RELATIVE="YES/ control ID" as well as the WIDER and TALLER attributes to LOCATION. |