diff options
author | Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr> | 2013-03-02 23:31:39 +0100 |
---|---|---|
committer | David Laurence Emerson <dle3ab@angelbase.com> | 2013-05-28 00:42:49 -0700 |
commit | 3efdc116e28a2db70f811670a2f3c0b62048558e (patch) | |
tree | ce6c38aad1195dcdbea37a621580abd7d1ed5981 /src | |
parent | dff1483cdade46db13e5645bb849abef017a8013 (diff) | |
download | fpGUI-3efdc116e28a2db70f811670a2f3c0b62048558e.tar.xz |
Make special characters known by memo component
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_memo.pas | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas index df16367b..71bcee56 100644 --- a/src/gui/fpg_memo.pas +++ b/src/gui/fpg_memo.pas @@ -98,6 +98,7 @@ type function GetSelectionText: TfpgString; procedure SetSelectionText(const AText: TfpgString); protected + FSpecialChar: integer; procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; @@ -479,6 +480,7 @@ begin FReadOnly := False; FUpdateCount := 0; FBorderStyle := ebsDefault; + FSpecialChar := -1; FLines := TfpgMemoStrings.Create(self); FFirstLine := 0; @@ -1060,6 +1062,38 @@ var begin inherited; prevval := Text; + if FSpecialChar> -1 then + begin + case FSpecialChar of + 58536: + case AText of + 'a': + AText:= 'â'; + 'e': + AText:= 'ë'; + 'i': + AText:= 'ï'; + 'o': + AText:= 'ö'; + 'u': + AText:= 'ü'; + end; + 58462: + case AText of + 'a': + AText:= 'â'; + 'e': + AText:= 'ê'; + 'i': + AText:= 'î'; + 'o': + AText:= 'ô'; + 'u': + AText:= 'û'; + end; + end; + FSpecialChar:= -1; + end; s := AText; if (not consumed) and (not ReadOnly) then @@ -1107,6 +1141,10 @@ begin fpgApplication.HideHint; Consumed := True; hasChanged := False; + + if (keycode= 58536) or (keycode= 58462) then + FSpecialChar:= keycode; + case CheckClipBoardKey(keycode, shiftstate) of ckCopy: begin |