diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2015-02-28 17:50:50 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2015-02-28 17:50:50 +0000 |
commit | 84ea4a9d626333ffb52288cdee64a766c3c70029 (patch) | |
tree | 542e7c20a345922f514c39ba5d43da709bd801a3 /src | |
parent | 5b9207c200f5a026f98a47d7188f3645d9bdb07f (diff) | |
download | fpGUI-84ea4a9d626333ffb52288cdee64a766c3c70029.tar.xz |
bug: Improved tokenizer to correctly extract font name for Font Dialog.
Before the tokenizer didn't accept a font name that contain the @ or - symbols,
thes the font name listbox never had any selection shown.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_dialogs.pas | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 7cb1ee20..42f4752c 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -739,13 +739,31 @@ var result := c; end; + function LookAhead: char; + var + i: integer; + lc: char; + begin + i := cp+1; + if i > length(desc) then + lc := #0 + else + lc := desc[i]; + result := lc; + end; + procedure NextToken; begin token := ''; - while (c <> #0) and (c in [' ','a'..'z','A'..'Z','_','0'..'9']) do + while (c <> #0) and (c in [' ', 'a'..'z', 'A'..'Z', '_', '@', '0'..'9']) do begin token := token + c; NextC; + if (c = '-') and (LookAhead in [' ', 'a'..'z', 'A'..'Z', '_']) then + begin + token := token + c; + NextC; + end; end; end; |