Jump to content

MLM_SETFORMATRECT

From EDM2
Revision as of 03:21, 28 April 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:MLM_SETFORMATRECT}} This message sets the format dimensions and mode. ==Syntax== <pre> param1 PPOINTL pFormatRect; New format dimensions.: param2 ULONG flFlags; Flags governing interpretation of dimensions.: </pre> ==Parameters== ;pFormatRect (PPOINTL) - input: New format dimensions. ::NULL: A null value sets both dimensions to the current window size. ::Other: The structure is a pair of LONGs designating the diagonally-opposite ::...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This message sets the format dimensions and mode.

Syntax

param1
PPOINTL pFormatRect; /* New format dimensions. */

param2
ULONG flFlags;     /* Flags governing interpretation of dimensions. */

Parameters

pFormatRect (PPOINTL) - input
New format dimensions.
NULL: A null value sets both dimensions to the current window size.
Other: The structure is a pair of LONGs designating the diagonally-opposite
corner of the rectangle, assuming 0,0 for the first. Therefore, they are the width
and height in pels of the format rectangle. These dimensions are used as the
word-wrap and text-size limiting boundaries. Negative values for either
dimension cause the MLE to substitute the current window size (the MLE window rectangle
minus margins).
If the rectangle specified has either or both of the limits set, and the
size is inadequate to contain the text, rc is set to FALSE and the rectangle
dimensions are replaced with the overflow amounts.
flFlags (ULONG) - input
Flags governing interpretation of dimensions.
MLFFMTRECT_MATCHWINDOW: The dimensions of the format rectangle are always to
be kept the same as the window size minus the margins. This causes the MLE
implicitly to do a MLM_SETFORMATRECT each time the window is resized, and effectively
causes any other dimensions to be ignored. Resizing of the window can cause this
setting to be automatically negated (see MLN_OVERFLOW).
MLFFMTRECT_LIMITHORZ: The width of any line in the MLE cannot exceed the given
horizontal dimension. If word-wrap is on, this limit has no effect. Word-wrap can
result in trailing blanks beyond the right limit. These do not cause an overflow
notification.
MLFFMTRECT_LIMITVERT: The vertical height of the total text, as displayed, is limited to that which fits totally within the vertical dimension of the format rectangle.

Returns

rc (BOOL) - return
Success indicator.
TRUE: Successful completion.
FALSE: An error occurred.

Remarks

The multi-line entry field control window procedure responds to this message by setting formatting dimensions and mode.

Any addition of text that causes the text to exceed the rectangle limits causes a notification before proceeding (see MLN_PIXHORZOVERFLOW and MLN_PIXVERTOVERFLOW).

Any activity that would cause the rectangle to be unable to contain the existing text (resize, undo, increasing font size, or word-wrap on or off) is rejected and results in a notification message for information (see MLN_OVERFLOW).

Default Processing

The default window procedure takes no action on this message, other than to set rc to FALSE.