Hi Xiaomei, Sorry for the lack of my responses. It seems a known issue of a RichEdit control (*1), which automatically changes its keyboard layout with the current selection. When I create a simple MFC application which just shows a dialog including a RICHEDIT20 control, it also changes its keyboard layout automatically on my Vista PC.
(*1) http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/b640e764-0c3c-43fc-a670-4c5e73167ce4/ I'm also trying possible solutions for this issue now. Regards, Hironori Bono E-mail: hb...@chromium.org On Tue, May 12, 2009 at 12:19 PM, xji <x...@chromium.org> wrote: > > I have one question might be related to MFC's CRichEditCtrl and > SetParaFormat, and I would appreciate any input. > > TextField::Edit is derived from CWindowImpl<TextField::Edit, > CRichEditCtrl, CWinTraits<kDefaultEditStyle> >. > > Currently, in RTL UI (for example, Hebrew Chrome), the TextField::Edit > is initialized as right-aligned, but with left-to-right layout. > > I am trying to initialize the layout to be right-to-left in RTL UI and > adjust the layout on the fly, which means, if the input text is a pure > LTR text, the layout will be re-set as left-to-right; when there is > RTL character in the text, the layout will be re-set to right-to- > left. (To make it simple, I will assume the text is not an URL, which > should always have LTR directionality.) > > Resetting layout can be achieved by SetParaFormt(). > > But there is one problem that I could not figure out: > > If I type an English character 'a', the layout will be re-set to LTR. > Then, I change the IME to Hebrew and type a Hebrew character, the > layout will be re-set to RTL, and the Hebrew character is placed at > the left side of 'a'. But the IME changed back to English. > > I have no idea why IME change back to English. > > And looks like it does not matter whether I initialize the > TextField::Edit as LTR layout or RTL layout, after type in the first > Hebrew character following the English character, the IME always > change back to English. > > And if I switch the IME to Hebrew again and type in 2nd or more Hebrew > character, the IME will stay as Hebrew. > > I'd appreciate if anyone has any idea on what is going on and why. > > > Thanks, > Xiaomei > > Reply > > Forward > > > > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---