diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-01-12 16:55:45 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-01-12 16:55:45 +0000 |
commit | 2e66e4bb6719e92c53bcbf40c82bf5d7644719cb (patch) | |
tree | 1cbb718dc4aed6b47d6ee38820072994f415fca1 /unicode/src/screens/UScreenOpen.pas | |
parent | 589f7901a9ab5595dcf026ddee3fd93477f0b46a (diff) | |
download | usdx-2e66e4bb6719e92c53bcbf40c82bf5d7644719cb.tar.gz usdx-2e66e4bb6719e92c53bcbf40c82bf5d7644719cb.tar.xz usdx-2e66e4bb6719e92c53bcbf40c82bf5d7644719cb.zip |
CharCode parameter of ParseInput changed from WideChar to UCS4Char (as some chars might reguire two WideChar).
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1565 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | unicode/src/screens/UScreenOpen.pas | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/unicode/src/screens/UScreenOpen.pas b/unicode/src/screens/UScreenOpen.pas index 8c03ba50..ac524f4c 100644 --- a/unicode/src/screens/UScreenOpen.pas +++ b/unicode/src/screens/UScreenOpen.pas @@ -33,8 +33,22 @@ interface {$I switches.inc} -uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, UMenuText, - ULyrics, Math, gl, UThemes; +uses + SDL, + SysUtils, + Math, + gl, + UMenu, + UMusic, + UFiles, + UTime, + USongs, + UIni, + ULog, + UTexture, + UMenuText, + ULyrics, + UThemes; type TScreenOpen = class(TMenu) @@ -49,25 +63,34 @@ type procedure AddBox(X, Y, W, H: real); constructor Create; override; procedure onShow; override; - function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; + function ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: Boolean): Boolean; override; // function Draw: boolean; override; // procedure Finish; end; implementation -uses UGraphic, UDraw, UMain, USkins; -function TScreenOpen.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; +uses + UGraphic, + UDraw, + UMain, + USkins, + UUnicodeUtils; + +function TScreenOpen.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: Boolean): Boolean; begin Result := true; if (PressedDown) then begin // Key Down // check normal keys case CharCode of - '0'..'9', 'a'..'z', 'A'..'Z', ' ', '-', '.', ':', '\': + Ord('0')..Ord('9'), + Ord('a')..Ord('z'), + Ord('A')..Ord('Z'), + Ord(' '), Ord('-'), Ord('.'), Ord(':'), Ord('\'): begin if Interaction = 0 then begin - Text[TextN].Text := Text[TextN].Text + CharCode; + Text[TextN].Text := Text[TextN].Text + UCS4ToUTF8String(CharCode); end; end; end; |