From c7b3cdcd025e2f8cc8db7db0cf01fdacefbe2255 Mon Sep 17 00:00:00 2001 From: Jean-Marc Levecque Date: Sat, 2 Mar 2013 23:17:12 +0100 Subject: Make special characters known by editcombobox --- src/gui/fpg_editcombo.pas | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/gui/fpg_editcombo.pas b/src/gui/fpg_editcombo.pas index 3887cd13..311d452f 100644 --- a/src/gui/fpg_editcombo.pas +++ b/src/gui/fpg_editcombo.pas @@ -87,6 +87,7 @@ type FSelStart: integer; FSelOffset: integer; FCursorPos: integer; + FSpecialChar: integer; procedure DoDropDown; override; function GetText: string; virtual; function HasText: boolean; virtual; @@ -523,6 +524,38 @@ var i: integer; begin prevval := FText; + 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; consumed := False; if FText = '' then @@ -584,6 +617,9 @@ var begin hasChanged := False; + if (keycode= 58536) or (keycode= 58462) then + FSpecialChar:= keycode; + if not Enabled then consumed := False else @@ -883,6 +919,7 @@ begin FDrawOffset := 0; FSelectedItem := -1; // to allow typing if list is empty FNewItem := False; + FSpecialChar := -1; CalculateInternalButtonRect; end; -- cgit v1.2.3-70-g09d2