[PATCH] user32: Handle VK_RETURN KeyDown events more properly in EDITcontrols.

Reece Dunn msclrhd at googlemail.com
Sat Apr 19 06:05:45 CDT 2008


On 19/04/2008, El. <eth.bell at gmail.com> wrote:
> >
> > You need to add a test case first to confirm that the fix is correct, and
> > use EDIT_IsInsideDialog to detect if the parent is dialog.
>
> Well I'm not sure what to test in the first place, I didn't assume that
> modifying some aspect of the code to be in compliance with official
> "standards" required writing any test case.
>
> I might be missing what you mean by the "correctness" of the fix,
> since I'm not really familiar with Wine's patching practices.
>
> http://msdn2.microsoft.com/en-us/library/bb775464(VS.85).aspx

Reading the MSDN documentation for the behaviour of ES_MULTILINE, it
says "When the multiline edit control is in a dialog box, the default
response to pressing the ENTER key is to activate the default button.
To use the ENTER key as a carriage return, use the ES_WANTRETURN
style."

Therefore, I think your patch is incomplete, especially the part about
the ES_WANTRETURN style. As such, you will need tests to verify this.

In response to the enter key there are three behaviours:
1.  the default push button is not activated; the edit contents is unchanged.
2.  the default push button is activated; the edit contents is unchanged.
3.  the default push button is not activated; the edit contents has a
new line inserted at the current cursor position.

You have the following configurations with their associated behaviours:
  *  an edit control in a dialog without ES_MULTILINE and without
ES_WANTRETURN: behaviour (2).
  *  an edit control in a dialog with ES_MULTILINE and without
ES_WANTRETURN: behaviour (2).
  *  an edit control in a dialog with ES_MULTILINE and with
ES_WANTRETURN: behaviour (3).
  *  an edit control not in a dialog without ES_MULTILINE and without
ES_WANTRETURN: behaviour (1).
  *  an edit control not in a dialog with ES_MULTILINE and without
ES_WANTRETURN: behaviour (3).
  *  an edit control not in a dialog with ES_MULTILINE and with
ES_WANTRETURN: behaviour (3).

This is how I interpret that part of the MSDN documentation. This
gives you the test cases needed to verify that your fix works in all
these possibilities. It also ensures that someone wanting to improve
the edit control does not regress this functionality, or breaks
something else in the process.

Thank you for improving Wine,
- Reece



More information about the wine-devel mailing list