[Next] [Previous ] | Chapter18 |
Style | Description |
MLS_BORDER |
Creates an MLE with a surrounding border |
MLS_DISABLEUNDO |
Specifies that the MLE should ignore undo actions. |
MLS_HSCROLL | Specifies that the MLE should have a horizontal scrollbar. |
MLS_IGNORETAB |
Specifies that the MLE should ignore the tab key and instead pass the WM_CHAR message to its owner. |
MLS_READONLY |
Creates an MLE that is read-only. |
MLS_WORDWRAP |
Specifies that the MLE should wrap words to the next line that do not fit on the current line. |
MLS_VSCROLL | Specifies that the MLE should have a vertical scrollbar. |
Format |
Description |
CR-LF |
A carriage return (CR) followed by a line feed (LF) denotes the end of a line. |
LF |
LF denotes the end of a line |
Windows MLE
|
On import, CR CR LF is ignored, and CR LF is interpreted as end of
line. On export, CR LF is used to specify end of line and CR CR LF is
used to denote line breaks caused by word wrapping. |
MLE1.C
MLE1.RC MLE1.H MLE1.MAK MLE1.DEF
|
| |
Figure 18.1 MLE control. |
Gotcha! The MLM_DISABLEREFRESH message does not work as advertised; instead of disabling display updates and disabling the mouse pointer, it simply disables the mouse pointer. A better way to perform this action is to use the WinEnableWindowUpdate function specifying FALSE as the second parameter (and reenabling using the same function with TRUE as the second parameter). Also, the MLM_DISABLEREFRESH message disables the mouse systemwide, instead of just over itself, which can be quite annoying for operations that take up large amounts of time. An application that is guilty of this is System Editor, readers can start the editor and read a file that is greater than 500K to see an example of this. |
The main difference between this sample and the previous two is the addition of the function exportText. Its purpose is to read, line by line the contents of the MLE and to write each line to a file. To do this, we make use of the MLM_QUERYLINECOUNT, MLM_CHARFROMLINE, and MLM_QUERYLINELENGTH messages. First, we need to determine how many lines are in the MLE; the first message does this.
Gotcha! The MLM_QUERYLINECOUNT takes as its parameter an insertion point instead of a line number, as would be imagined. |
Format |
Description |
MLFSEARCH_CASESENSITIVE | If set, only exact matches are considered a successful match.
If not set, any case-combination of the correct characters in the
correct sequence is considered a successful match. |
MLFSEARCH_SELECTMATCH | If set, the MLE selects the text and scrolls it into view when found,
just as if the application had sent an MLM_SETSEL message. This is not
done if MLFSEARCH_CHANGEALL is also indicated. |
MLFSEARCH_CHANGEALL | Using the MLE_SEARCHDATA structure specified in mpParm1, all occurrences of pchFind are found, searching from iptStart to iptStop, and replacing them with pchReplace. If this style is selected, the cchFound field has no meaning, and the iptStart
value points to the place where the search stopped, or is the same as
iptStop because the search has not been stopped at any of the found
strings. The current cursor location is not moved. However, any
existing selection is deselected. |
Gotcha! The MLM_SETFONT message is the only way to change the font of an MLE control. WinSetPresParam will not work as it does with the other window classes. |
Undo support is provided through three messages: MLM_UNDO, which actually performs the und