Commit Graph

660 Commits

Author SHA1 Message Date
Dylan Smith 1181bb762f richedit: Prevent copying PARAFORMAT2 fields from PARAFORMAT struct.
If a EM_SETPARAFORMAT message is sent to the richedit control with bits
in the dwMask field that correspond to PARAFORMAT2 fields, then these
fields should be ignored.  Instead data was copied from outside of the
structure.
2009-01-16 12:56:57 +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 9a902f358b richedit: Added tests for initial options.
Using the WS_VSCROLL style causes the ES_AUTOVSCROLL option to be set,
and using the WS_HSCROLL style causes the ES_AUTOHSCROLL flag to be
set (except with richedit v1.0).
2009-01-16 12:35:17 +01:00
Dylan Smith 77a94bed98 richedit: Fix implementation of handling Page Up/Down keys. 2009-01-16 12:34:54 +01:00
Dylan Smith e6fedf879c richedit: Implemented the horizontal scrollbar. 2009-01-15 14:13:38 +01:00
Dylan Smith 01ee55a8f6 richedit: Clip painting to formatting rectangle. 2009-01-15 14:13:31 +01:00
Dylan Smith b81144b350 richedit: Correct limitations on values for setting zoom ratio. 2009-01-14 14:22:43 +01:00
Dylan Smith fcabbbf30f richedit: Zoom in and out with mouse wheel with control held. 2009-01-14 14:22:37 +01:00
Dylan Smith b70b3e893f richedit: Added tests for zooming.
The contents of the text can be zoomed in with EM_SETZOOM, or with the
mouse wheel.  EM_SETZOOM is implemented, but these tests show bugs in
the implementation, and zooming using the mouse wheel isn't
implemented at all yet.
2009-01-14 14:22:26 +01:00
Andrew Talbot d287e88691 riched20: Declare some functions static. 2009-01-14 12:40:40 +01:00
Andrew Talbot 8ddf6c0a25 riched20: Declare some functions static. 2009-01-13 15:53:43 +01:00
Austin Lund c607ab96b6 riched20/tests: Added ITextServices::TxSetText test. 2009-01-12 16:53:18 +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 ee19ec056a richedit: Prevent an unsigned integer underflow. 2009-01-12 14:40:30 +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 576ff4b104 richedit: Tested EM_CHARFROMPOS with position outside of control. 2009-01-12 14:38:57 +01:00
Dylan Smith 55d9e95892 richedit: Added tests for autoscrolling options based on WS_V/HSCROLL. 2009-01-12 14:38:36 +01:00
Dylan Smith a1aaf97c11 richedit: Added tests to show that options are stored internally. 2009-01-12 14:38:17 +01:00
Juan Lang cfd1a6317d riched20: Add stub IOleClientSite interface. 2009-01-10 14:49:46 +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 c636b59bcf richedit: Added tests for WM_GETDLGCODE message. 2009-01-08 13:34:53 +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 6df4148b04 richedit: Prevent redundant rewraps when scrollbar is shown.
A common case for richedit controls are that a large amount of text is
set initially with word wrap enabled.  This causes the initially
wrapping of the text, which also calculates the text length.  After
this the vertical scrollbar will be shown, which causes the text to be
rewrapped again.  After this there are two redundant rewraps that are
done which this patch eliminates.
2009-01-06 12:51:55 +01:00
Dylan Smith a16db0afc6 richedit: Scroll up with less than page of text with ES_DISABLENOSCROLL. 2009-01-06 12:51:41 +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
Alexandre Julliard 139ba41458 riched20/tests: Move the itextServicesStdcallVtbl definition to avoid a compiler warning. 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
Andrew Talbot 634dfd65f8 riched20: Remove unused Wine debug channel. 2008-12-22 10:29:02 +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 97a83147b3 richedit: Avoid re-calculating positions found in wrapping for painting.
When the text is wrapped, the positions for all the runs, paragraphs,
and cells are already calculated and stored.  The only thing left to do
for painting is to offset them by the formatting rectangle and the
scroll position.
2008-12-20 11:43:29 +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
Paul Vriens 5e66808ad3 riched20/tests: Fix tests on Win9x by using A-calls. 2008-12-19 17:16:19 +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 ced9bde4c0 richedit: Added tests for the formatting rectangle.
These tests show that there are problems with the way formatting
rectangles are currently implemented in wine.
2008-12-18 14:19:40 +01:00
Dylan Smith 62db58545e richedit: Fixed ITextHostImpl return values for tests.
There were several methods that do not have a HRESULT for a return
value, so returning E_NOTIMPL is not appropriate. For all the BOOL
return values FALSE was returned to indicate the operation was not
performed.
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
Paul Vriens 9bc409cfcb riched20/tests: Fix test failures on Win9x, WinMe and Wine in win9x mode. 2008-12-16 12:51:31 +01:00
Dylan Smith 6fa7b49825 richedit: Missing capitalization on TxGetScrollBars. 2008-12-15 13:20:09 +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