Strange problem
Posted: Thu Aug 16, 2007 10:45 pm
I use TRichView for text entry in my chat software. Recently I decided I would alter the software such that it would support unicode. I ran into a strange problem.
The program uses multiple docked forms, as tabs, each with its own richview and richviewedit for sending and recieving. The OnShow event of the form creates the initial tabs (saved from last session) and then various other events during program execution may create others.
The problem is this - the tabs which are created initially have a problem with any initial typing you do within them. If you begin typing in one, the letters come out in strange order, the cursor is misplaced, and so on. If, in the creation routine, I do an AddTextNLW with some text, it shows that text as it would if unicode was not enabled... with the little blocks between each letter, despite all styles having unicode enabled. If, after it starts doing its strange typing mistakes or whatever.... I backspace the gibberish gone, or select all and delete it, then when I type it works properly.
If the tabs are created after that initial setup, the richviewedit works perfectly right from the start.
Indeed, if spellchecking is set to rvlspOnChange, there is an exception raised because the text being entered is only 1 character wide... which implies that for some reason, the tabs created at startup are losing a single character for reasons I just can't comprehend...
All styles are set to unicode, and are using the Arial Unicode MS font .. the program is massively too big (and containing commercial code) for me to paste it for people to weed through. Any ideas on where to start with this?
The program uses multiple docked forms, as tabs, each with its own richview and richviewedit for sending and recieving. The OnShow event of the form creates the initial tabs (saved from last session) and then various other events during program execution may create others.
The problem is this - the tabs which are created initially have a problem with any initial typing you do within them. If you begin typing in one, the letters come out in strange order, the cursor is misplaced, and so on. If, in the creation routine, I do an AddTextNLW with some text, it shows that text as it would if unicode was not enabled... with the little blocks between each letter, despite all styles having unicode enabled. If, after it starts doing its strange typing mistakes or whatever.... I backspace the gibberish gone, or select all and delete it, then when I type it works properly.
If the tabs are created after that initial setup, the richviewedit works perfectly right from the start.
Indeed, if spellchecking is set to rvlspOnChange, there is an exception raised because the text being entered is only 1 character wide... which implies that for some reason, the tabs created at startup are losing a single character for reasons I just can't comprehend...
All styles are set to unicode, and are using the Arial Unicode MS font .. the program is massively too big (and containing commercial code) for me to paste it for people to weed through. Any ideas on where to start with this?