aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src/menu
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-11-06 00:10:46 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-11-06 00:10:46 +0000
commite520f12663f97a3ca7e609d0d6f6bf91dc88e675 (patch)
treecb9d138b9d89caeae5b2cea644b56f41d2d059c5 /unicode/src/menu
parentf91602a117ca03e9237f041953a462716c4c43f8 (diff)
downloadusdx-e520f12663f97a3ca7e609d0d6f6bf91dc88e675.tar.gz
usdx-e520f12663f97a3ca7e609d0d6f6bf91dc88e675.tar.xz
usdx-e520f12663f97a3ca7e609d0d6f6bf91dc88e675.zip
- IsNumericChar/... and other character class type functions moved to UUnicodeUtils.pas
- UCS4 to UTF8 converters added. Nice for changing single characters (e.g. MyString[i] := 'de') - Player names are now UTF8 - DeleteLastLetter is UTF8 now git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1504 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'unicode/src/menu')
-rw-r--r--unicode/src/menu/UMenuText.pas24
1 files changed, 13 insertions, 11 deletions
diff --git a/unicode/src/menu/UMenuText.pas b/unicode/src/menu/UMenuText.pas
index 3fc60384..24c7eae6 100644
--- a/unicode/src/menu/UMenuText.pas
+++ b/unicode/src/menu/UMenuText.pas
@@ -78,7 +78,7 @@ type
procedure SetText(Value: string);
property Text: string read TextString write SetText;
- procedure DeleteLastL; //Procedure to Delete Last Letter
+ procedure DeleteLastLetter; //Procedure to Delete Last Letter
procedure Draw;
constructor Create; overload;
@@ -88,8 +88,10 @@ type
implementation
-uses UGraphic,
- StrUtils;
+uses
+ UGraphic,
+ UUnicodeUtils,
+ StrUtils;
procedure TText.SetSelect(Value: boolean);
begin
@@ -242,17 +244,17 @@ begin
AddBreak(LastBreak, Length(Value)+1);
end;
-procedure TText.DeleteLastL;
+procedure TText.DeleteLastLetter;
var
- S: string;
- L: integer;
+ Str: UCS4String;
+ Len: integer;
begin
- S := TextString;
- L := Length(S);
- if (L > 0) then
- SetLength(S, L-1);
+ Str := UTF8ToUCS4String(TextString);
+ Len := Length(Str);
+ if (Len > 0) then
+ SetLength(Str, Len-1);
- SetText(S);
+ SetText(UCS4ToUTF8String(Str));
end;
procedure TText.Draw;