532 Commits

Author SHA1 Message Date
Dylan Smith
e7b68a20fd richedit: Implemented ITextServices_TxSendMessage. 2009-01-21 11:55:22 +01:00
Dylan Smith
902afbc65b richedit: Prevented using NULL hwnd for certain operations.
Certain operations will simply not be done for windowless richedit
controls, such as WM_PAINT which isn't done for windowless richedit
controls since ITextServices provides a TxDraw method.
2009-01-21 11:55:03 +01:00
Dylan Smith
05c788ac6f richedit: Used ITextHost methods to avoid using window handle directly.
The methods in ITextHost are mostly thin wrappers around functions that
take a handle to a window as their first parameter.  This patch just
uses the wrapper functions provided by ITextHost instead of using the
functions that require a handle to a window that the editor might now
have (for windowless richedit controls).
2009-01-21 11:54:43 +01:00
Dylan Smith
6c4dda009e richedit: Implemented ITextHost for windowed richedit controls. 2009-01-21 11:54:26 +01:00
Dylan Smith
b4babc16bb richedit: EM_SETTEXTEX detects ascii richtext with Unicode codepage. 2009-01-19 12:46:41 +01:00
Dylan Smith
89f88a49a4 richedit: Store an internal copy of the window style flags. 2009-01-16 12:35:28 +01:00
Dylan Smith
e6fedf879c richedit: Implemented the horizontal scrollbar. 2009-01-15 14:13:38 +01:00
Dylan Smith
fcabbbf30f richedit: Zoom in and out with mouse wheel with control held. 2009-01-14 14:22:37 +01:00
Andrew Talbot
8ddf6c0a25 riched20: Declare some functions static. 2009-01-13 15:53:43 +01:00
Dylan Smith
f885d40d67 richedit: Store mouse captured state rather than calling GetCapture.
Windowless richedit control will not be able to call GetCapture without
a handle to the host window (and there is no ITextHost_TxGetCapture
method), but there is a ITextHost_TxSetCapture method available for
setting and releasing the capture on the mouse.  This means that the
richedit control will need to keep track of whether it has captured the
mouse or not to implement windowless richedit controls.
2009-01-12 14:42:02 +01:00
Dylan Smith
8089d980d1 richedit: Set bEmulateVersion10 initially to avoid retroactive changes.
Previously the WM_NCCREATE was handled by the as if it was always for
later versions, then the window proc for version 1.0 would make
appropriate changes afterwards.  Instead both versions should call the
same function (e.g. ME_MakeEditor) and provide the value for
bEmulateVersion10 to make the code clearer.
2009-01-12 14:40:11 +01:00
Dylan Smith
603be645d2 richedit: Pressing enter adds newline on WM_KEYDOWN rather than WM_CHAR. 2009-01-12 14:39:42 +01:00
Dylan Smith
1f6b8c7fd9 richedit: Missing condition for inserting newline before table.
This case occurs when the cursor is at the start of the table, the
table is at the start of the text, and there is no selection.
2009-01-09 14:06:13 +01:00
Dylan Smith
573102ee88 richedit: Fixed implementation of WM_GETDLGCODE message.
This fixes inconsistencies shown in the tests I added for the
WM_GETDLGCODE.  The tests covered different cases handled by the
current implementation in order to show that the native implementation
is simpler for all these cases.
2009-01-08 13:35:05 +01:00
Dylan Smith
28645c64d5 richedit: Avoid rewrapping all text for isolated format changes.
When the character or paragraph format is changed the paragraph that
is changed is already marked to be rewrapped, so ME_MarkAllForWrapping
shouldn't be called.  Since ME_RewrapRepaint uses this function, it
shouldn't be called in these circumstances, since rewrapping all the
text can cause noticable delays when working with a lot of text.
2009-01-06 12:52:09 +01:00
Dylan Smith
f361910514 richedit: Use 32-bit rather than 16-bit trackbar value for scrolling. 2009-01-06 12:44:24 +01:00
Dylan Smith
fc13c70b78 richedit: Mask window id on WM_COMMAND notifications. 2009-01-04 14:59:54 +01:00
Dylan Smith
7a54306008 richedit: Fix unicode truncation on EM_GETLINE message. 2009-01-03 14:55:30 +01:00
Dylan Smith
c9977df853 richedit: Prevented a dereference of a freed pointer.
On WM_DESTROY the editor was getting freed, then it was used to obtain
a handle to the editor.  This patch moves it just before the editor is
freed within ME_DestroyEditor.
2008-12-27 20:22:53 +01:00
Maarten Lankhorst
ac85a76b2d riched20: Fix cast for dwCookie. 2008-12-23 18:51:05 +01:00
Dylan Smith
5dc1271ba6 richedit: Move message handling to function callable without window.
In order to make the message handling available to windowless richedit
controls, the message handling must be in a function that can be
called from the ITextServices_TxSendMessage method.  This method will
never have a handle to a window to pass to RichEditWndProc_common in
order to get the editor with GetWindowLongPtrW, but passing the editor
will work (even if hWnd is NULL).
2008-12-20 11:43:44 +01:00
Dylan Smith
dc03b6b2f2 richedit: Removed redundant editor height variables and calculations.
During wrapping there were three different heights that were being
stored, with only one of them being done correctly.  The other ones
failed to incorporate the height of the paragraph or row, so ended up
being incorrect.
2008-12-20 11:43:09 +01:00
Dylan Smith
297716e01c richedit: Made sure text is offset by formatting rectangle.
The formatting rectangle is set with EM_SETRECT, and retrieved with
EM_GETRECT, so it corresponds to rcFormat in the code.  This defines the
area that the richedit control should draw the text so that it is
offset by the top-left corner of the formatting rectangle, and clipped
so that it doesn't draw past the bottom or right hand side.  Thus this
is important for implementing windowless richedit controls to not
interfere with the rest of the window.
2008-12-18 14:19:40 +01:00
Dylan Smith
c87ca3d9e8 richedit: Move implementation of WM_CHAR to its own function. 2008-12-16 14:10:25 +01:00
Dylan Smith
e5f5dc60a7 richedit: Removed some unnecessary SendMessage calls to itself. 2008-12-16 14:10:19 +01:00
Dylan Smith
c7c2ff1fbc richedit: Move implementation of EM_GETTEXTEX to its own function. 2008-12-16 14:09:47 +01:00
Dylan Smith
4f41972b15 richedit: Move implementation of EM_GETTEXTRANGE to its own function.
The RichEditWndProc_common function is big enough already by handling
all the window messages, so moving code to handle a message to its own
function makes the code more readable.
2008-12-16 14:09:40 +01:00
Dylan Smith
7e94a230e1 richedit: Removed unused hwndEdit variable for the RTF parser.
There is no reason for the rich text format parser to need a handle to
the window, and even if there were it has a handle to the editor which
contains a handle to the window.  It is better to remove this
considering we need to cut down on the use of window handles to
implement windowless richedit controls.
2008-12-15 13:20:01 +01:00
Dylan Smith
8ab0570d02 richedit: Removed an unnecessary call to GetScrollInfo.
The vertical scrollbar state is stored internally within the control,
so should be used when possible.  This will become more necessary when
windowless richedit controls are implemented, and there will no hWnd
to pass to GetScrollInfo.
2008-12-15 13:16:20 +01:00
Dylan Smith
0c8e4b6d02 richedit: Compare editor rather than hWnd in ME_CalculateClickCount.
Comparing the editor as apposed to the handle to the window will work
just as well right now, but will also work when there is no window
handle to make a comparison with, which will be the case with
windowless richedit controls.
2008-12-15 13:16:08 +01:00
Dylan Smith
6901e0cec7 richedit: Use ME_EnsureVisible to implement EM_SCROLLCARET.
The code for the ME_EnsureVisible function does exactly what
EM_SCROLLCARET does, yet this code is duplicated in order to handle
this message.  It is simpler to just use the existing function to
implement the message, and avoid internally sending the EM_SCROLLCARET
when this function is available.
2008-12-15 13:15:56 +01:00
Dylan Smith
1e8df4351d richedit: Removed unused ME_AutoURLDetect function. 2008-11-17 13:57:56 +01:00
Dylan Smith
ea9f343c33 richedit: Update strings and comments regarding IME Status messages. 2008-11-17 13:12:35 +01:00
Andrew Talbot
affc6e029c riched20: Sign-compare warnings fix. 2008-11-06 11:09:41 +01:00
Michael Stefaniuc
90024d03b2 riched20: Remove superflous casts. 2008-11-04 11:26:12 +01:00
Dylan Smith
09802e2c76 richedit: Handle negative position given to EM_POSFROMCHAR. 2008-10-29 11:52:18 +01:00
Dylan Smith
4c28a5bcfb richedit: Fixed initial word wrap setting when emulating 1.0. 2008-10-27 12:01:37 +01:00
Dylan Smith
46d79b0363 richedit: Fixed EM_POSFROMCHAR for pos of text length.
For some reason EM_POSFROMCHAR was returning 0 when the position was
equal to the end of the text, or beyond the end of the text. Instead
it should use the position at the end of the text for both these
cases.  The x value was also seen to be offset by 1 according to the
tests.
2008-10-22 13:54:54 +02:00
Dylan Smith
5bcb15dd7f richedit: Handle ctrl-key shortcuts on WM_KEYDOWN. 2008-10-22 13:54:53 +02:00
Dylan Smith
c70f6a3933 richedit: Use the DefWindowProc to implement WM_SETREDRAW. 2008-10-20 11:37:27 +02:00
Dylan Smith
197f3f4c23 richedit: Added EM_SETMARGINS to the list of unsupported messages. 2008-10-13 11:41:55 +02:00
Dylan Smith
1d21d24a51 richedit: Show arrow cursor over scrollbar. 2008-10-06 13:54:49 +02:00
Dylan Smith
4785c2fa2d richedit: ES_AUTOHSCROLL window style disables word wrapping. 2008-10-06 13:52:25 +02:00
Dylan Smith
bdf181b4d3 richedit: Use RTF reader for text starting with {\urtf. 2008-10-06 13:49:12 +02:00
Dylan Smith
2aa69c6c9e richedit: Prevent buffer overrun for tab stops buffer. 2008-09-12 12:35:29 +02:00
Dylan Smith
fab258022e richedit: Fixed bugs in handling unterminated nested tables in RTF. 2008-09-12 11:55:43 +02:00
Dylan Smith
0d8e9e622f richedit: Make sure the nested tables' RTF properties are not skipped. 2008-09-12 11:55:30 +02:00
Dylan Smith
d7ff24378a richedit: Enter inserts newline before table at start of document. 2008-09-12 11:55:22 +02:00
Dylan Smith
0843768919 richedit: Enter at the end of a table row appends a new row. 2008-09-12 11:55:14 +02:00
Dylan Smith
88a3a8a9c0 richedit: Don't put cursor in the table row start paragraph. 2008-09-12 11:55:08 +02:00