Jump to content

VM SETMETRICS

From EDM2
Revision as of 17:05, 15 April 2025 by Martini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This message sets the size of each item in the value set control, the spacing between items, or both.

Syntax

param1
    USHORT fMetric;  /* Units of measurement. */

param2
    ULONG  ulItemId; /* Item information. */

Parameters

fMetric (USHORT) - input
Unit or units of measurement that are to be set for the value set control. This can be either of the following:
VMA_ITEMSIZE: If this message attribute is set, the width and height of each item is set using the values of the usItemWidth and usItemHeight parameters, respectively.
VMA_ITEMSPACING: If this message attribute is set, the horizontal and vertical spacing between each item is set using the values of the usHorzItemSpacing and usVertItemSpacing parameters, respectively.
ulItemId (ULONG) - input
Item information. This value depends on the VMA_* attribute set for the message.
If the VMA_ITEMSIZE attribute is specified, the ulItemId field is as follows:
usItemWidth (USHORT): Width to be set for each value set item, in pixels. The number of pixels specified cannot be less than 2.
usItemHeight (USHORT): Height to be set for each value set item, in pixels. The number of pixels specified cannot be less than 2.
If the VMA_ITEMSPACING attribute is specified, ulItemId field is as follows:
usHorzItemSpacing (USHORT): Amount of horizontal space to be set between each value set item, in pixels. This number does not include the space needed for selected-state and target emphasis, and for the selection cursor, because the emphasis and cursor space is automatically set by the value set control. The default spacing is 0.
usVertItemSpacing (USHORT): Amount of vertical space to be set between each value set item, in pixels. This number does not include the space needed for selected-state and target emphasis, and for the selection cursor, because the emphasis and cursor space is automatically set by the value set control. The default spacing is 0.

Returns

rc (BOOL) - returns
Success indicator.
TRUE: Item size or spacing was successfully set.
FALSE: An error occurred. The WinGetLastError function may return the following errors:
PMERR_INVALID_PARAMETERS
PMERR_PARAMETER_OUT_OF_RANGE

Remarks

Upon receiving this message, the value set redraws the control with the new width, height, and spacing specifications for each item. Any items that do not fit within the current window size are clipped. When the value set control receives a WM_SIZE (in Value Set Controls) message, which is sent when the value set window is resized, the value set control defaults the size of each item by dynamically dividing the window size by the number of rows and columns. It allows enough room for the border, selection cursor, and selection emphasis, and defaults the spacing between items to 0. To override these default settings, the application must resend the VM_SETMETRICS message.

Default Processing

The default window procedure does not expect to receive this message and therefore takes no action on it other than to return FALSE.