Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » IME improved support
IME improved support [message #58133] Sat, 26 February 2022 18:41 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
U++ now supports IME (text input for 'complicated' langauges like chinesse) more correcly, on all 3 platforms:

index.php?t=getfile&id=6574&private=0

For the support, there are some new methods in Ctrl interface:

virtual Point GetPreedit();

Should return the position of top left point of insertion point (or Null if widget does not need IME).

virtual Font GetPreeditFont();

Should return the font to be used for displaying partial input (it looks good if it matches the current font of text).

static void CancelPreedit();

Client code can call to "abort" the input - e.g. when user moves the cursor by the mouse click.

void CancelMyPreedit() { if(HasFocus()) CancelPreedit(); }

Similar, with focus test...
  • Attachment: ime_mac.jpg
    (Size: 137.26KB, Downloaded 324 times)
Re: IME improved support [message #58134 is a reply to message #58133] Sun, 27 February 2022 09:39 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Mirek,

Thank you very much for this improvement.
My question is: how are we going to activate or use the preedit in our apps or widgets? (I'd like to test it)


Best regards,
Oblivion


Re: IME improved support [message #58135 is a reply to message #58134] Sun, 27 February 2022 09:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Oblivion wrote on Sun, 27 February 2022 09:39
Hello Mirek,

Thank you very much for this improvement.
My question is: how are we going to activate or use the preedit in our apps or widgets? (I'd like to test it)


Best regards,
Oblivion


Well, reastically, there are just 4 widgets with text input right now - EditField, LineEdit, DocEdit and RichText. All of them have what counts as "full support" and it works out of box.

If you want to develop your own widget with IME support, well, if it shows Caret, you will have IME (because default implementation of GetPreedit returns caret position). The only thing you eventually need to add is CancelMyPreedit here and there to cancel composition on some actions (e.g. cursor moved).
Re: IME improved support [message #58137 is a reply to message #58135] Tue, 01 March 2022 07:45 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Mirek,

Looks very elegant!

However, please fix the following on Linux:

/home/tom/upp.src/uppsrc/CtrlCore/GtkEvent.cpp:659:4: error: expected expression
                        DLOG(GetKeyDesc(kv) << ", pressed: " << pressed << ", count: " << CurrentEvent.count);
                        ^
/home/tom/upp.src/uppsrc/Core/Diag.h:158:26: note: expanded from macro 'DLOG'
#define DLOG(x)          @ // To clean logs after debugging, this produces error in release mode
                         ^
/home/tom/upp.src/uppsrc/CtrlCore/GtkEvent.cpp:669:4: error: expected expression
                        DDUMPHEX(kv);
                        ^
/home/tom/upp.src/uppsrc/Core/Diag.h:164:26: note: expanded from macro 'DDUMPHEX'
#define DDUMPHEX(nx)     @ // To clean logs after debugging, this produces error in release mode
                         ^
2 errors generated.


Best regards,

Tom

EDIT: Sorry this newbie question here... How do I test the IME support? I just wish to know how it works.

[Updated on: Tue, 01 March 2022 08:10]

Report message to a moderator

Re: IME improved support [message #58141 is a reply to message #58133] Thu, 03 March 2022 05:17 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
CLANG-mingw, cross-compilation of Linux.
umk uppsrc ide CLANG -bu
Linking...
lld: error: unable to find library -lImm32

It should be imm32, not Imm32. Linux is case-sensitive ...


Regards,
Novo

[Updated on: Fri, 04 March 2022 01:09]

Report message to a moderator

Re: IME improved support [message #58144 is a reply to message #58137] Thu, 03 March 2022 09:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Tom1 wrote on Tue, 01 March 2022 07:45
Hi Mirek,

Looks very elegant!

However, please fix the following on Linux:

/home/tom/upp.src/uppsrc/CtrlCore/GtkEvent.cpp:659:4: error: expected expression
                        DLOG(GetKeyDesc(kv) << ", pressed: " << pressed << ", count: " << CurrentEvent.count);
                        ^
/home/tom/upp.src/uppsrc/Core/Diag.h:158:26: note: expanded from macro 'DLOG'
#define DLOG(x)          @ // To clean logs after debugging, this produces error in release mode
                         ^
/home/tom/upp.src/uppsrc/CtrlCore/GtkEvent.cpp:669:4: error: expected expression
                        DDUMPHEX(kv);
                        ^
/home/tom/upp.src/uppsrc/Core/Diag.h:164:26: note: expanded from macro 'DDUMPHEX'
#define DDUMPHEX(nx)     @ // To clean logs after debugging, this produces error in release mode
                         ^
2 errors generated.


Best regards,

Tom

EDIT: Sorry this newbie question here... How do I test the IME support? I just wish to know how it works.


In windows, you have to add chinese language in settings.
Re: IME improved support [message #58146 is a reply to message #58141] Thu, 03 March 2022 09:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Thu, 03 March 2022 05:17
CLANG-mingw, cross-compilation of Linux.
umk uppsrc ide CLANG -bu
Linking...
lld: error: unable to find library -lImm32

It should imm32, not Imm32. Linux is case-sensitive ...


Well, it is listed initcaps in reference documentation:

https://docs.microsoft.com/en-us/windows/win32/api/imm/nf-im m-immgetcontext

however, I think it will not hurt to lower the case...

Mirek
Re: IME improved support [message #58156 is a reply to message #58146] Fri, 04 March 2022 01:08 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Thu, 03 March 2022 03:46
Novo wrote on Thu, 03 March 2022 05:17
CLANG-mingw, cross-compilation of Linux.
umk uppsrc ide CLANG -bu
Linking...
lld: error: unable to find library -lImm32

It should imm32, not Imm32. Linux is case-sensitive ...


Well, it is listed initcaps in reference documentation:

https://docs.microsoft.com/en-us/windows/win32/api/imm/nf-im m-immgetcontext

however, I think it will not hurt to lower the case...

Mirek

Thanks! That fixed the problem.


Regards,
Novo
Previous Topic: String::Make - new way how to create a small string fast
Next Topic: FileSel::FileCtrl
Goto Forum:
  


Current Time: Thu Mar 28 20:36:14 CET 2024

Total time taken to generate the page: 0.01162 seconds