diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-06-07 11:54:05 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-06-07 11:54:05 +0100 |
commit | a2b5993aa613179fa314148e0ce407e9d9148f51 (patch) | |
tree | cb9f9067942c12b0c73e212c2a557cd89b08f061 /src/gui | |
parent | 65d726c89d65a4830e7d304a471c9f81b407f784 (diff) | |
download | fpGUI-a2b5993aa613179fa314148e0ce407e9d9148f51.tar.xz |
Adds support for OnKeyChar event to TfpgMemo
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_memo.pas | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas index 57b2ec05..351ed269 100644 --- a/src/gui/fpg_memo.pas +++ b/src/gui/fpg_memo.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2012 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -147,6 +147,7 @@ type property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnEnter; property OnExit; + property OnKeyChar; property OnKeyPress; property OnShowHint; end; @@ -1058,11 +1059,14 @@ var s: string; ls: string; begin - inherited; + inherited HandleKeyChar(AText, shiftstate, consumed); + if consumed then + Exit; //==> + prevval := Text; s := AText; - if (not consumed) and (not ReadOnly) then + if (not ReadOnly) then begin // Printable characters only // Note: This is now UTF-8 compliant! @@ -1082,15 +1086,13 @@ begin FSelEndLine := -1; AdjustCursor; end; - consumed := True; end; if prevval <> Text then if Assigned(FOnChange) then FOnChange(self); - end; - + end; { if not ReadOnly } if consumed then RePaint; |