coda
Junior Member
Posts: 74
|
Post by coda on Nov 28, 2021 10:06:47 GMT -5
Hi,
Hi. I've never needed it before so, I've never noticed it couldn't be done until now. I need to be able to display unicode characters in a texteditor window using LB. I am writing a little utility that transliterates foreign alphabets into Roman script and vice versa and I've only just discovered it isn't built into LB, apparently. I am able to process the unicode, myself to achieve the results I want but currently, I have no way to display the unicode text strings I'm working with properly when sent to a texteditor.
Is there a workaround way to get the desired results?
|
|
|
Post by Walt Decker on Nov 28, 2021 11:00:52 GMT -5
Off the top of my head I think you would have to write a dll that accepts unicode in an edit control, take a snapshot of the text in the edit control then display that in an LB graphic control.
Alternatively you might create a Word Pad in an LB window.
|
|
|
Unicode...
Nov 28, 2021 11:07:09 GMT -5
via mobile
Post by Rod on Nov 28, 2021 11:07:09 GMT -5
Check out Alyce’s site in the links section. Her RichText editor may have that functionality.
|
|
|
Post by Walt Decker on Nov 28, 2021 11:14:40 GMT -5
I should have said rich text instead of Word Pad. Word Pad uses a rich text control.
Thanks Rod.
|
|
coda
Junior Member
Posts: 74
|
Post by coda on Nov 28, 2021 11:33:09 GMT -5
Hi guys. Thanks for the responses. Are you referring to this? 'Textpad (Notepad Clone) - from 10 Year Contest' at the Alyce'srestaurant.com site? If so, the link seems to be broken... alycesrestaurant.com//zips/textpad.zip Does Alyce still frequent the forums?
|
|
|
Unicode...
Nov 28, 2021 12:48:47 GMT -5
via mobile
Post by Rod on Nov 28, 2021 12:48:47 GMT -5
Persevere, right click on the link and save to. Depends on the browser but they are getting picky about what downloads automatically.
|
|
coda
Junior Member
Posts: 74
|
Post by coda on Nov 28, 2021 13:21:12 GMT -5
Nope. I'm downloading it manually and I've tried 3 different browsers (Chrome, Firefox & Edge). The file just isn't there anymore... not many of them are...
|
|
coda
Junior Member
Posts: 74
|
Post by coda on Nov 28, 2021 13:57:41 GMT -5
Ok. I can finally download the files but I had to move from a Windows machine to a Linux machine using Firefox and even then I had to copy the link and paste it into the address bar to do it as 'save link as' refuses to work on any browser on any operating system! THAT, was an ordeal and one I don't at all understand. The files are obviously there. What has happened to the internet... or browsers?? lol
|
|
|
Post by Rod on Nov 28, 2021 14:16:07 GMT -5
Its hackers we need hold responsible. I just needed to right click and then select download file but each OS and browser has options.
|
|
|
Post by tenochtitlanuk on Nov 28, 2021 14:19:42 GMT -5
My browser barfed at the double slash in the supplied URL...
|
|
|
Post by Walt Decker on Nov 28, 2021 15:46:47 GMT -5
Mine also at the double slash. However, after downloading the zip it appears that it just uses a standard multi-line edit control, not a rich text control. I am not sure that it will do the job.
However, substituting a richedit control for the standard edit control and the .bas as a template should not be difficult.
|
|
|
Post by Walt Decker on Nov 28, 2021 22:39:05 GMT -5
I have done a little research in a different language and have found that the edit control will accept unicode. For setting an ansi string to unicode use the kernel32.dll MultiByteToWideChar() function and the user32.dll SetWindowTextW() function. That should work in Liberty Basic. If you require changing a portion of the text only use MultiByteToWideChar() and user32.dll function SendMessageW() with the EM.REPLACESEL message.
|
|
coda
Junior Member
Posts: 74
|
Post by coda on Nov 29, 2021 10:24:17 GMT -5
Ok. I have managed to get an rtf edit control into my program using the LBRTF2.dll provided on Alyce Watson's page. This is the multiple instance dll as the single instance dll REALLY is missing and this has been noted in the forum before here: libertybasiccom.proboards.com/thread/1302/where-find-dllsI'm not sure if the single instance dll has any advantages or features that the multi-instance one does not but it is unavailable, anyhow. Alyce's page is and always has been such an invaluable resource for the LB community that it pains me to see it in disrepair. I am very encouraged by your findings, Walt. Are you able to provide a small code snippet to explain?
|
|
|
Post by Walt Decker on Nov 29, 2021 10:49:06 GMT -5
Not at this time. I have a medical appointment today and will be gone most of the day. I will try to get something up tomarrow (30 Nov.) Do you require translation or just copy from existing text?
|
|
|
Post by metro on Nov 29, 2021 19:36:18 GMT -5
This zip is from 2008, I see though, you can still have 100 edit controls. Not sure if its what you are after
metro
|
|