View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026769 | Lazarus | LCL | public | 2014-09-24 10:35 | 2014-09-25 08:33 |
Reporter | Assigned To | Zeljan Rikalo | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x64 (with x86 compiler) | OS | Windows | ||
Product Version | 1.3 (SVN) | ||||
Target Version | 1.2.6 | Fixed in Version | 1.3 (SVN) | ||
Summary | 0026769: TMemo calls OnEditingDone when pressing Enter | ||||
Description | When editing text in a TMemo, pressing enter (e.g. to go to a new line), OnEditingDone is called. See example program. IMO this is not expected as the user is still editing inside the control. | ||||
Tags | event, patch | ||||
Fixed in Revision | 46320 | ||||
LazTarget | 1.2.6 | ||||
Widgetset | Win32/Win64 | ||||
Attached Files |
|
2014-09-24 10:35 developer |
|
|
custommemo.inc.patch (774 bytes)
Index: custommemo.inc =================================================================== --- custommemo.inc (revision 46308) +++ custommemo.inc (working copy) @@ -203,6 +203,17 @@ end; {------------------------------------------------------------------------------ + Prevents false firing of the OnEditingDone event if the memo accepts the + RETURN key for new-line input. + ------------------------------------------------------------------------------} +procedure TCustomMemo.KeyUpAfterInterface(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_RETURN) and FWantReturns then + Key := 0; + inherited; +end; + +{------------------------------------------------------------------------------ Method: TCustomMemo.SetLines Params: Returns: |
|
The attached patch seems to fix the issue, at least for Windows (other environments not tested) |
|
custommemo-v2.patch (1,398 bytes)
Index: include/custommemo.inc =================================================================== --- include/custommemo.inc (revision 46308) +++ include/custommemo.inc (working copy) @@ -203,6 +203,17 @@ end; {------------------------------------------------------------------------------ + Prevents false firing of the OnEditingDone event if the memo accepts the + RETURN key for new-line input. + ------------------------------------------------------------------------------} +procedure TCustomMemo.KeyUpAfterInterface(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_RETURN) and FWantReturns then + Key := 0; + inherited; +end; + +{------------------------------------------------------------------------------ Method: TCustomMemo.SetLines Params: Returns: Index: stdctrls.pp =================================================================== --- stdctrls.pp (revision 46308) +++ stdctrls.pp (working copy) @@ -816,6 +816,7 @@ procedure RealSetText(const Value: TCaption); override; function GetCachedText(var CachedText: TCaption): boolean; override; function GetCaretPos: TPoint; override; + procedure KeyUpAfterInterface(var Key: Word; Shift: TShiftState); override; procedure SetCaretPos(const Value: TPoint); override; procedure SetLines(const Value: TStrings); procedure SetSelText(const Val: string); override; |
|
Sorry - forgot to include the declaration in the stdctrl unit... "custommemo-v2.patch" should work. |
|
Problem reproducible on Linux x64 GTK2; confirmed patch works there. |
|
Please test and close if ok. |
|
Thanks all! |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-09-24 10:35 |
|
New Issue | |
2014-09-24 10:35 |
|
File Added: memo_oneditingdone.zip | |
2014-09-24 11:37 |
|
Tag Attached: event | |
2014-09-24 17:32 | wp | File Added: custommemo.inc.patch | |
2014-09-24 17:33 | wp | Note Added: 0077593 | |
2014-09-24 17:43 | wp | File Added: custommemo-v2.patch | |
2014-09-24 17:44 |
|
Tag Attached: patch | |
2014-09-24 17:46 | wp | Note Added: 0077595 | |
2014-09-24 18:13 |
|
Note Added: 0077597 | |
2014-09-25 08:19 | Zeljan Rikalo | Fixed in Revision | => 46320 |
2014-09-25 08:19 | Zeljan Rikalo | LazTarget | - => 1.2.6 |
2014-09-25 08:19 | Zeljan Rikalo | Note Added: 0077627 | |
2014-09-25 08:19 | Zeljan Rikalo | Status | new => resolved |
2014-09-25 08:19 | Zeljan Rikalo | Fixed in Version | => 1.3 (SVN) |
2014-09-25 08:19 | Zeljan Rikalo | Resolution | open => fixed |
2014-09-25 08:19 | Zeljan Rikalo | Assigned To | => Zeljan Rikalo |
2014-09-25 08:19 | Zeljan Rikalo | Target Version | => 1.2.6 |
2014-09-25 08:33 |
|
Note Added: 0077628 | |
2014-09-25 08:33 |
|
Status | resolved => closed |