March 28, 2024, 04:42:51 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Non English text in IWB

Started by Andy, August 07, 2018, 07:44:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

August 07, 2018, 07:44:37 AM Last Edit: August 07, 2018, 07:46:28 AM by Andy
Now I've asked this question before, but nothing happened about it - but it's needed now.

The IWB editor will not accept Non English characters (here I'm specifically talking about Greek).

So if I want a button / static to say something in Greek I can't type it in.

Ebasic did allow it.

Answers / suggestions / ideas / help please!!   ???

Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

The help file has some info about the SETFONT command and foreign character sets, including GREEK_CHARSET = 0x00A10000

Don't know how it all works, though

Brian

fasecero

This is the only way I can think of it:



$INCLUDE "windowssdk.inc"

CONST BUTTON_1 = 1
WINDOW w1
OPENWINDOW w1,0,0,600,400,@MINBOX|@MAXBOX|@SIZE,NULL,"Simple Window",&w1_handler

'CONTROL w1,@SYSBUTTON,"Button1",129,93,150,20,0x50000000,BUTTON_1
CreateWindowW(L"BUTTON", L"Button1", WS_TABSTOP|WS_VISIBLE|WS_CHILD|BS_CENTER, 129,93,150,20, w1.hwnd, BUTTON_1, GetModuleHandle(0), 0)
SetWindowTextW(GetDlgItem(w1.hwnd, BUTTON_1), GetMyButtonText(16))

' main loop
WAITUNTIL w1 = 0
END

' window procedure
SUB w1_handler
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW w1

CASE @IDCLOSEWINDOW
CLOSEWINDOW w1

CASE @IDCONTROL
SELECT @CONTROLID
CASE BUTTON_1
IF @NOTIFYCODE = 0
/*button clicked*/
MESSAGEBOX(W1,"Button click","hello",@MB_ICONINFORMATION | @MB_OK)
ENDIF
ENDSELECT
ENDSELECT
ENDSUB

SUB GetMyButtonText(INT textLen), WSTRING
wstring text = L""
pointer p = &text + 0

INT j, a
FOR j = 1 TO textLen
GETDATA MYBUTTONTEXT,a
*<char>p = a
p+=1
NEXT j

RETURN text
ENDSUB

DATABEGIN MYBUTTONTEXT
DATA 167, 3, 177, 3, 175, 3, 193, 3, 181, 3, 196, 3, 181, 3, 0, 0 ' unicode bytes for hello or something like that) in greek
DATAEND


Andy

Fasecero,

That gives me ideas, thanks for that.

Where did you find the data values?


DATABEGIN MYBUTTONTEXT
DATA 167, 3, 177, 3, 175, 3, 193, 3, 181, 3, 196, 3, 181, 3, 0, 0 ' unicode bytes for hello or something like that) in greek
DATAEND


Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

August 08, 2018, 06:44:49 AM #4 Last Edit: August 08, 2018, 06:48:29 AM by Andy
This is the magic program, should have guessed Fasecero wrote it!

http://www.ionicwind.com/forums/index.php?topic=6096.msg44833#msg44833

Simply run it, paste in a word, and it gives you the wstring which you can use to display the unicode text with the example program Fasecero has posted here.

Date and Time are shown attached.

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks Egil,

I will check them out, glad to see you back from hospital!!!

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Quoteglad to see you back from hospital!!!

Thanks Andy,

I'm going back the 27th. But this time I'll stay at an hotel next to  the hospital with a very fast WiFi, so I won't feel so isolated as with my former visits. Four weeks whithout web connection almost kills me slowly, so when I discoverred the new arrangement you know what I chose...


Egil
Support Amateur Radio  -  Have a ham  for dinner!